From 6d903092c95703b17f90ba9e3f3f2032f364ee4e Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Thu, 19 Nov 2009 23:53:49 +0000 Subject: 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 --- lib/Analysis/CaptureTracking.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib/Analysis/CaptureTracking.cpp') diff --git a/lib/Analysis/CaptureTracking.cpp b/lib/Analysis/CaptureTracking.cpp index ae0766b237..6781dccc97 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(I->getOperand(1))) - break; + if (ConstantPointerNull *CPN = + dyn_cast(I->getOperand(1))) + if (CPN->getType()->getAddressSpace() == 0) + break; return true; default: // Something else - be conservative and say it is captured. -- cgit v1.2.3