commit | 02b6a6a75f29f59a4ea267608c6d3f6b1ebbf0d5 | [log] [tgz] |
---|---|---|
author | Nick Lewycky <nicholas@mxc.ca> | Fri Feb 13 17:08:33 2009 +0000 |
committer | Nick Lewycky <nicholas@mxc.ca> | Fri Feb 13 17:08:33 2009 +0000 |
tree | bc02cda5264f6cd405a0a375c5872a2c55f849cb | |
parent | 4c49841f34baa3d0114ab8391403bee8b1a136e8 [diff] |
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
diff --git a/lib/Transforms/Scalar/SimplifyLibCalls.cpp b/lib/Transforms/Scalar/SimplifyLibCalls.cpp index fed239e..c199f30 100644 --- a/lib/Transforms/Scalar/SimplifyLibCalls.cpp +++ b/lib/Transforms/Scalar/SimplifyLibCalls.cpp
@@ -733,8 +733,10 @@ return 0; Value *EndPtr = CI->getOperand(2); - if (isa<ConstantPointerNull>(EndPtr)) + if (isa<ConstantPointerNull>(EndPtr)) { + CI->setOnlyReadsMemory(); CI->addAttribute(1, Attribute::NoCapture); + } return 0; }