Explorar el Código

Fix LexicalLookupResult's node_id -> inst_id (#3476)

Noticed while working on #3475, but felt like it would be easy enough to
separate out.
Jon Ross-Perkins hace 2 años
padre
commit
18c51ea862
Se han modificado 2 ficheros con 8 adiciones y 8 borrados
  1. 5 5
      toolchain/check/context.cpp
  2. 3 3
      toolchain/check/context.h

+ 5 - 5
toolchain/check/context.cpp

@@ -163,9 +163,9 @@ auto Context::AddNameToLookup(Parse::NodeId name_node, SemIR::NameId name_id,
                  lexical_results.back().scope_index < current_scope_index())
                  lexical_results.back().scope_index < current_scope_index())
         << "Failed to clean up after scope nested within the current scope";
         << "Failed to clean up after scope nested within the current scope";
     lexical_results.push_back(
     lexical_results.push_back(
-        {.node_id = target_id, .scope_index = current_scope_index()});
+        {.inst_id = target_id, .scope_index = current_scope_index()});
   } else {
   } else {
-    DiagnoseDuplicateName(name_node, name_lookup_[name_id].back().node_id);
+    DiagnoseDuplicateName(name_node, name_lookup_[name_id].back().inst_id);
   }
   }
 }
 }
 
 
@@ -201,7 +201,7 @@ auto Context::LookupNameInDecl(Parse::NodeId parse_node, SemIR::NameId name_id,
           << "Should have been erased: " << names().GetFormatted(name_id);
           << "Should have been erased: " << names().GetFormatted(name_id);
       auto result = name_it->second.back();
       auto result = name_it->second.back();
       if (result.scope_index == current_scope_index()) {
       if (result.scope_index == current_scope_index()) {
-        return result.node_id;
+        return result.inst_id;
       }
       }
     }
     }
     return SemIR::InstId::Invalid;
     return SemIR::InstId::Invalid;
@@ -233,7 +233,7 @@ auto Context::LookupUnqualifiedName(Parse::NodeId parse_node,
     // it shadows all further non-lexical results and we're done.
     // it shadows all further non-lexical results and we're done.
     if (!lexical_results.empty() &&
     if (!lexical_results.empty() &&
         lexical_results.back().scope_index > index) {
         lexical_results.back().scope_index > index) {
-      return lexical_results.back().node_id;
+      return lexical_results.back().inst_id;
     }
     }
 
 
     auto non_lexical_result =
     auto non_lexical_result =
@@ -245,7 +245,7 @@ auto Context::LookupUnqualifiedName(Parse::NodeId parse_node,
   }
   }
 
 
   if (!lexical_results.empty()) {
   if (!lexical_results.empty()) {
-    return lexical_results.back().node_id;
+    return lexical_results.back().inst_id;
   }
   }
 
 
   // We didn't find anything at all.
   // We didn't find anything at all.

+ 3 - 3
toolchain/check/context.h

@@ -400,9 +400,9 @@ class Context {
 
 
   // A lookup result in the lexical lookup table `name_lookup_`.
   // A lookup result in the lexical lookup table `name_lookup_`.
   struct LexicalLookupResult {
   struct LexicalLookupResult {
-    // The node that was added to lookup.
-    SemIR::InstId node_id;
-    // The scope in which the node was added.
+    // The instruction that was added to lookup.
+    SemIR::InstId inst_id;
+    // The scope in which the instruction was added.
     ScopeIndex scope_index;
     ScopeIndex scope_index;
   };
   };