mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-22 10:33:23 +00:00
DebugInfo: Do not delay attaching DW_AT_inline attribute to abstract definitions.
This is just unneccessary - we only create abstract definitions when we're inlining anyway, so there's no reason to delay this to see if we're going to inline anything. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208798 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
8101512a2d
commit
e0776de2df
@ -463,11 +463,13 @@ DwarfDebug::constructInlinedScopeDIE(DwarfCompileUnit &TheCU,
|
|||||||
assert(!ScopeRanges.empty() &&
|
assert(!ScopeRanges.empty() &&
|
||||||
"LexicalScope does not have instruction markers!");
|
"LexicalScope does not have instruction markers!");
|
||||||
|
|
||||||
if (!Scope->getScopeNode())
|
assert(Scope->getScopeNode());
|
||||||
return nullptr;
|
|
||||||
DIScope DS(Scope->getScopeNode());
|
DIScope DS(Scope->getScopeNode());
|
||||||
DISubprogram InlinedSP = getDISubprogram(DS);
|
DISubprogram InlinedSP = getDISubprogram(DS);
|
||||||
DIE *OriginDIE = TheCU.getDIE(InlinedSP);
|
DIE *OriginDIE = TheCU.getDIE(InlinedSP);
|
||||||
|
// FIXME: This should be an assert (or possibly a
|
||||||
|
// getOrCreateSubprogram(InlinedSP)) otherwise we're just failing to emit
|
||||||
|
// inlining information.
|
||||||
if (!OriginDIE) {
|
if (!OriginDIE) {
|
||||||
DEBUG(dbgs() << "Unable to find original DIE for an inlined subprogram.");
|
DEBUG(dbgs() << "Unable to find original DIE for an inlined subprogram.");
|
||||||
return nullptr;
|
return nullptr;
|
||||||
@ -582,6 +584,7 @@ void DwarfDebug::constructAbstractSubprogramScopeDIE(DwarfCompileUnit &TheCU,
|
|||||||
|
|
||||||
if (DIE *ScopeDIE = TheCU.getDIE(Sub)) {
|
if (DIE *ScopeDIE = TheCU.getDIE(Sub)) {
|
||||||
AbstractSPDies.insert(std::make_pair(Sub, ScopeDIE));
|
AbstractSPDies.insert(std::make_pair(Sub, ScopeDIE));
|
||||||
|
TheCU.addUInt(*ScopeDIE, dwarf::DW_AT_inline, None, dwarf::DW_INL_inlined);
|
||||||
createAndAddScopeChildren(TheCU, Scope, *ScopeDIE);
|
createAndAddScopeChildren(TheCU, Scope, *ScopeDIE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -856,16 +859,6 @@ void DwarfDebug::beginModule() {
|
|||||||
SectionMap[Asm->getObjFileLowering().getTextSection()];
|
SectionMap[Asm->getObjFileLowering().getTextSection()];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Attach DW_AT_inline attribute with inlined subprogram DIEs.
|
|
||||||
void DwarfDebug::computeInlinedDIEs() {
|
|
||||||
for (const auto &AI : AbstractSPDies) {
|
|
||||||
DIE &ISP = *AI.second;
|
|
||||||
if (InlinedSubprogramDIEs.count(&ISP))
|
|
||||||
continue;
|
|
||||||
FirstCU->addUInt(ISP, dwarf::DW_AT_inline, None, dwarf::DW_INL_inlined);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Collect info for variables that were optimized out.
|
// Collect info for variables that were optimized out.
|
||||||
void DwarfDebug::collectDeadVariables() {
|
void DwarfDebug::collectDeadVariables() {
|
||||||
const Module *M = MMI->getModule();
|
const Module *M = MMI->getModule();
|
||||||
@ -910,9 +903,6 @@ void DwarfDebug::finalizeModuleInfo() {
|
|||||||
// Collect info for variables that were optimized out.
|
// Collect info for variables that were optimized out.
|
||||||
collectDeadVariables();
|
collectDeadVariables();
|
||||||
|
|
||||||
// Attach DW_AT_inline attribute with inlined subprogram DIEs.
|
|
||||||
computeInlinedDIEs();
|
|
||||||
|
|
||||||
// Handle anything that needs to be done on a per-unit basis after
|
// Handle anything that needs to be done on a per-unit basis after
|
||||||
// all other generation.
|
// all other generation.
|
||||||
for (const auto &TheU : getUnits()) {
|
for (const auto &TheU : getUnits()) {
|
||||||
|
@ -385,9 +385,6 @@ class DwarfDebug : public AsmPrinterHandler {
|
|||||||
/// \brief Compute the size and offset of all the DIEs.
|
/// \brief Compute the size and offset of all the DIEs.
|
||||||
void computeSizeAndOffsets();
|
void computeSizeAndOffsets();
|
||||||
|
|
||||||
/// \brief Attach DW_AT_inline attribute with inlined subprogram DIEs.
|
|
||||||
void computeInlinedDIEs();
|
|
||||||
|
|
||||||
/// \brief Collect info for variables that were optimized out.
|
/// \brief Collect info for variables that were optimized out.
|
||||||
void collectDeadVariables();
|
void collectDeadVariables();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user