summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
diff options
context:
space:
mode:
authorAmjad Aboud <amjad.aboud@intel.com>2016-04-30 01:44:07 +0000
committerAmjad Aboud <amjad.aboud@intel.com>2016-04-30 01:44:07 +0000
commit72da9391f0322c3868ade631066186b5233f75c3 (patch)
treed5eb72ff934f67831f63217252118ddd01eea5d8 /llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
parenta85efd985c74716429b69cebbac1a5f438fd45d1 (diff)
downloadbcm5719-llvm-72da9391f0322c3868ade631066186b5233f75c3.tar.gz
bcm5719-llvm-72da9391f0322c3868ade631066186b5233f75c3.zip
Reverting 268054 & 268063 as they caused PR27579.
llvm-svn: 268150
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp35
1 files changed, 6 insertions, 29 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index 544c86531e9..dcd49acb250 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -457,16 +457,6 @@ void DwarfDebug::constructAndAddImportedEntityDIE(DwarfCompileUnit &TheCU,
D->addChild(TheCU.constructImportedEntityDIE(N));
}
-bool DwarfDebug::collectLocalScopedNode(DIScope *S, const DINode *N,
- DwarfCompileUnit &CU) {
- if (auto LS = dyn_cast_or_null<DILocalScope>(S)) {
- getLocalScopes(LS->getSubprogram()).insert(LS);
- CU.addLocalDeclNode(N, LS);
- return true;
- }
- return false;
-}
-
// Emit all Dwarf sections that should come prior to the content. Create
// global DIEs and emit initial debug info sections. This is invoked by
// the target AsmPrinter.
@@ -488,9 +478,10 @@ void DwarfDebug::beginModule() {
for (DICompileUnit *CUNode : M->debug_compile_units()) {
DwarfCompileUnit &CU = constructDwarfCompileUnit(CUNode);
+ for (auto *IE : CUNode->getImportedEntities())
+ CU.addImportedEntity(IE);
for (auto *GV : CUNode->getGlobalVariables())
- if (!collectLocalScopedNode(GV->getScope(), GV, CU))
- CU.getOrCreateGlobalVariableDIE(GV);
+ CU.getOrCreateGlobalVariableDIE(GV);
for (auto *Ty : CUNode->getEnumTypes()) {
// The enum types array by design contains pointers to
// MDNodes rather than DIRefs. Unique them here.
@@ -499,19 +490,15 @@ void DwarfDebug::beginModule() {
for (auto *Ty : CUNode->getRetainedTypes()) {
// The retained types array by design contains pointers to
// MDNodes rather than DIRefs. Unique them here.
- if (DIType *RT = dyn_cast<DIType>(Ty)) {
- if (RT->isExternalTypeRef())
+ if (DIType *RT = dyn_cast<DIType>(Ty))
+ if (!RT->isExternalTypeRef())
// There is no point in force-emitting a forward declaration.
- continue;
- if (!collectLocalScopedNode(resolve(Ty->getScope()), RT, CU))
CU.getOrCreateTypeDIE(RT);
- }
}
// Emit imported_modules last so that the relevant context is already
// available.
for (auto *IE : CUNode->getImportedEntities())
- if (!collectLocalScopedNode(IE->getScope(), IE, CU))
- constructAndAddImportedEntityDIE(CU, IE);
+ constructAndAddImportedEntityDIE(CU, IE);
}
}
@@ -551,18 +538,11 @@ void DwarfDebug::finishSubprogramDefinitions() {
});
}
-void DwarfDebug::finishLocalScopeDefinitions() {
- for (const auto &I : CUMap)
- I.second->finishLocalScopeDefinitions();
-}
-
void DwarfDebug::finalizeModuleInfo() {
const TargetLoweringObjectFile &TLOF = Asm->getObjFileLowering();
finishSubprogramDefinitions();
- finishLocalScopeDefinitions();
-
finishVariableDefinitions();
// Handle anything that needs to be done on a per-unit basis after
@@ -1178,9 +1158,6 @@ void DwarfDebug::endFunction(const MachineFunction *MF) {
assert(LScopes.getAbstractScopesList().size() == NumAbstractScopes
&& "ensureAbstractVariableIsCreated inserted abstract scopes");
}
- // Assure abstract local scope created for each one contains local DIEs.
- for (const DILocalScope *LS : getLocalScopes(SP))
- LScopes.getOrCreateAbstractScope(LS);
constructAbstractSubprogramScopeDIE(AScope);
}
OpenPOWER on IntegriCloud