Skip to content

Commit

Permalink
subclass-idbase
Browse files Browse the repository at this point in the history
  • Loading branch information
danakj committed Dec 3, 2024
1 parent 219702a commit 54c90db
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions toolchain/sem_ir/ids.h
Original file line number Diff line number Diff line change
Expand Up @@ -964,16 +964,16 @@ constexpr LocId LocId::Invalid = LocId(Parse::NodeId::Invalid);
// `Any[...]` instruction group.
//
// This type participates in `Inst::FromRaw` in order to convert from specific
// instructions to an `Any[...]` instruction group, but does not participate in
// `Inst::ToRaw` as it's not possible to convert in the other direction:
// instructions to an `Any[...]` instruction group:
// - In the case the specific instruction has a field of some `IdKind` in the
// same position, the `Any[...]` type will hold its raw value in the
// `AnyRawId` field.
// - In the case the specific instruction has no field in the same position, the
// `Any[...]` type will hold a default constructed `AnyRawId` with an invalid
// value.
struct AnyRawId {
int32_t raw_id = IdBase::InvalidIndex;
struct AnyRawId : public IdBase {
constexpr AnyRawId() : IdBase(IdBase::InvalidIndex) {}
constexpr explicit AnyRawId(int32_t id) : IdBase(id) {}
};

} // namespace Carbon::SemIR
Expand Down

0 comments on commit 54c90db

Please sign in to comment.