[llvm] 83a1fe8 - [CaptureTracking] Convert check to assertion (NFC)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 30 07:37:37 PST 2025


Author: Nikita Popov
Date: 2025-01-30T16:33:50+01:00
New Revision: 83a1fe866640ac60c735a1427c41169067d31e05

URL: https://github.com/llvm/llvm-project/commit/83a1fe866640ac60c735a1427c41169067d31e05
DIFF: https://github.com/llvm/llvm-project/commit/83a1fe866640ac60c735a1427c41169067d31e05.diff

LOG: [CaptureTracking] Convert check to assertion (NFC)

If it's not the callee operand, it must be a data operand.

Added: 
    

Modified: 
    llvm/lib/Analysis/CaptureTracking.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Analysis/CaptureTracking.cpp b/llvm/lib/Analysis/CaptureTracking.cpp
index a353842eb809c4..49baf2eb84bb3e 100644
--- a/llvm/lib/Analysis/CaptureTracking.cpp
+++ b/llvm/lib/Analysis/CaptureTracking.cpp
@@ -318,8 +318,8 @@ UseCaptureKind llvm::DetermineUseCaptureKind(
       return UseCaptureKind::NO_CAPTURE;
 
     // Not captured if only passed via 'nocapture' arguments.
-    if (Call->isDataOperand(&U) &&
-        !Call->doesNotCapture(Call->getDataOperandNo(&U))) {
+    assert(Call->isDataOperand(&U) && "Non-callee must be data operand");
+    if (!Call->doesNotCapture(Call->getDataOperandNo(&U))) {
       // The parameter is not marked 'nocapture' - captured.
       return UseCaptureKind::MAY_CAPTURE;
     }


        


More information about the llvm-commits mailing list