From: Frederic Riss Date: Thu, 18 Sep 2014 16:41:04 +0000 (+0000) Subject: Revert part of r218041. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=7458ce3af9a871a827d0eda254e6a3466f51727a;p=oota-llvm.git Revert part of r218041. 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 --- diff --git a/lib/CodeGen/AsmPrinter/DwarfUnit.cpp b/lib/CodeGen/AsmPrinter/DwarfUnit.cpp index 353e70b6e1e..8561b5dd4f4 100644 --- a/lib/CodeGen/AsmPrinter/DwarfUnit.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfUnit.cpp @@ -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); }