summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorEric Christopher <echristo@apple.com>2011-11-11 01:55:22 +0000
committerEric Christopher <echristo@apple.com>2011-11-11 01:55:22 +0000
commitc12c211c4418d5c92a071898bf4e41d670812801 (patch)
treea16ee276f160db2e7d1d5466c91ab8ff1de55576 /llvm/lib/CodeGen
parentb2469060de492d78579930c994fa906d02db89b5 (diff)
downloadbcm5719-llvm-c12c211c4418d5c92a071898bf4e41d670812801.tar.gz
bcm5719-llvm-c12c211c4418d5c92a071898bf4e41d670812801.zip
If we have a DIE with an AT_specification use that instead of the normal
addr DIE when adding to the dwarf accelerator tables. llvm-svn: 144354
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp17
1 files changed, 10 insertions, 7 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
index 657763a8fce..1e5170949e6 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
@@ -1095,6 +1095,7 @@ void CompileUnit::createGlobalVariableDIE(const MDNode *N) {
addToContextOwner(VariableDIE, GVContext);
// Add location.
bool addToAccelTable = false;
+ DIE *VariableSpecDIE;
if (isGlobalVariable) {
addToAccelTable = true;
DIEBlock *Block = new (DIEValueAllocator) DIEBlock();
@@ -1106,7 +1107,7 @@ void CompileUnit::createGlobalVariableDIE(const MDNode *N) {
if (GVContext && GV.isDefinition() && !GVContext.isCompileUnit() &&
!GVContext.isFile() && !isSubprogramContext(GVContext)) {
// Create specification DIE.
- DIE *VariableSpecDIE = new DIE(dwarf::DW_TAG_variable);
+ VariableSpecDIE = new DIE(dwarf::DW_TAG_variable);
addDIEEntry(VariableSpecDIE, dwarf::DW_AT_specification,
dwarf::DW_FORM_ref4, VariableDIE);
addBlock(VariableSpecDIE, dwarf::DW_AT_location, 0, Block);
@@ -1135,13 +1136,15 @@ void CompileUnit::createGlobalVariableDIE(const MDNode *N) {
addBlock(VariableDIE, dwarf::DW_AT_location, 0, Block);
}
- if (addToAccelTable)
- addAccelName(GV.getName(), VariableDIE);
+ if (addToAccelTable) {
+ DIE *AddrDIE = VariableSpecDIE ? VariableSpecDIE : VariableDIE;
+ addAccelName(GV.getName(), AddrDIE);
- // If the linkage name is different than the name, go ahead and output
- // that as well into the name table.
- if (GV.getLinkageName() != "" && GV.getName() != GV.getLinkageName())
- addAccelName(GV.getLinkageName(), VariableDIE);
+ // If the linkage name is different than the name, go ahead and output
+ // that as well into the name table.
+ if (GV.getLinkageName() != "" && GV.getName() != GV.getLinkageName())
+ addAccelName(GV.getLinkageName(), AddrDIE);
+ }
return;
}
OpenPOWER on IntegriCloud