[llvm] [Coroutines] Remove assert about a promise being present (PR #156007)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 29 04:06:43 PDT 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-llvm-transforms
Author: Christian Ulmann (Dinistro)
<details>
<summary>Changes</summary>
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.
---
Full diff: https://github.com/llvm/llvm-project/pull/156007.diff
2 Files Affected:
- (modified) llvm/lib/Transforms/Coroutines/CoroFrame.cpp (-3)
- (modified) llvm/test/Transforms/Coroutines/coro-split-dbg.ll (+1-1)
``````````diff
diff --git a/llvm/lib/Transforms/Coroutines/CoroFrame.cpp b/llvm/lib/Transforms/Coroutines/CoroFrame.cpp
index b775c43460190..08f03aa45255d 100644
--- a/llvm/lib/Transforms/Coroutines/CoroFrame.cpp
+++ b/llvm/lib/Transforms/Coroutines/CoroFrame.cpp
@@ -700,9 +700,6 @@ static void buildFrameDebugInfo(Function &F, coro::Shape &Shape,
DIBuilder DBuilder(*F.getParent(), /*AllowUnresolved*/ false);
- assert(Shape.getPromiseAlloca() &&
- "Coroutine with switch ABI should own Promise alloca");
-
DIFile *DFile = DIS->getFile();
unsigned LineNum = DIS->getLine();
diff --git a/llvm/test/Transforms/Coroutines/coro-split-dbg.ll b/llvm/test/Transforms/Coroutines/coro-split-dbg.ll
index 9a9e3c3f2bf0e..02bd2b2d0d65f 100644
--- a/llvm/test/Transforms/Coroutines/coro-split-dbg.ll
+++ b/llvm/test/Transforms/Coroutines/coro-split-dbg.ll
@@ -77,7 +77,7 @@ attributes #9 = { noduplicate }
!llvm.module.flags = !{!3, !4}
!llvm.ident = !{!5}
-!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 4.0.0", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)
+!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)
!1 = !DIFile(filename: "coro.c", directory: "/home/gor/build/bin")
!2 = !{}
!3 = !{i32 2, !"Dwarf Version", i32 4}
``````````
</details>
https://github.com/llvm/llvm-project/pull/156007
More information about the llvm-commits
mailing list