[NFC][LLVM] Minor namespace cleanup in llvm-dis.cpp (#175254)

Move static function `printDebugLoc` out of anonymous namespace.
This commit is contained in:
Rahul Joshi 2026-01-12 09:58:59 -08:00 committed by GitHub
parent 9f3551154c
commit 8e8a5502cb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -91,8 +91,6 @@ static cl::opt<bool> 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 @@ public:
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;