Explorar o código

Change Dump functions to static where appropriate. (#4712)

Verified under LLDB these still appear callable; I'm expecting GDB to be
the same. My concern about debugger calls to static functions was just
wrong.
Jon Ross-Perkins hai 1 ano
pai
achega
ecda309c12
Modificáronse 2 ficheiros con 3 adicións e 5 borrados
  1. 0 2
      toolchain/check/BUILD
  2. 3 3
      toolchain/check/dump.cpp

+ 0 - 2
toolchain/check/BUILD

@@ -95,8 +95,6 @@ cc_library(
 cc_library(
     name = "dump",
     srcs = ["dump.cpp"],
-    # Contains Dump methods without a forward declaration.
-    copts = ["-Wno-missing-prototypes"],
     deps = [
         ":context",
         "//common:check",

+ 3 - 3
toolchain/check/dump.cpp

@@ -57,17 +57,17 @@ static auto DumpNoNewline(const Context& context, SemIR::LocId loc_id) -> void {
   }
 }
 
-LLVM_DUMP_METHOD auto Dump(const Context& context, Lex::TokenIndex token)
+LLVM_DUMP_METHOD static auto Dump(const Context& context, Lex::TokenIndex token)
     -> void {
   Parse::Dump(context.parse_tree(), token);
 }
 
-LLVM_DUMP_METHOD auto Dump(const Context& context, Parse::NodeId node_id)
+LLVM_DUMP_METHOD static auto Dump(const Context& context, Parse::NodeId node_id)
     -> void {
   Parse::Dump(context.parse_tree(), node_id);
 }
 
-LLVM_DUMP_METHOD auto Dump(const Context& context, SemIR::LocId loc_id)
+LLVM_DUMP_METHOD static auto Dump(const Context& context, SemIR::LocId loc_id)
     -> void {
   DumpNoNewline(context, loc_id);
   llvm::errs() << '\n';