mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-09 11:25:55 +00:00
Always emit DW_AT_declaration attribute when the variable isn't a definition.
Summary: This doesn't show up today as we don't emit decalration only variables. This will be tested when the followup patches implementing import of forward declared entities lands in clang. Reviewers: echristo, dblaikie, aprantl Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D5382 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218041 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1670,6 +1670,9 @@ void DwarfCompileUnit::createGlobalVariableDIE(DIGlobalVariable GV) {
|
|||||||
DD->addArangeLabel(SymbolCU(this, Sym));
|
DD->addArangeLabel(SymbolCU(this, Sym));
|
||||||
addOpAddress(*Loc, Sym);
|
addOpAddress(*Loc, Sym);
|
||||||
}
|
}
|
||||||
|
// A static member's declaration is already flagged as such.
|
||||||
|
if (!SDMDecl.Verify() && !GV.isDefinition())
|
||||||
|
addFlag(*VariableDIE, dwarf::DW_AT_declaration);
|
||||||
// Do not create specification DIE if context is either compile unit
|
// Do not create specification DIE if context is either compile unit
|
||||||
// or a subprogram.
|
// or a subprogram.
|
||||||
if (GVContext && GV.isDefinition() && !GVContext.isCompileUnit() &&
|
if (GVContext && GV.isDefinition() && !GVContext.isCompileUnit() &&
|
||||||
@@ -1678,9 +1681,6 @@ void DwarfCompileUnit::createGlobalVariableDIE(DIGlobalVariable GV) {
|
|||||||
VariableSpecDIE = &createAndAddDIE(dwarf::DW_TAG_variable, UnitDie);
|
VariableSpecDIE = &createAndAddDIE(dwarf::DW_TAG_variable, UnitDie);
|
||||||
addDIEEntry(*VariableSpecDIE, dwarf::DW_AT_specification, *VariableDIE);
|
addDIEEntry(*VariableSpecDIE, dwarf::DW_AT_specification, *VariableDIE);
|
||||||
addBlock(*VariableSpecDIE, dwarf::DW_AT_location, Loc);
|
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 {
|
} else {
|
||||||
addBlock(*VariableDIE, dwarf::DW_AT_location, Loc);
|
addBlock(*VariableDIE, dwarf::DW_AT_location, Loc);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user