Add more value store types to File. (#3317)

Finishing what #3316 started, add more bespoke ValueStore-like
structures to File. With this, the things which previously had somewhat
boilerplate Add/Get functions are now all on side classes, giving a
uniform style of API for calling.

Note, I was on the fence about making things public on ValueStore. If
it's preferred that I make some things there protected I certainly can,
there's just a trade-off that may mean more distinct child/wrapper
types.
This commit is contained in:
Jon Ross-Perkins
2023-10-24 18:23:40 +00:00
committed by GitHub
parent 1b0e2d3a4b
commit 1d6298290f
31 changed files with 476 additions and 381 deletions
+2 -2
View File
@@ -38,8 +38,8 @@ auto FunctionContext::TryToReuseBlock(SemIR::NodeBlockId block_id,
}
auto FunctionContext::LowerBlock(SemIR::NodeBlockId block_id) -> void {
for (const auto& node_id : semantics_ir().GetNodeBlock(block_id)) {
auto node = semantics_ir().GetNode(node_id);
for (const auto& node_id : semantics_ir().node_blocks().Get(block_id)) {
auto node = semantics_ir().nodes().Get(node_id);
CARBON_VLOG() << "Lowering " << node_id << ": " << node << "\n";
// clang warns on unhandled enum values; clang-tidy is incorrect here.
// NOLINTNEXTLINE(bugprone-switch-missing-default-case)