diff options
author | Reid Kleckner <rnk@google.com> | 2016-03-24 20:38:49 +0000 |
---|---|---|
committer | Reid Kleckner <rnk@google.com> | 2016-03-24 20:38:49 +0000 |
commit | 01bc66a8ce04297cd3688dacb7e6110b1a60cd50 (patch) | |
tree | 46c744e8f14aeca449ba90eed224f944807855ec /llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | |
parent | 00381aa142c77bcce96f8c587045c8086b2fa27e (diff) | |
download | bcm5719-llvm-01bc66a8ce04297cd3688dacb7e6110b1a60cd50.tar.gz bcm5719-llvm-01bc66a8ce04297cd3688dacb7e6110b1a60cd50.zip |
Revert "Recommitted r263424 "Supporting all entities declared in lexical scope in LLVM debug info." After fixing PR26942 (the fix is included in this commit)."
This reverts commit r264280.
This broke building Chromium for iOS. We'll upload a reproducer to the
PR soon.
llvm-svn: 264334
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 32 |
1 files changed, 5 insertions, 27 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index 9829d0f4537..dc2158387c4 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -458,16 +458,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. @@ -487,9 +477,10 @@ void DwarfDebug::beginModule() { for (MDNode *N : CU_Nodes->operands()) { auto *CUNode = cast<DICompileUnit>(N); 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 *SP : CUNode->getSubprograms()) SPMap.insert(std::make_pair(SP, &CU)); for (auto *Ty : CUNode->getEnumTypes()) { @@ -501,17 +492,14 @@ void DwarfDebug::beginModule() { // The retained types array by design contains pointers to // MDNodes rather than DIRefs. Unique them here. DIType *RT = cast<DIType>(resolve(Ty->getRef())); - if (RT->isExternalTypeRef()) + 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); } // Tell MMI that we have debug info. @@ -544,11 +532,6 @@ void DwarfDebug::finishSubprogramDefinitions() { }); } -void DwarfDebug::finishLocalScopeDefinitions() { - for (const auto &I : CUMap) - I.second->finishLocalScopeDefinitions(); -} - // Collect info for variables that were optimized out. void DwarfDebug::collectDeadVariables() { const Module *M = MMI->getModule(); @@ -574,8 +557,6 @@ void DwarfDebug::finalizeModuleInfo() { finishSubprogramDefinitions(); - finishLocalScopeDefinitions(); - finishVariableDefinitions(); // Collect info for variables that were optimized out. @@ -1186,9 +1167,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); } |