diff options
author | Dan Gohman <gohman@apple.com> | 2009-11-19 23:53:49 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2009-11-19 23:53:49 +0000 |
commit | 772f922acb42524d3bd49dd1d0042ca181b0eb2b (patch) | |
tree | 051b5e11a8ba668ba64dc0e8919ce83a2d6c29a6 | |
parent | 34fb6838bcbe3115596cd26d2c2a888ab323fdc5 (diff) | |
download | bcm5719-llvm-772f922acb42524d3bd49dd1d0042ca181b0eb2b.tar.gz bcm5719-llvm-772f922acb42524d3bd49dd1d0042ca181b0eb2b.zip |
Refine this to only apply to null in the default address space.
llvm-svn: 89411
-rw-r--r-- | llvm/lib/Analysis/CaptureTracking.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/Analysis/CaptureTracking.cpp b/llvm/lib/Analysis/CaptureTracking.cpp index ae0766b237c..6781dccc972 100644 --- a/llvm/lib/Analysis/CaptureTracking.cpp +++ b/llvm/lib/Analysis/CaptureTracking.cpp @@ -107,8 +107,10 @@ bool llvm::PointerMayBeCaptured(const Value *V, break; case Instruction::ICmp: // Comparing the pointer against null does not count as a capture. - if (isa<ConstantPointerNull>(I->getOperand(1))) - break; + if (ConstantPointerNull *CPN = + dyn_cast<ConstantPointerNull>(I->getOperand(1))) + if (CPN->getType()->getAddressSpace() == 0) + break; return true; default: // Something else - be conservative and say it is captured. |