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
+1 -1
View File
@@ -62,7 +62,7 @@ auto FunctionContext::LowerBlockContents(SemIR::InstBlockId block_id) -> void {
// On crash, report the instruction we were lowering.
PrettyStackTraceFunction stack_trace_entry([&](llvm::raw_ostream& output) {
SemIR::DiagnosticLocConverter converter(
file_context_->context().tree_and_subtrees_getters(), &sem_ir());
&file_context_->context().tree_and_subtrees_getters(), &sem_ir());
auto converted = converter.Convert(SemIR::LocId(inst_id_for_stack_trace),
/*token_only=*/false);
converted.loc.FormatLocation(output);