[llvm] [RemoveDIs] Update Coroutine passes to handle DPValues (PR #74480)

Felipe de Azevedo Piovezan via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 5 10:49:25 PST 2023


================
@@ -2798,21 +2845,16 @@ static void collectFrameAlloca(AllocaInst *AI, coro::Shape &Shape,
                        Visitor.getMayWriteBeforeCoroBegin());
 }
 
-void coro::salvageDebugInfo(
-    SmallDenseMap<Argument *, AllocaInst *, 4> &ArgToAllocaMap,
-    DbgVariableIntrinsic *DVI, bool OptimizeFrame, bool UseEntryValue) {
-  Function *F = DVI->getFunction();
+static std::optional<std::pair<Value *, DIExpression *>>
----------------
felipepiovezan wrote:

why do we need an optional here? Pointers are already expressing the possibility of failure. We can probably do one of two things:

1. Use an `optional<pair<Value&, DIExpression &>>`
2. Just return a pair of pointers

The first option is nice because it makes it evident that they can only fail together, but I suspect 2 might be easier to read

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


More information about the llvm-commits mailing list