mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-11-01 15:17:25 +00:00
Fix PR13202 and a regtest.
DwarfDebug class could generate the same (inlined) DIVariable twice: 1) when trying to find abstract debug variable for a concrete inlined instance. 2) when explicitly collecting info for variables that were optimized out. This change makes sure that this duplication won't happen and makes Clang pass "gdb.opt/inline-locals" test from gdb testsuite. Reviewed by Eric Christopher. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159811 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1422,6 +1422,12 @@ void DwarfDebug::endFunction(const MachineFunction *MF) {
|
||||
DIVariable DV(Variables.getElement(i));
|
||||
if (!DV || !DV.Verify() || !ProcessedVars.insert(DV))
|
||||
continue;
|
||||
// Check that DbgVariable for DV wasn't created earlier, when
|
||||
// findAbstractVariable() was called for inlined instance of DV.
|
||||
LLVMContext &Ctx = DV->getContext();
|
||||
DIVariable CleanDV = cleanseInlinedVariable(DV, Ctx);
|
||||
if (AbstractVariables.lookup(CleanDV))
|
||||
continue;
|
||||
if (LexicalScope *Scope = LScopes.findAbstractScope(DV.getContext()))
|
||||
addScopeVariable(Scope, new DbgVariable(DV, NULL));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user