Skip to content

Commit bc96976

Browse files
committed
[coro] Fix crash due to DILabel in LineTableOnly mode
Since the recent commit de3c841, the `CoroSplit` pass adds `DILabel`s to help find the location of a suspension point from its suspension point id. Those labels are added in both `DebugEmissionKind::FullDebug` and `DebugEmissionKind::LineTableOnly` mode. The idea was that this information is necessary to reconstruct async stack traces and should hence also be available for LineTableOnly. Unfortunately, it turns out that the DWARF backend does not expect to find any DILabel debug metadata if the emission kind is set to LineTableOnly. The Dwarf backend simply runs into an assertion in that case. This commit fixes the issue by only adding `DILabel` for FullDebug.
1 parent e8a50a2 commit bc96976

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

llvm/lib/Transforms/Coroutines/CoroSplit.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1484,12 +1484,9 @@ struct SwitchCoroutineSplitter {
14841484
// If there is no DISubprogram for F, it implies the function is compiled
14851485
// without debug info. So we also don't generate debug info for the
14861486
// suspension points.
1487-
bool AddDebugLabels =
1488-
(DIS && DIS->getUnit() &&
1489-
(DIS->getUnit()->getEmissionKind() ==
1490-
DICompileUnit::DebugEmissionKind::FullDebug ||
1491-
DIS->getUnit()->getEmissionKind() ==
1492-
DICompileUnit::DebugEmissionKind::LineTablesOnly));
1487+
bool AddDebugLabels = DIS && DIS->getUnit() &&
1488+
(DIS->getUnit()->getEmissionKind() ==
1489+
DICompileUnit::DebugEmissionKind::FullDebug);
14931490

14941491
// resume.entry:
14951492
// %index.addr = getelementptr inbounds %f.Frame, %f.Frame* %FramePtr, i32

0 commit comments

Comments
 (0)