Files
carbon-lang/toolchain/sem_ir/field.h
T
Nicholas Bishop d8bb181db8 Fix SemIR not showing insts used to compute FieldDecl type (#7706)
Add an `ExprRegionId` to `FieldDecl`. This required moving the `NameId`
into `Field`.
2026-09-02 20:28:05 +00:00

35 lines
990 B
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_FIELD_H_
#define CARBON_TOOLCHAIN_SEM_IR_FIELD_H_
#include "toolchain/base/value_store.h"
#include "toolchain/sem_ir/ids.h"
namespace Carbon::SemIR {
// A class field.
struct Field : public Printable<Field> {
ElementIndex index;
NameId name_id;
SemIR::InstId initializer_id;
auto Print(llvm::raw_ostream& out) const -> void {
out << "{index: " << index << ", name_id: " << name_id
<< ", initializer_id: " << initializer_id << "}";
}
};
using FieldStore = ValueStore<FieldId, Field, Tag<CheckIRId>>;
} // namespace Carbon::SemIR
namespace Carbon {
extern template class ValueStore<SemIR::FieldId, SemIR::Field,
Tag<SemIR::CheckIRId>>;
} // namespace Carbon
#endif // CARBON_TOOLCHAIN_SEM_IR_FIELD_H_