diff options
author | Devang Patel <dpatel@apple.com> | 2010-08-02 17:32:15 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2010-08-02 17:32:15 +0000 |
commit | e9a1ccaf8036fbd46a350ddd3367e25b1fbc8d54 (patch) | |
tree | 14456b99f51507089916f187f3b72ea030fd665f | |
parent | e1c9159f63c60b4d64e80b7912eedf43b93b12e0 (diff) | |
download | external_llvm-e9a1ccaf8036fbd46a350ddd3367e25b1fbc8d54.zip external_llvm-e9a1ccaf8036fbd46a350ddd3367e25b1fbc8d54.tar.gz external_llvm-e9a1ccaf8036fbd46a350ddd3367e25b1fbc8d54.tar.bz2 |
Free DbgScope created for dead functions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110045 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index 64a9b25..47a9cb6 100644 --- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -2032,6 +2032,7 @@ void DwarfDebug::beginModule(Module *M) { void DwarfDebug::endModule() { if (!FirstCU) return; const Module *M = MMI->getModule(); + DenseMap<const MDNode *, DbgScope *> DeadFnScopeMap; if (NamedMDNode *AllSPs = M->getNamedMetadata("llvm.dbg.sp")) { for (unsigned SI = 0, SE = AllSPs->getNumOperands(); SI != SE; ++SI) { if (ProcessedSPNodes.count(AllSPs->getOperand(SI)) != 0) continue; @@ -2049,6 +2050,7 @@ void DwarfDebug::endModule() { unsigned E = NMD->getNumOperands(); if (!E) continue; DbgScope *Scope = new DbgScope(NULL, DIDescriptor(SP), NULL); + DeadFnScopeMap[SP] = Scope; for (unsigned I = 0; I != E; ++I) { DIVariable DV(NMD->getOperand(I)); if (!DV.Verify()) continue; @@ -2140,6 +2142,8 @@ void DwarfDebug::endModule() { // Emit info into a debug str section. emitDebugStr(); + // clean up. + DeleteContainerSeconds(DeadFnScopeMap); for (DenseMap<const MDNode *, CompileUnit *>::iterator I = CUMap.begin(), E = CUMap.end(); I != E; ++I) delete I->second; |