mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 15:51:07 +01:00
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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user