Files
carbon-lang/toolchain/sem_ir/specific_interface.h
T
Geoff Romer e78af4d745 Misc. improvements to raw/debug SemIR output (#6557)
- Distinguish attached vs. unattached constants.
- Add some missing value stores to the top-level output.
- Add missing fields to various Print methods.
2026-01-14 19:35:34 +00:00

42 lines
1.3 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>;
static const SpecificInterface None;
InterfaceId interface_id;
SpecificId specific_id;
friend auto operator<<(llvm::raw_ostream& out, SpecificInterface si)
-> llvm::raw_ostream& {
out << "{interface_id: " << si.interface_id
<< ", specific_id: " << si.specific_id << "}";
return out;
}
friend auto operator==(const SpecificInterface& lhs,
const SpecificInterface& rhs) -> bool = default;
};
inline constexpr SpecificInterface SpecificInterface::None = {
.interface_id = InterfaceId::None, .specific_id = SpecificId::None};
using SpecificInterfaceStore =
CanonicalValueStore<SpecificInterfaceId, SpecificInterface, Tag<CheckIRId>>;
} // namespace Carbon::SemIR
#endif // CARBON_TOOLCHAIN_SEM_IR_SPECIFIC_INTERFACE_H_