[llvm] [CaptureTracking] Compute results with and without return capture (PR #195857)

Antonio Frighetto via llvm-commits llvm-commits at lists.llvm.org
Thu May 7 07:23:17 PDT 2026


================
@@ -226,21 +222,24 @@ static bool isNotInCycle(const Instruction *I, const DominatorTree *DT,
          !isPotentiallyReachableFromMany(Succs, BB, nullptr, DT, LI);
 }
 
-CaptureComponents
-EarliestEscapeAnalysis::getCapturesBefore(const Value *Object,
-                                          const Instruction *I, bool OrAt) {
+CaptureComponents EarliestEscapeAnalysis::getCapturesBefore(
+    const Value *Object, const Instruction *I, bool OrAt, bool ReturnCaptures) {
   if (!isIdentifiedFunctionLocal(Object))
     return CaptureComponents::Provenance;
 
   auto Iter = EarliestEscapes.try_emplace(Object);
   if (Iter.second) {
-    std::pair<Instruction *, CaptureComponents> EarliestCapture =
-        FindEarliestCapture(Object, *DT.getRoot()->getParent(),
-                            /*ReturnCaptures=*/false, DT,
+    std::pair<Instruction *, CaptureResult> EarliestCapture =
+        FindEarliestCapture(Object, *DT.getRoot()->getParent(), DT,
----------------
antoniofrighetto wrote:

```suggestion
    auto [EarliestInst, CR] =
        FindEarliestCapture(Object, *DT.getRoot()->getParent(), DT,
```

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


More information about the llvm-commits mailing list