aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-12-23 23:24:51 +0000
committerChris Lattner <sabre@nondot.org>2009-12-23 23:24:51 +0000
commit98d67d7d7e8156d78b8c7d82c15ff52ed92bcc86 (patch)
treee43b2b856b0f7664443a04a3259f88d629611126
parent037764227e5a0ebbcb3d634164bc08631f2965d4 (diff)
reorder to follow a normal fall-through style, no functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92084 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Transforms/Scalar/SimplifyLibCalls.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/Transforms/Scalar/SimplifyLibCalls.cpp b/lib/Transforms/Scalar/SimplifyLibCalls.cpp
index 4c6580f64a..30c3f3f398 100644
--- 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;
}
};