summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2014-08-31 05:41:15 +0000
committerDavid Blaikie <dblaikie@gmail.com>2014-08-31 05:41:15 +0000
commit8912df12ffca0103b95e50b630961b737091d82a (patch)
treec84e5ef6978c24d61c0f4d5f6d26b49791bfb9d6 /llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
parente0e8a3baa05e3d2e8d66789964c793b7ec543cc8 (diff)
downloadbcm5719-llvm-8912df12ffca0103b95e50b630961b737091d82a.tar.gz
bcm5719-llvm-8912df12ffca0103b95e50b630961b737091d82a.zip
Modify DwarfDebug::constructImportedEntityDIE to return rather than insert into the scope
Another step towards improving lexical_scope handling llvm-svn: 216839
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp16
1 files changed, 5 insertions, 11 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index 1eb8af938a3..56ad9666e95 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -603,7 +603,8 @@ std::unique_ptr<DIE> DwarfDebug::constructScopeDIE(DwarfCompileUnit &TheCU,
assert(ScopeDIE && "Scope DIE should not be null.");
for (ImportedEntityMap::const_iterator i = Range.first; i != Range.second;
++i)
- constructImportedEntityDIE(TheCU, i->second, *ScopeDIE);
+ ScopeDIE->addChild(
+ constructImportedEntityDIE(TheCU, DIImportedEntity(i->second)));
}
// Add children
@@ -683,21 +684,14 @@ DwarfCompileUnit &DwarfDebug::constructDwarfCompileUnit(DICompileUnit DIUnit) {
return NewCU;
}
-void DwarfDebug::constructImportedEntityDIE(DwarfCompileUnit &TheCU,
- const MDNode *N) {
+void DwarfDebug::constructAndAddImportedEntityDIE(DwarfCompileUnit &TheCU,
+ const MDNode *N) {
DIImportedEntity Module(N);
assert(Module.Verify());
if (DIE *D = TheCU.getOrCreateContextDIE(Module.getContext()))
D->addChild(constructImportedEntityDIE(TheCU, Module));
}
-void DwarfDebug::constructImportedEntityDIE(DwarfCompileUnit &TheCU,
- const MDNode *N, DIE &Context) {
- DIImportedEntity Module(N);
- assert(Module.Verify());
- Context.addChild(constructImportedEntityDIE(TheCU, Module));
-}
-
std::unique_ptr<DIE>
DwarfDebug::constructImportedEntityDIE(DwarfCompileUnit &TheCU,
const DIImportedEntity &Module) {
@@ -785,7 +779,7 @@ void DwarfDebug::beginModule() {
// Emit imported_modules last so that the relevant context is already
// available.
for (unsigned i = 0, e = ImportedEntities.getNumElements(); i != e; ++i)
- constructImportedEntityDIE(CU, ImportedEntities.getElement(i));
+ constructAndAddImportedEntityDIE(CU, ImportedEntities.getElement(i));
}
// Tell MMI that we have debug info.
OpenPOWER on IntegriCloud