[llvm-commits] [llvm] r89389 - /llvm/trunk/lib/Analysis/CaptureTracking.cpp
Dan Gohman
gohman at apple.com
Thu Nov 19 13:34:08 PST 2009
Author: djg
Date: Thu Nov 19 15:34:07 2009
New Revision: 89389
URL: http://llvm.org/viewvc/llvm-project?rev=89389&view=rev
Log:
Comparing a pointer with null is not a capture.
Modified:
llvm/trunk/lib/Analysis/CaptureTracking.cpp
Modified: llvm/trunk/lib/Analysis/CaptureTracking.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/CaptureTracking.cpp?rev=89389&r1=89388&r2=89389&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/CaptureTracking.cpp (original)
+++ llvm/trunk/lib/Analysis/CaptureTracking.cpp Thu Nov 19 15:34:07 2009
@@ -98,6 +98,11 @@
Worklist.push_back(U);
}
break;
+ case Instruction::ICmp:
+ // Comparing the pointer against null does not count as a capture.
+ if (isa<ConstantPointerNull>(I->getOperand(1)))
+ break;
+ return true;
default:
// Something else - be conservative and say it is captured.
return true;
More information about the llvm-commits
mailing list