impl.h 1.2 KB

1234567891011121314151617181920212223242526272829303132
  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_IMPL_H_
  5. #define CARBON_TOOLCHAIN_CHECK_IMPL_H_
  6. #include "toolchain/check/context.h"
  7. #include "toolchain/sem_ir/ids.h"
  8. namespace Carbon::Check {
  9. // Returns the initial witness value for a new impl declaration.
  10. auto ImplWitnessForDeclaration(Context& context, const SemIR::Impl& impl)
  11. -> SemIR::InstId;
  12. auto AddConstantsToImplWitnessFromConstraint(Context& context,
  13. const SemIR::Impl& impl,
  14. SemIR::InstId witness_id) -> void;
  15. // Update `impl`'s witness at the start of a definition.
  16. auto ImplWitnessStartDefinition(Context& context, SemIR::Impl& impl) -> void;
  17. // Adds the function members to the witness for `impl`.
  18. auto FinishImplWitness(Context& context, SemIR::Impl& impl) -> void;
  19. // Sets all unset members of the witness for `impl` to the error instruction.
  20. auto FillImplWitnessWithErrors(Context& context, SemIR::Impl& impl) -> void;
  21. } // namespace Carbon::Check
  22. #endif // CARBON_TOOLCHAIN_CHECK_IMPL_H_