1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 03:33:20 +01:00

Comparing a pointer with null is not a capture.

llvm-svn: 89389
This commit is contained in:
Dan Gohman 2009-11-19 21:34:07 +00:00
parent 78f8022d71
commit 141e028b96

View File

@ -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;