mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-24 21:10:12 +01:00
As suggested in [1], replace `FieldInitializerMap` with a `FieldStore`. The corresponding `FieldId` is now stored in `FieldDecl`. To make room for the `FieldId`, the `ElementIndex` is now stored in the `Field`, along with the initializer. In import_ref.cpp, resolving `FieldDecl` initializers is now supported, and in convert.cpp `LoadImportRef` is called to do so. The `field_initializer_import.carbon` test now passes. Printing a `FieldDecl` instruction now prints the initializer as well, if present. See field_initializer.carbon for an example. [1]: https://github.com/carbon-language/carbon-lang/pull/7238#discussion_r3283217158
12 lines
398 B
C++
12 lines
398 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
|
|
|
|
#include "toolchain/sem_ir/field.h"
|
|
|
|
#include "toolchain/base/value_store_impl.h"
|
|
|
|
namespace Carbon {
|
|
template class ValueStore<SemIR::FieldId, SemIR::Field, Tag<SemIR::CheckIRId>>;
|
|
} // namespace Carbon
|