[clang] [llvm] [CaptureTracking][FunctionAttrs] Add support for CaptureInfo (PR #125880)

Nikita Popov via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 6 11:16:42 PST 2025


================
@@ -438,18 +448,21 @@ void llvm::PointerMayBeCaptured(const Value *V, CaptureTracker *Tracker,
   };
   while (!Worklist.empty()) {
     const Use *U = Worklist.pop_back_val();
-    switch (DetermineUseCaptureKind(*U, IsDereferenceableOrNull)) {
-    case UseCaptureKind::NO_CAPTURE:
+    CaptureInfo CI = DetermineUseCaptureKind(*U, IsDereferenceableOrNull);
+    if (capturesNothing(CI))
       continue;
-    case UseCaptureKind::MAY_CAPTURE:
-      if (Tracker->captured(U))
+    CaptureComponents RetCC = CI.getRetComponents();
+    if (!capturesNothing(CI.getOtherComponents())) {
----------------
nikic wrote:

This is the MAY_CAPTURE case. The PASSTHROUGH case is the one below (AddUses).

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


More information about the cfe-commits mailing list