[llvm] [Coroutines] fix coroutines + std::unique_ptr with async exceptions validation errors (PR #149691)

via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 2 02:13:19 PDT 2025


================
@@ -973,6 +975,178 @@ static StructType *buildFrameType(Function &F, coro::Shape &Shape,
   return FrameTy;
 }
 
+// This function assumes that it is being called on basic block in reversed
+// post-order, meaning predecessors are visited before successors failing to do
+// so will cause VMap to be non-valid and will cause instructions to fail
+// mapping to their corresponding clones
+static void finalizeBasicBlockCloneAndTrackSuccessors(
+    BasicBlock *InitialBlock, BasicBlock *ClonedBlock, ValueToValueMapTy &VMap,
+    SmallSet<BasicBlock *, 20> &SuccessorBlocksSet) {
----------------
tzuralon wrote:

Eventually I changed to SmallPtrSet (which was implicitly used anyway in practice when I used SmallSet, as the Set is of ptrs), and not SmallPtrSetImpl, because SmallPtrSetImpl does not spare the storage management as thought initially.

https://github.com/llvm/llvm-project/pull/149691


More information about the llvm-commits mailing list