[llvm-branch-commits] [cfe-tag] r93894 - /cfe/tags/Apple/clang-54.1/clang/lib/CodeGen/AsmPrinter/DwarfDebug.cpp

Ted Kremenek kremenek at apple.com
Tue Jan 19 11:38:25 PST 2010


Author: kremenek
Date: Tue Jan 19 13:38:25 2010
New Revision: 93894

URL: http://llvm.org/viewvc/llvm-project?rev=93894&view=rev
Log:
Merge in r93494.

Modified:
    cfe/tags/Apple/clang-54.1/clang/lib/CodeGen/AsmPrinter/DwarfDebug.cpp

Modified: cfe/tags/Apple/clang-54.1/clang/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/tags/Apple/clang-54.1/clang/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=93894&r1=93893&r2=93894&view=diff

==============================================================================
--- cfe/tags/Apple/clang-54.1/clang/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)
+++ cfe/tags/Apple/clang-54.1/clang/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Tue Jan 19 13:38:25 2010
@@ -1653,8 +1653,11 @@
   ModuleCU->insertDIE(N, VariableDie);
 
   // Add to context owner.
-  if (DI_GV.isDefinition() 
-      && !DI_GV.getContext().isCompileUnit()) {
+  DIDescriptor GVContext = DI_GV.getContext();
+  // Do not create specification DIE if context is either compile unit
+  // or a subprogram.
+  if (DI_GV.isDefinition() && !GVContext.isCompileUnit()
+      && !GVContext.isSubprogram()) {
     // Create specification DIE.
     DIE *VariableSpecDIE = new DIE(dwarf::DW_TAG_variable);
     addDIEEntry(VariableSpecDIE, dwarf::DW_AT_specification,
@@ -1672,8 +1675,8 @@
                    Asm->Mang->getMangledName(DI_GV.getGlobal()));
     addBlock(VariableDie, dwarf::DW_AT_location, 0, Block);
   }
-  addToContextOwner(VariableDie, DI_GV.getContext());
-  
+  addToContextOwner(VariableDie, GVContext);
+
   // Expose as global. FIXME - need to check external flag.
   ModuleCU->addGlobal(DI_GV.getName(), VariableDie);
 





More information about the llvm-branch-commits mailing list