pointer_dereference.h 904 B

123456789101112131415161718192021222324
  1. // Part of the Carbon Language project, under the Apache License v2.0 with LLVM
  2. // Exceptions. See /LICENSE for license information.
  3. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. #ifndef CARBON_TOOLCHAIN_CHECK_POINTER_DEREFERENCE_H_
  5. #define CARBON_TOOLCHAIN_CHECK_POINTER_DEREFERENCE_H_
  6. #include "llvm/ADT/STLFunctionalExtras.h"
  7. #include "toolchain/check/context.h"
  8. #include "toolchain/parse/node_ids.h"
  9. #include "toolchain/sem_ir/ids.h"
  10. namespace Carbon::Check {
  11. // Creates SemIR to perform a pointer dereference with base expression
  12. // `base_id`. Returns the result of the access.
  13. auto PerformPointerDereference(
  14. Context& context, SemIR::LocId loc_id, SemIR::InstId base_i,
  15. llvm::function_ref<auto(SemIR::TypeId not_pointer_type_id)->void>
  16. diagnose_not_pointer) -> SemIR::InstId;
  17. } // namespace Carbon::Check
  18. #endif // CARBON_TOOLCHAIN_CHECK_POINTER_DEREFERENCE_H_