Revert part of r218041.
authorFrederic Riss <friss@apple.com>
Thu, 18 Sep 2014 16:41:04 +0000 (16:41 +0000)
committerFrederic Riss <friss@apple.com>
Thu, 18 Sep 2014 16:41:04 +0000 (16:41 +0000)
The patch moved some logic around in an attempt to generate potentially more
DW_AT_declaration attributes. The patch was flawed though and it stopped
generating the attribute in some cases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218060 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/AsmPrinter/DwarfUnit.cpp

index 353e70b6e1ebb40de44cfeb0fb859feea88689e8..8561b5dd4f4c2d4fe82eaec1b40a4724947057fa 100644 (file)
@@ -1681,6 +1681,9 @@ void DwarfCompileUnit::createGlobalVariableDIE(DIGlobalVariable GV) {
       VariableSpecDIE = &createAndAddDIE(dwarf::DW_TAG_variable, UnitDie);
       addDIEEntry(*VariableSpecDIE, dwarf::DW_AT_specification, *VariableDIE);
       addBlock(*VariableSpecDIE, dwarf::DW_AT_location, Loc);
+      // A static member's declaration is already flagged as such.
+      if (!SDMDecl.Verify())
+        addFlag(*VariableDIE, dwarf::DW_AT_declaration);
     } else {
       addBlock(*VariableDIE, dwarf::DW_AT_location, Loc);
     }