Skip to content
This repository was archived by the owner on Apr 23, 2020. It is now read-only.

Commit d56c9db

Browse files
committed
Debug Info: code clean up.
Remove unnecessary creation of LexicalScope in collectDeadVariables. The created LexicialScope was only used to get isAbstractScope, which should be false from the creation: "new LexicalScope(NULL, DIDescriptor(SP), NULL, false);". We can also remove a DenseMap that holds the created LexicalScopes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193196 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent dd620a9 commit d56c9db

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

lib/CodeGen/AsmPrinter/DwarfDebug.cpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -969,7 +969,6 @@ void DwarfDebug::computeInlinedDIEs() {
969969
// Collect info for variables that were optimized out.
970970
void DwarfDebug::collectDeadVariables() {
971971
const Module *M = MMI->getModule();
972-
DenseMap<const MDNode *, LexicalScope *> DeadFnScopeMap;
973972

974973
if (NamedMDNode *CU_Nodes = M->getNamedMetadata("llvm.dbg.cu")) {
975974
for (unsigned i = 0, e = CU_Nodes->getNumOperands(); i != e; ++i) {
@@ -987,10 +986,6 @@ void DwarfDebug::collectDeadVariables() {
987986
if (Variables.getNumElements() == 0)
988987
continue;
989988

990-
LexicalScope *Scope =
991-
new LexicalScope(NULL, DIDescriptor(SP), NULL, false);
992-
DeadFnScopeMap[SP] = Scope;
993-
994989
// Construct subprogram DIE and add variables DIEs.
995990
CompileUnit *SPCU = CUMap.lookup(TheCU);
996991
assert(SPCU && "Unable to find Compile Unit!");
@@ -1004,13 +999,12 @@ void DwarfDebug::collectDeadVariables() {
1004999
continue;
10051000
DbgVariable NewVar(DV, NULL, this);
10061001
if (DIE *VariableDIE =
1007-
SPCU->constructVariableDIE(&NewVar, Scope->isAbstractScope()))
1002+
SPCU->constructVariableDIE(&NewVar, false))
10081003
SPDIE->addChild(VariableDIE);
10091004
}
10101005
}
10111006
}
10121007
}
1013-
DeleteContainerSeconds(DeadFnScopeMap);
10141008
}
10151009

10161010
// Type Signature [7.27] and ODR Hash code.

0 commit comments

Comments
 (0)