mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +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:
@@ -64,7 +64,7 @@ auto SetSpecialImportIRs(Context& context, SemIR::ImportIR import_ir) -> void {
|
||||
|
||||
auto AddImportIR(Context& context, SemIR::ImportIR import_ir)
|
||||
-> SemIR::ImportIRId {
|
||||
auto& ir_id = context.check_ir_map()[import_ir.sem_ir->check_ir_id().index];
|
||||
auto& ir_id = context.check_ir_map().Get(import_ir.sem_ir->check_ir_id());
|
||||
if (!ir_id.has_value()) {
|
||||
// Note this updates check_ir_map.
|
||||
ir_id = InternalAddImportIR(context, import_ir);
|
||||
|
||||
Reference in New Issue
Block a user