call.h 1.5 KB

123456789101112131415161718192021222324252627282930313233
  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_CALL_H_
  5. #define CARBON_TOOLCHAIN_CHECK_CALL_H_
  6. #include "toolchain/check/context.h"
  7. #include "toolchain/sem_ir/ids.h"
  8. namespace Carbon::Check {
  9. // Checks and builds SemIR for a call to `callee_id` with arguments `args_id`,
  10. // where the callee is a function. `is_desugared` indicates that this call
  11. // was produced by desugaring, not written as a function call in user code, so
  12. // arguments to `ref` parameters aren't required to have `ref` tags.
  13. auto PerformCallToFunction(Context& context, SemIR::LocId loc_id,
  14. SemIR::InstId callee_id,
  15. const SemIR::CalleeFunction& callee_function,
  16. llvm::ArrayRef<SemIR::InstId> arg_ids,
  17. bool is_desugared) -> SemIR::InstId;
  18. // Checks and builds SemIR for a call to `callee_id` with arguments `args_id`.
  19. // `is_desugared` indicates that this call
  20. // was generated from an operator rather than from function call syntax, so
  21. // arguments to `ref` parameters aren't required to have `ref` tags.
  22. auto PerformCall(Context& context, SemIR::LocId loc_id, SemIR::InstId callee_id,
  23. llvm::ArrayRef<SemIR::InstId> arg_ids,
  24. bool is_desugared = false) -> SemIR::InstId;
  25. } // namespace Carbon::Check
  26. #endif // CARBON_TOOLCHAIN_CHECK_CALL_H_