Преглед на файлове

Finish "declaration" -> "decl" (#3391)

Some new uses of "declaration" introduced in #3374 were missed in #3382
since #3374 was still in flight.
josh11b преди 2 години
родител
ревизия
522dcc44c5
променени са 3 файла, в които са добавени 5 реда и са изтрити 6 реда
  1. 1 1
      toolchain/check/handle_function.cpp
  2. 2 3
      toolchain/check/return.cpp
  3. 2 2
      toolchain/sem_ir/file.h

+ 1 - 1
toolchain/check/handle_function.cpp

@@ -100,7 +100,7 @@ static auto BuildFunctionDecl(Context& context, bool is_definition)
              name_context.state == DeclNameStack::NameContext::State::Unresolved
                  ? name_context.unresolved_name_id
                  : SemIR::NameId::Invalid,
-         .declaration_id = function_decl_id,
+         .decl_id = function_decl_id,
          .implicit_param_refs_id = implicit_param_refs_id,
          .param_refs_id = param_refs_id,
          .return_type_id = return_type_id,

+ 2 - 3
toolchain/check/return.cpp

@@ -34,7 +34,7 @@ static auto NoteNoReturnTypeProvided(Context& context,
                                      const SemIR::Function& function) {
   CARBON_DIAGNOSTIC(ReturnTypeOmittedNote, Note,
                     "There was no return type provided.");
-  diag.Note(context.insts().Get(function.declaration_id).parse_node(),
+  diag.Note(context.insts().Get(function.decl_id).parse_node(),
             ReturnTypeOmittedNote);
 }
 
@@ -43,8 +43,7 @@ static auto NoteReturnType(Context& context, Context::DiagnosticBuilder& diag,
                            const SemIR::Function& function) {
   // TODO: This is the location of the `fn` keyword. Find the location of the
   // return type.
-  auto type_parse_node =
-      context.insts().Get(function.declaration_id).parse_node();
+  auto type_parse_node = context.insts().Get(function.decl_id).parse_node();
   CARBON_DIAGNOSTIC(ReturnTypeHereNote, Note,
                     "Return type of function is `{0}`.", std::string);
   diag.Note(type_parse_node, ReturnTypeHereNote,

+ 2 - 2
toolchain/sem_ir/file.h

@@ -37,8 +37,8 @@ struct Function : public Printable<Function> {
 
   // The function name.
   NameId name_id;
-  // The first declaration of the function. This is a FunctionDeclaration.
-  InstId declaration_id = InstId::Invalid;
+  // The first declaration of the function. This is a FunctionDecl.
+  InstId decl_id = InstId::Invalid;
   // The definition, if the function has been defined or is currently being
   // defined. This is a FunctionDecl.
   InstId definition_id = InstId::Invalid;