diff options
| author | Dan Gohman <gohman@apple.com> | 2009-11-19 21:34:07 +0000 |
|---|---|---|
| committer | Dan Gohman <gohman@apple.com> | 2009-11-19 21:34:07 +0000 |
| commit | 0a2ba1068e8b0cdba10c6b9413bc3cd2180ada85 (patch) | |
| tree | fc2fb905e266588546559d3d8592e5a0eeb475d6 /llvm | |
| parent | 84e8a249fae1e861bc0038893d946d988c8deacf (diff) | |
| download | bcm5719-llvm-0a2ba1068e8b0cdba10c6b9413bc3cd2180ada85.tar.gz bcm5719-llvm-0a2ba1068e8b0cdba10c6b9413bc3cd2180ada85.zip | |
Comparing a pointer with null is not a capture.
llvm-svn: 89389
Diffstat (limited to 'llvm')
| -rw-r--r-- | llvm/lib/Analysis/CaptureTracking.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/CaptureTracking.cpp b/llvm/lib/Analysis/CaptureTracking.cpp index f615881829c..7cd055dcd89 100644 --- a/llvm/lib/Analysis/CaptureTracking.cpp +++ b/llvm/lib/Analysis/CaptureTracking.cpp @@ -98,6 +98,11 @@ bool llvm::PointerMayBeCaptured(const Value *V, bool ReturnCaptures) { 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; |

