From ecda309c12b507298577e6d6f48af5dae71b3926 Mon Sep 17 00:00:00 2001 From: Jon Ross-Perkins Date: Wed, 18 Dec 2024 15:58:01 -0800 Subject: [PATCH] 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. --- toolchain/check/BUILD | 2 -- toolchain/check/dump.cpp | 6 +++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/toolchain/check/BUILD b/toolchain/check/BUILD index 213513bdbef18..884183ac7f0d2 100644 --- a/toolchain/check/BUILD +++ b/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", diff --git a/toolchain/check/dump.cpp b/toolchain/check/dump.cpp index d92306c78d518..4823890d77701 100644 --- a/toolchain/check/dump.cpp +++ b/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';