projects
/
oota-llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
0377642
)
reorder to follow a normal fall-through style, no functionality change.
author
Chris Lattner
<sabre@nondot.org>
Wed, 23 Dec 2009 23:24:51 +0000
(23:24 +0000)
committer
Chris Lattner
<sabre@nondot.org>
Wed, 23 Dec 2009 23:24:51 +0000
(23:24 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92084
91177308
-0d34-0410-b5e6-
96231b3b80d8
lib/Transforms/Scalar/SimplifyLibCalls.cpp
patch
|
blob
|
history
diff --git
a/lib/Transforms/Scalar/SimplifyLibCalls.cpp
b/lib/Transforms/Scalar/SimplifyLibCalls.cpp
index 4c6580f64a16311f06e368f9a105d287a6274cbd..30c3f3f398c2a756ffb5553762a43139700ce366 100644
(file)
--- a/
lib/Transforms/Scalar/SimplifyLibCalls.cpp
+++ b/
lib/Transforms/Scalar/SimplifyLibCalls.cpp
@@
-905,12
+905,11
@@
struct StrLenOpt : public LibCallOptimization {
if (uint64_t Len = GetStringLength(Src))
return ConstantInt::get(CI->getType(), Len-1);
- // Handle strlen(p) != 0.
- if (!IsOnlyUsedInZeroEqualityComparison(CI)) return 0;
-
// strlen(x) != 0 --> *x != 0
// strlen(x) == 0 --> *x == 0
- return B.CreateZExt(B.CreateLoad(Src, "strlenfirst"), CI->getType());
+ if (IsOnlyUsedInZeroEqualityComparison(CI))
+ return B.CreateZExt(B.CreateLoad(Src, "strlenfirst"), CI->getType());
+ return 0;
}
};