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 | 1ac1d868496cea420332f07cde2d57cf3d9744eb (patch) | |
tree | e2a2246872ca432455f6c3838f18c58ec6b8a067 /lib | |
parent | ef7c365276e64d3ec8f3f8b2b251057186c73bc4 (diff) | |
download | external_llvm-1ac1d868496cea420332f07cde2d57cf3d9744eb.zip external_llvm-1ac1d868496cea420332f07cde2d57cf3d9744eb.tar.gz external_llvm-1ac1d868496cea420332f07cde2d57cf3d9744eb.tar.bz2 |
Refine this to only apply to null in the default address space.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89411 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Analysis/CaptureTracking.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/Analysis/CaptureTracking.cpp b/lib/Analysis/CaptureTracking.cpp index ae0766b..6781dcc 100644 --- a/lib/Analysis/CaptureTracking.cpp +++ b/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. |