mirror of
https://github.com/RPCSX/llvm.git
synced 2025-01-12 15:30:46 +00:00
DebugInfo: Improve type safety and simplify some subprogram finalization code
This probably ended up this way aften the subprogram<>function link inversion and debug info metadata schema changes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289697 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
fb953956ab
commit
6cd8528a2d
@ -364,13 +364,13 @@ void DwarfDebug::constructAbstractSubprogramScopeDIE(LexicalScope *Scope) {
|
||||
assert(Scope->isAbstractScope());
|
||||
assert(!Scope->getInlinedAt());
|
||||
|
||||
const MDNode *SP = Scope->getScopeNode();
|
||||
auto *SP = cast<DISubprogram>(Scope->getScopeNode());
|
||||
|
||||
ProcessedSPNodes.insert(SP);
|
||||
|
||||
// Find the subprogram's DwarfCompileUnit in the SPMap in case the subprogram
|
||||
// was inlined from another compile unit.
|
||||
auto &CU = *CUMap.lookup(cast<DISubprogram>(SP)->getUnit());
|
||||
auto &CU = *CUMap.lookup(SP->getUnit());
|
||||
forBothCUs(CU, [&](DwarfCompileUnit &CU) {
|
||||
CU.constructAbstractSubprogramScopeDIE(Scope);
|
||||
});
|
||||
@ -535,13 +535,11 @@ void DwarfDebug::finishVariableDefinitions() {
|
||||
}
|
||||
|
||||
void DwarfDebug::finishSubprogramDefinitions() {
|
||||
for (auto &F : MMI->getModule()->functions())
|
||||
if (auto *SP = F.getSubprogram())
|
||||
if (ProcessedSPNodes.count(SP) &&
|
||||
SP->getUnit()->getEmissionKind() != DICompileUnit::NoDebug)
|
||||
forBothCUs(*CUMap.lookup(SP->getUnit()), [&](DwarfCompileUnit &CU) {
|
||||
CU.finishSubprogramDefinition(SP);
|
||||
});
|
||||
for (const DISubprogram *SP : ProcessedSPNodes)
|
||||
if (SP->getUnit()->getEmissionKind() != DICompileUnit::NoDebug)
|
||||
forBothCUs(*CUMap.lookup(SP->getUnit()), [&](DwarfCompileUnit &CU) {
|
||||
CU.finishSubprogramDefinition(SP);
|
||||
});
|
||||
}
|
||||
|
||||
void DwarfDebug::finalizeModuleInfo() {
|
||||
|
@ -216,7 +216,7 @@ class DwarfDebug : public DebugHandlerBase {
|
||||
|
||||
/// This is a collection of subprogram MDNodes that are processed to
|
||||
/// create DIEs.
|
||||
SmallPtrSet<const MDNode *, 16> ProcessedSPNodes;
|
||||
SmallPtrSet<const DISubprogram *, 16> ProcessedSPNodes;
|
||||
|
||||
/// If nonnull, stores the current machine function we're processing.
|
||||
const MachineFunction *CurFn;
|
||||
@ -553,7 +553,7 @@ public:
|
||||
|
||||
// FIXME: Sink these functions down into DwarfFile/Dwarf*Unit.
|
||||
|
||||
SmallPtrSet<const MDNode *, 16> &getProcessedSPNodes() {
|
||||
SmallPtrSet<const DISubprogram *, 16> &getProcessedSPNodes() {
|
||||
return ProcessedSPNodes;
|
||||
}
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user