mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-23 01:24:30 +00:00
Modify DwarfDebug::constructImportedEntityDIE to return rather than insert into the scope
Another step towards improving lexical_scope handling git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216839 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -603,7 +603,8 @@ std::unique_ptr<DIE> DwarfDebug::constructScopeDIE(DwarfCompileUnit &TheCU,
|
|||||||
assert(ScopeDIE && "Scope DIE should not be null.");
|
assert(ScopeDIE && "Scope DIE should not be null.");
|
||||||
for (ImportedEntityMap::const_iterator i = Range.first; i != Range.second;
|
for (ImportedEntityMap::const_iterator i = Range.first; i != Range.second;
|
||||||
++i)
|
++i)
|
||||||
constructImportedEntityDIE(TheCU, i->second, *ScopeDIE);
|
ScopeDIE->addChild(
|
||||||
|
constructImportedEntityDIE(TheCU, DIImportedEntity(i->second)));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add children
|
// Add children
|
||||||
@ -683,21 +684,14 @@ DwarfCompileUnit &DwarfDebug::constructDwarfCompileUnit(DICompileUnit DIUnit) {
|
|||||||
return NewCU;
|
return NewCU;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DwarfDebug::constructImportedEntityDIE(DwarfCompileUnit &TheCU,
|
void DwarfDebug::constructAndAddImportedEntityDIE(DwarfCompileUnit &TheCU,
|
||||||
const MDNode *N) {
|
const MDNode *N) {
|
||||||
DIImportedEntity Module(N);
|
DIImportedEntity Module(N);
|
||||||
assert(Module.Verify());
|
assert(Module.Verify());
|
||||||
if (DIE *D = TheCU.getOrCreateContextDIE(Module.getContext()))
|
if (DIE *D = TheCU.getOrCreateContextDIE(Module.getContext()))
|
||||||
D->addChild(constructImportedEntityDIE(TheCU, Module));
|
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>
|
std::unique_ptr<DIE>
|
||||||
DwarfDebug::constructImportedEntityDIE(DwarfCompileUnit &TheCU,
|
DwarfDebug::constructImportedEntityDIE(DwarfCompileUnit &TheCU,
|
||||||
const DIImportedEntity &Module) {
|
const DIImportedEntity &Module) {
|
||||||
@ -785,7 +779,7 @@ void DwarfDebug::beginModule() {
|
|||||||
// Emit imported_modules last so that the relevant context is already
|
// Emit imported_modules last so that the relevant context is already
|
||||||
// available.
|
// available.
|
||||||
for (unsigned i = 0, e = ImportedEntities.getNumElements(); i != e; ++i)
|
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.
|
// Tell MMI that we have debug info.
|
||||||
|
@ -508,11 +508,8 @@ class DwarfDebug : public AsmPrinterHandler {
|
|||||||
DwarfCompileUnit &constructDwarfCompileUnit(DICompileUnit DIUnit);
|
DwarfCompileUnit &constructDwarfCompileUnit(DICompileUnit DIUnit);
|
||||||
|
|
||||||
/// \brief Construct imported_module or imported_declaration DIE.
|
/// \brief Construct imported_module or imported_declaration DIE.
|
||||||
void constructImportedEntityDIE(DwarfCompileUnit &TheCU, const MDNode *N);
|
void constructAndAddImportedEntityDIE(DwarfCompileUnit &TheCU,
|
||||||
|
const MDNode *N);
|
||||||
/// \brief Construct import_module DIE.
|
|
||||||
void constructImportedEntityDIE(DwarfCompileUnit &TheCU, const MDNode *N,
|
|
||||||
DIE &Context);
|
|
||||||
|
|
||||||
/// \brief Construct import_module DIE.
|
/// \brief Construct import_module DIE.
|
||||||
std::unique_ptr<DIE>
|
std::unique_ptr<DIE>
|
||||||
|
Reference in New Issue
Block a user