mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-06 10:54:49 +01:00
Switch File functions, classes, and types to ValueStores (#3316)
Building on #3313, start using ValueStore on File. Functions and classes are straightforward. Types here I present as a borderline case where maybe we want a more bespoke API, but maybe this is okay? Most other things probably need a slightly different API, which although I might do that for a consistent interface, felt more out-of-scope for this change.
This commit is contained in:
@@ -246,7 +246,8 @@ auto Context::AddCurrentCodeBlockToFunction() -> void {
|
||||
.GetNodeAs<SemIR::FunctionDeclaration>(return_scope_stack().back())
|
||||
.function_id;
|
||||
semantics_ir()
|
||||
.GetFunction(function_id)
|
||||
.functions()
|
||||
.Get(function_id)
|
||||
.body_block_ids.push_back(node_block_stack().PeekOrAdd());
|
||||
}
|
||||
|
||||
@@ -709,7 +710,7 @@ auto Context::CanonicalizeTypeImpl(
|
||||
}
|
||||
|
||||
auto node_id = make_node();
|
||||
auto type_id = semantics_ir_->AddType(node_id);
|
||||
auto type_id = semantics_ir_->types().Add({.node_id = node_id});
|
||||
CARBON_CHECK(canonical_types_.insert({node_id, type_id}).second);
|
||||
type_node_storage_.push_back(
|
||||
std::make_unique<TypeNode>(canonical_id, type_id));
|
||||
|
||||
Reference in New Issue
Block a user