Skip to content

Commit 24bc566

Browse files
authored
[Coroutines] Remove assert about a promise being present (#156007)
This commit removes an assert in the generation of debug info for a coroutine frame. This assert checked if a promise alloca is present, even though it's not used. While this might always be the case when the coroutine was produced by clang++, this doesn't hold in the general case. Note: We generate coroutine intrinsics from downstream passes. In our case, there is no guarantee that a coroutine has any promise, but they can originate from some non-coro C++ code.
1 parent c8d7a73 commit 24bc566

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

llvm/lib/Transforms/Coroutines/CoroFrame.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -700,9 +700,6 @@ static void buildFrameDebugInfo(Function &F, coro::Shape &Shape,
700700

701701
DIBuilder DBuilder(*F.getParent(), /*AllowUnresolved*/ false);
702702

703-
assert(Shape.getPromiseAlloca() &&
704-
"Coroutine with switch ABI should own Promise alloca");
705-
706703
DIFile *DFile = DIS->getFile();
707704
unsigned LineNum = DIS->getLine();
708705

llvm/test/Transforms/Coroutines/coro-split-dbg.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ attributes #9 = { noduplicate }
7777
!llvm.module.flags = !{!3, !4}
7878
!llvm.ident = !{!5}
7979

80-
!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 4.0.0", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)
80+
!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: !1, producer: "clang version 4.0.0", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)
8181
!1 = !DIFile(filename: "coro.c", directory: "/home/gor/build/bin")
8282
!2 = !{}
8383
!3 = !{i32 2, !"Dwarf Version", i32 4}

0 commit comments

Comments
 (0)