[llvm] 24bc566 - [Coroutines] Remove assert about a promise being present (#156007)
    via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Mon Sep  1 01:25:45 PDT 2025
    
    
  
Author: Christian Ulmann
Date: 2025-09-01T10:25:42+02:00
New Revision: 24bc5665bcb3ebfaf3b0ff0d1e1d7dd654a9d98d
URL: https://github.com/llvm/llvm-project/commit/24bc5665bcb3ebfaf3b0ff0d1e1d7dd654a9d98d
DIFF: https://github.com/llvm/llvm-project/commit/24bc5665bcb3ebfaf3b0ff0d1e1d7dd654a9d98d.diff
LOG: [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.
Added: 
    
Modified: 
    llvm/lib/Transforms/Coroutines/CoroFrame.cpp
    llvm/test/Transforms/Coroutines/coro-split-dbg.ll
Removed: 
    
################################################################################
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}
        
    
    
More information about the llvm-commits
mailing list