From 8daf07daf96238066d0f970fd30c3ac5a70641cf Mon Sep 17 00:00:00 2001 From: Rahul Joshi Date: Fri, 9 Jan 2026 14:00:26 -0800 Subject: [PATCH] [NFC][LLVM] Minor namespace cleanup in llvm-dis.cpp --- llvm/tools/llvm-dis/llvm-dis.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/llvm/tools/llvm-dis/llvm-dis.cpp b/llvm/tools/llvm-dis/llvm-dis.cpp index 90ae3ef077ae9..818185ff5c6ca 100644 --- a/llvm/tools/llvm-dis/llvm-dis.cpp +++ b/llvm/tools/llvm-dis/llvm-dis.cpp @@ -91,8 +91,6 @@ static cl::opt PrintThinLTOIndexOnly( cl::desc("Only read thinlto index and print the index as LLVM assembly."), cl::init(false), cl::Hidden, cl::cat(DisCategory)); -namespace { - static void printDebugLoc(const DebugLoc &DL, formatted_raw_ostream &OS) { OS << DL.getLine() << ":" << DL.getCol(); if (DILocation *IDL = DL.getInlinedAt()) { @@ -100,6 +98,8 @@ static void printDebugLoc(const DebugLoc &DL, formatted_raw_ostream &OS) { printDebugLoc(IDL, OS); } } + +namespace { class CommentWriter : public AssemblyAnnotationWriter { private: bool canSafelyAccessUses(const Value &V) { @@ -117,6 +117,7 @@ class CommentWriter : public AssemblyAnnotationWriter { OS << "; [#uses=" << F->getNumUses() << ']'; // Output # uses OS << '\n'; } + void printInfoComment(const Value &V, formatted_raw_ostream &OS) override { if (!canSafelyAccessUses(V)) return; @@ -165,7 +166,7 @@ struct LLVMDisDiagnosticHandler : public DiagnosticHandler { return true; } }; -} // end anon namespace +} // namespace static ExitOnError ExitOnErr;