[llvm-commits] [llvm] r62092 - /llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp

Devang Patel dpatel at apple.com
Mon Jan 12 10:48:36 PST 2009


Author: dpatel
Date: Mon Jan 12 12:48:36 2009
New Revision: 62092

URL: http://llvm.org/viewvc/llvm-project?rev=62092&view=rev
Log:
Clear debug info at the end of function processing.

Modified:
    llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp?rev=62092&r1=62091&r2=62092&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp Mon Jan 12 12:48:36 2009
@@ -1249,7 +1249,10 @@
   DbgScope(DbgScope *P, DIDescriptor *D)
   : Parent(P), Desc(D), StartLabelID(0), EndLabelID(0), Scopes(), Variables()
   {}
-  ~DbgScope();
+  ~DbgScope() {
+    for (unsigned i = 0, N = Scopes.size(); i < N; ++i) delete Scopes[i];
+    for (unsigned j = 0, M = Variables.size(); j < M; ++j) delete Variables[j];
+  }
   
   // Accessors.
   DbgScope *getParent()        const { return Parent; }
@@ -3821,6 +3824,14 @@
 
     DebugFrames.push_back(FunctionDebugFrameInfo(SubprogramCount,
                                                  MMI->getFrameMoves()));
+
+    // Clear debug info
+    if (RootDbgScope) {
+      delete RootDbgScope;
+      DbgScopeMap.clear();
+      RootDbgScope = NULL;
+    }
+    Lines.clear();
   }
 };
 





More information about the llvm-commits mailing list