Skip to content

Commit dc8b114

Browse files
committed
[DebugInfo] [SILGen] Remove all invalid debug info from intermediates
The debug info on intermediates were not removed if the function used parameter packs Fixes #73030 rdar://126556557
1 parent f3d4969 commit dc8b114

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

lib/SILGen/SILGenProlog.cpp

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1540,18 +1540,19 @@ uint16_t SILGenFunction::emitBasicProlog(
15401540
B.createDebugValue(loc, undef.getValue(), dbgVar);
15411541
}
15421542

1543-
for (auto &i : *B.getInsertionBB()) {
1544-
auto *alloc = dyn_cast<AllocStackInst>(&i);
1545-
if (!alloc)
1546-
continue;
1547-
auto varInfo = alloc->getVarInfo();
1548-
if (!varInfo || varInfo->ArgNo)
1549-
continue;
1550-
// The allocation has a varinfo but no argument number, which should not
1551-
// happen in the prolog. Unfortunately, some copies can generate wrong
1552-
// debug info, so we have to fix it here, by invalidating it.
1553-
alloc->invalidateVarInfo();
1554-
}
1543+
for (auto &bb : B.getFunction())
1544+
for (auto &i : bb) {
1545+
auto *alloc = dyn_cast<AllocStackInst>(&i);
1546+
if (!alloc)
1547+
continue;
1548+
auto varInfo = alloc->getVarInfo();
1549+
if (!varInfo || varInfo->ArgNo)
1550+
continue;
1551+
// The allocation has a varinfo but no argument number, which should not
1552+
// happen in the prolog. Unfortunately, some copies can generate wrong
1553+
// debug info, so we have to fix it here, by invalidating it.
1554+
alloc->invalidateVarInfo();
1555+
}
15551556

15561557
return ArgNo;
15571558
}

0 commit comments

Comments
 (0)