Mark strto* as readonly when the endptr is null.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64460 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Nick Lewycky
2009-02-13 17:08:33 +00:00
parent 4c49841f34
commit 02b6a6a75f
2 changed files with 8 additions and 5 deletions

View File

@@ -733,8 +733,10 @@ struct VISIBILITY_HIDDEN StrToOpt : public LibCallOptimization {
return 0;
Value *EndPtr = CI->getOperand(2);
if (isa<ConstantPointerNull>(EndPtr))
if (isa<ConstantPointerNull>(EndPtr)) {
CI->setOnlyReadsMemory();
CI->addAttribute(1, Attribute::NoCapture);
}
return 0;
}