specific_interface.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  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_INTERFACE_H_
  5. #define CARBON_TOOLCHAIN_SEM_IR_SPECIFIC_INTERFACE_H_
  6. #include "toolchain/base/canonical_value_store.h"
  7. #include "toolchain/sem_ir/ids.h"
  8. namespace Carbon::SemIR {
  9. // A pair of an interface and a specific for that interface.
  10. struct SpecificInterface {
  11. using DiagnosticType = Diagnostics::TypeInfo<std::string>;
  12. InterfaceId interface_id;
  13. SpecificId specific_id;
  14. static const SpecificInterface None;
  15. friend auto operator==(const SpecificInterface& lhs,
  16. const SpecificInterface& rhs) -> bool = default;
  17. };
  18. constexpr SpecificInterface SpecificInterface::None = {
  19. .interface_id = InterfaceId::None, .specific_id = SpecificId::None};
  20. using SpecificInterfaceStore =
  21. CanonicalValueStore<SpecificInterfaceId, SpecificInterface>;
  22. } // namespace Carbon::SemIR
  23. #endif // CARBON_TOOLCHAIN_SEM_IR_SPECIFIC_INTERFACE_H_