projects
/
oota-llvm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Mark strto* as readonly when the endptr is null.
[oota-llvm.git]
/
lib
/
Transforms
/
Scalar
/
SimplifyLibCalls.cpp
diff --git
a/lib/Transforms/Scalar/SimplifyLibCalls.cpp
b/lib/Transforms/Scalar/SimplifyLibCalls.cpp
index fed239eae3690a53490ee45fdcc85296ff2a56e9..c199f301a99eefd229dcbdb8a5352dfb261672b4 100644
(file)
--- a/
lib/Transforms/Scalar/SimplifyLibCalls.cpp
+++ b/
lib/Transforms/Scalar/SimplifyLibCalls.cpp
@@
-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;
}