specific_named_constraint.h 1.0 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_SEM_IR_SPECIFIC_NAMED_CONSTRAINT_H_
  5. #define CARBON_TOOLCHAIN_SEM_IR_SPECIFIC_NAMED_CONSTRAINT_H_
  6. #include "toolchain/base/canonical_value_store.h"
  7. #include "toolchain/sem_ir/ids.h"
  8. namespace Carbon::SemIR {
  9. // A pair of a named constraint and a specific for that named constraint.
  10. struct SpecificNamedConstraint {
  11. static const SpecificNamedConstraint None;
  12. NamedConstraintId named_constraint_id;
  13. SpecificId specific_id;
  14. friend auto operator==(const SpecificNamedConstraint& lhs,
  15. const SpecificNamedConstraint& rhs) -> bool = default;
  16. };
  17. inline constexpr SpecificNamedConstraint SpecificNamedConstraint::None = {
  18. .named_constraint_id = NamedConstraintId::None,
  19. .specific_id = SpecificId::None};
  20. } // namespace Carbon::SemIR
  21. #endif // CARBON_TOOLCHAIN_SEM_IR_SPECIFIC_NAMED_CONSTRAINT_H_