[llvm] r188941 - No functionality change.
Yunzhong Gao
Yunzhong_Gao at playstation.sony.com
Wed Aug 21 15:11:15 PDT 2013
Author: ygao
Date: Wed Aug 21 17:11:15 2013
New Revision: 188941
URL: http://llvm.org/viewvc/llvm-project?rev=188941&view=rev
Log:
No functionality change.
Replace "(255 & value)" with "(0xFF & value)" to improve clarity.
Modified:
llvm/trunk/lib/Transforms/Utils/SimplifyLibCalls.cpp
Modified: llvm/trunk/lib/Transforms/Utils/SimplifyLibCalls.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/SimplifyLibCalls.cpp?rev=188941&r1=188940&r2=188941&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/SimplifyLibCalls.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/SimplifyLibCalls.cpp Wed Aug 21 17:11:15 2013
@@ -477,7 +477,7 @@ struct StrChrOpt : public LibCallOptimiz
// Compute the offset, make sure to handle the case when we're searching for
// zero (a weird way to spell strlen).
- size_t I = (255 & CharC->getSExtValue()) == 0 ?
+ size_t I = (0xFF & CharC->getSExtValue()) == 0 ?
Str.size() : Str.find(CharC->getSExtValue());
if (I == StringRef::npos) // Didn't find the char. strchr returns null.
return Constant::getNullValue(CI->getType());
@@ -513,7 +513,7 @@ struct StrRChrOpt : public LibCallOptimi
}
// Compute the offset.
- size_t I = (255 & CharC->getSExtValue()) == 0 ?
+ size_t I = (0xFF & CharC->getSExtValue()) == 0 ?
Str.size() : Str.rfind(CharC->getSExtValue());
if (I == StringRef::npos) // Didn't find the char. Return null.
return Constant::getNullValue(CI->getType());
More information about the llvm-commits
mailing list