deduce.h 1.2 KB

123456789101112131415161718192021222324252627282930
  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_DEDUCE_H_
  5. #define CARBON_TOOLCHAIN_CHECK_DEDUCE_H_
  6. #include "toolchain/check/context.h"
  7. #include "toolchain/sem_ir/ids.h"
  8. namespace Carbon::Check {
  9. // Deduces the generic arguments to use in a call to a generic.
  10. auto DeduceGenericCallArguments(
  11. Context& context, SemIR::LocId loc_id, SemIR::GenericId generic_id,
  12. SemIR::SpecificId enclosing_specific_id, SemIR::InstId self_type_id,
  13. SemIR::InstBlockId implicit_param_patterns_id,
  14. SemIR::InstBlockId param_patterns_id, SemIR::InstId self_id,
  15. llvm::ArrayRef<SemIR::InstId> arg_ids) -> SemIR::SpecificId;
  16. // Deduces the impl arguments to use in a use of a parameterized impl. Returns
  17. // `None` if deduction fails.
  18. auto DeduceImplArguments(Context& context, SemIR::LocId loc_id,
  19. const SemIR::Impl& impl, SemIR::ConstantId self_id,
  20. SemIR::SpecificId constraint_specific_id)
  21. -> SemIR::SpecificId;
  22. } // namespace Carbon::Check
  23. #endif // CARBON_TOOLCHAIN_CHECK_DEDUCE_H_