[llvm-branch-commits] [llvm-branch] r87064 - /llvm/branches/Apple/Leela/lib/CodeGen/AsmPrinter/DwarfDebug.cpp

Devang Patel dpatel at apple.com
Thu Nov 12 17:57:23 PST 2009


Author: dpatel
Date: Thu Nov 12 19:57:23 2009
New Revision: 87064

URL: http://llvm.org/viewvc/llvm-project?rev=87064&view=rev
Log:
Do not use first function scope as the current function scope. First function scope may be pointing to a inlined function.
During EndFunction, cleanup containers even if current function scope is not seen.

Modified:
    llvm/branches/Apple/Leela/lib/CodeGen/AsmPrinter/DwarfDebug.cpp

Modified: llvm/branches/Apple/Leela/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Leela/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=87064&r1=87063&r2=87064&view=diff

==============================================================================
--- llvm/branches/Apple/Leela/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)
+++ llvm/branches/Apple/Leela/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Thu Nov 12 19:57:23 2009
@@ -1346,10 +1346,12 @@
 
   if (Parent)
     Parent->AddScope(NScope);
-  else
-    // First function is top level function.
-    if (!FunctionDbgScope)
+  else {
+    DISubprogram SP(N);
+    if (!SP.isNull() &&
+        !strcmp(SP.getLinkageName(), MF->getFunction()->getNameStr().c_str()))
       FunctionDbgScope = NScope;
+  }
 
   DbgScopeMap.insert(std::make_pair(N, NScope));
   return NScope;
@@ -2051,18 +2053,16 @@
                                                MMI->getFrameMoves()));
 
   // Clear debug info
-  if (FunctionDbgScope) {
-    delete FunctionDbgScope;
-    DbgScopeMap.clear();
-    DbgScopeBeginMap.clear();
-    DbgScopeEndMap.clear();
-    DbgAbstractScopeMap.clear();
-    DbgConcreteScopeMap.clear();
-    FunctionDbgScope = NULL;
-    LexicalScopeStack.clear();
-    AbstractInstanceRootList.clear();
-    AbstractInstanceRootMap.clear();
-  }
+  delete FunctionDbgScope;
+  DbgScopeMap.clear();
+  DbgScopeBeginMap.clear();
+  DbgScopeEndMap.clear();
+  DbgAbstractScopeMap.clear();
+  DbgConcreteScopeMap.clear();
+  FunctionDbgScope = NULL;
+  LexicalScopeStack.clear();
+  AbstractInstanceRootList.clear();
+  AbstractInstanceRootMap.clear();
 
   Lines.clear();
 





More information about the llvm-branch-commits mailing list