1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 19:52:54 +01:00

Modify DwarfDebug::constructImportedEntityDIE to return rather than insert into the scope

Another step towards improving lexical_scope handling

llvm-svn: 216839
This commit is contained in:
David Blaikie 2014-08-31 05:41:15 +00:00
parent e457eac5e4
commit eb050a7f25
2 changed files with 7 additions and 16 deletions

View File

@ -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,7 +684,7 @@ DwarfCompileUnit &DwarfDebug::constructDwarfCompileUnit(DICompileUnit DIUnit) {
return NewCU;
}
void DwarfDebug::constructImportedEntityDIE(DwarfCompileUnit &TheCU,
void DwarfDebug::constructAndAddImportedEntityDIE(DwarfCompileUnit &TheCU,
const MDNode *N) {
DIImportedEntity Module(N);
assert(Module.Verify());
@ -691,13 +692,6 @@ void DwarfDebug::constructImportedEntityDIE(DwarfCompileUnit &TheCU,
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.

View File

@ -508,11 +508,8 @@ class DwarfDebug : public AsmPrinterHandler {
DwarfCompileUnit &constructDwarfCompileUnit(DICompileUnit DIUnit);
/// \brief Construct imported_module or imported_declaration DIE.
void constructImportedEntityDIE(DwarfCompileUnit &TheCU, const MDNode *N);
/// \brief Construct import_module DIE.
void constructImportedEntityDIE(DwarfCompileUnit &TheCU, const MDNode *N,
DIE &Context);
void constructAndAddImportedEntityDIE(DwarfCompileUnit &TheCU,
const MDNode *N);
/// \brief Construct import_module DIE.
std::unique_ptr<DIE>