Down with statics!
authorOwen Anderson <resistor@mac.com>
Wed, 24 Jun 2009 22:53:20 +0000 (22:53 +0000)
committerOwen Anderson <resistor@mac.com>
Wed, 24 Jun 2009 22:53:20 +0000 (22:53 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74134 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/CodeGen/AsmPrinter.h
lib/CodeGen/AsmPrinter/DwarfDebug.cpp

index 105d7730407f20f97005a6eee62bfa9751bfc278..9f74452c5996653acdf1f35a26bc3837a2ac99b2 100644 (file)
@@ -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,
index 9d340e3aee584f4d5645ab9a2ad87abdd1fdd817..7f9894d39eaf1bbfa19b6d018e44b57cdc27583f 100644 (file)
@@ -141,9 +141,12 @@ class VISIBILITY_HIDDEN DbgScope {
   SmallVector<DbgScope *, 4> Scopes;  // Scopes defined in scope.
   SmallVector<DbgVariable *, 8> Variables;// Variables declared in scope.
   SmallVector<DbgConcreteScope *, 8> 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();