mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-24 22:02:23 +01:00
`SpecificInterface` seems oddly placed. It appears to be in ids.h just because it's used by typed_insts.h, but maybe that should be factored differently? We typically aren't having typed_insts.h depend on non-ID types. To that end, I'm splitting it out to its own file so that at least I'm not adding a `ValueStore` dep inside ids.h --------- Co-authored-by: Richard Smith <richard@metafoo.co.uk>
35 lines
1.1 KiB
C++
35 lines
1.1 KiB
C++
// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
|
|
// Exceptions. See /LICENSE for license information.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
|
|
#ifndef CARBON_TOOLCHAIN_SEM_IR_SPECIFIC_INTERFACE_H_
|
|
#define CARBON_TOOLCHAIN_SEM_IR_SPECIFIC_INTERFACE_H_
|
|
|
|
#include "toolchain/base/canonical_value_store.h"
|
|
#include "toolchain/sem_ir/ids.h"
|
|
|
|
namespace Carbon::SemIR {
|
|
|
|
// A pair of an interface and a specific for that interface.
|
|
struct SpecificInterface {
|
|
using DiagnosticType = Diagnostics::TypeInfo<std::string>;
|
|
|
|
InterfaceId interface_id;
|
|
SpecificId specific_id;
|
|
|
|
static const SpecificInterface None;
|
|
|
|
friend auto operator==(const SpecificInterface& lhs,
|
|
const SpecificInterface& rhs) -> bool = default;
|
|
};
|
|
|
|
constexpr SpecificInterface SpecificInterface::None = {
|
|
.interface_id = InterfaceId::None, .specific_id = SpecificId::None};
|
|
|
|
using SpecificInterfaceStore =
|
|
CanonicalValueStore<SpecificInterfaceId, SpecificInterface>;
|
|
|
|
} // namespace Carbon::SemIR
|
|
|
|
#endif // CARBON_TOOLCHAIN_SEM_IR_SPECIFIC_INTERFACE_H_
|