mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 20:32:21 +00:00
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
This commit is contained in:
parent
037764227e
commit
98d67d7d7e
@ -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;
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user