From 034e374f0ae129061915ebd331de9e6925ad5380 Mon Sep 17 00:00:00 2001 From: josh11b <15258583+josh11b@users.noreply.github.com> Date: Thu, 17 Apr 2025 17:58:31 -0700 Subject: [PATCH] Add TODOs re: `pattern_block_id` to `inst_namer.cpp` (#5331) From https://github.com/carbon-language/carbon-lang/pull/5310#discussion_r2045291737 --------- Co-authored-by: Josh L --- toolchain/sem_ir/inst_namer.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/toolchain/sem_ir/inst_namer.cpp b/toolchain/sem_ir/inst_namer.cpp index 616b6182a8c0..f4543ccc4cc8 100644 --- a/toolchain/sem_ir/inst_namer.cpp +++ b/toolchain/sem_ir/inst_namer.cpp @@ -587,6 +587,8 @@ auto InstNamer::CollectNamesInBlock(ScopeId top_scope_id, const auto& class_info = sem_ir_->classes().Get(inst.class_id); add_inst_name_id(class_info.name_id, ".decl"); auto class_scope_id = GetScopeFor(inst.class_id); + // TODO: Should do this as part of building the class scope in the + // InstNamer constructor, not here. queue_block_id(class_scope_id, class_info.pattern_block_id); queue_block_id(class_scope_id, inst.decl_block_id); continue; @@ -676,6 +678,8 @@ auto InstNamer::CollectNamesInBlock(ScopeId top_scope_id, const auto& function_info = sem_ir_->functions().Get(inst.function_id); add_inst_name_id(function_info.name_id, ".decl"); auto function_scope_id = GetScopeFor(inst.function_id); + // TODO: Should do this as part of building the function scope in the + // InstNamer constructor, not here. queue_block_id(function_scope_id, function_info.pattern_block_id); queue_block_id(function_scope_id, inst.decl_block_id); continue; @@ -697,6 +701,8 @@ auto InstNamer::CollectNamesInBlock(ScopeId top_scope_id, } case CARBON_KIND(ImplDecl inst): { auto impl_scope_id = GetScopeFor(inst.impl_id); + // TODO: Should do this as part of building the impl scope in the + // InstNamer constructor, not here. queue_block_id(impl_scope_id, sem_ir_->impls().Get(inst.impl_id).pattern_block_id); queue_block_id(impl_scope_id, inst.decl_block_id); @@ -795,6 +801,8 @@ auto InstNamer::CollectNamesInBlock(ScopeId top_scope_id, sem_ir_->interfaces().Get(inst.interface_id); add_inst_name_id(interface_info.name_id, ".decl"); auto interface_scope_id = GetScopeFor(inst.interface_id); + // TODO: Should do this as part of building the interface scope in the + // InstNamer constructor, not here. queue_block_id(interface_scope_id, interface_info.pattern_block_id); queue_block_id(interface_scope_id, inst.decl_block_id); continue;