Expand use of CheckIRId stores (#5820)

This is trying to make it clearer when vectors are being indexed with
`CheckIRId`.

The only one that I still kind of want to change is the
`SmallVector<std::unique_ptr<CompilationUnit>>`, but because it's a
`unique_ptr` that's a little more complex. I may not bother.

Note, some of the changes around nuanced `SmallVector` interactions were
based on trying to copy the way `SmallVector` itself takes arguments,
like with range passing.
This commit is contained in:
Jon Ross-Perkins
2025-07-21 20:02:27 +00:00
committed by GitHub
parent 7ccc1e0144
commit bd4fbb4393
25 changed files with 171 additions and 116 deletions
+4 -1
View File
@@ -9,6 +9,7 @@
#include "common/check.h"
#include "toolchain/check/deferred_definition_worklist.h"
#include "toolchain/sem_ir/ids.h"
namespace Carbon::Check {
@@ -29,6 +30,9 @@ Context::Context(DiagnosticEmitterBase* emitter,
scope_stack_(sem_ir_),
deferred_definition_worklist_(vlog_stream),
vtable_stack_("vtable_stack_", *sem_ir, vlog_stream),
check_ir_map_(
FixedSizeValueStore<SemIR::CheckIRId, SemIR::ImportIRId>::
MakeWithExplicitSize(total_ir_count, SemIR::ImportIRId::None)),
global_init_(this),
region_stack_([this](SemIR::LocId loc_id, std::string label) {
TODO(loc_id, label);
@@ -36,7 +40,6 @@ Context::Context(DiagnosticEmitterBase* emitter,
// Prepare fields which relate to the number of IRs available for import.
import_irs().Reserve(imported_ir_count);
import_ir_constant_values_.reserve(imported_ir_count);
check_ir_map_.resize(total_ir_count, SemIR::ImportIRId::None);
}
auto Context::TODO(SemIR::LocId loc_id, std::string label) -> bool {