From 7b32a5b971bc9e5f05dd8ba8ef87eb926044f7d7 Mon Sep 17 00:00:00 2001 From: Owen Anderson Date: Wed, 24 Jun 2009 22:53:20 +0000 Subject: [PATCH] Down with statics! llvm-svn: 74134 --- include/llvm/CodeGen/AsmPrinter.h | 3 +++ lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/include/llvm/CodeGen/AsmPrinter.h b/include/llvm/CodeGen/AsmPrinter.h index 105d7730407..9f74452c599 100644 --- a/include/llvm/CodeGen/AsmPrinter.h +++ b/include/llvm/CodeGen/AsmPrinter.h @@ -114,6 +114,9 @@ namespace llvm { mutable const MachineInstr *LastMI; mutable const Function *LastFn; mutable unsigned Counter; + + // Private state for dump() + static unsigned IndentLevel; protected: explicit AsmPrinter(raw_ostream &o, TargetMachine &TM, diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index 9d340e3aee5..7f9894d39ea 100644 --- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -141,9 +141,12 @@ class VISIBILITY_HIDDEN DbgScope { SmallVector Scopes; // Scopes defined in scope. SmallVector Variables;// Variables declared in scope. SmallVector ConcreteInsts;// Concrete insts of funcs. + + // Private state for dump() + mutable unsigned IndentLevel; public: DbgScope(DbgScope *P, DIDescriptor D) - : Parent(P), Desc(D), StartLabelID(0), EndLabelID(0) {} + : Parent(P), Desc(D), StartLabelID(0), EndLabelID(0), IndentLevel(0) {} virtual ~DbgScope(); // Accessors. @@ -176,7 +179,6 @@ public: #ifndef NDEBUG void DbgScope::dump() const { - static unsigned IndentLevel = 0; std::string Indent(IndentLevel, ' '); cerr << Indent; Desc.dump();