No functionality change.
authorYunzhong Gao <Yunzhong_Gao@playstation.sony.com>
Wed, 21 Aug 2013 22:11:15 +0000 (22:11 +0000)
committerYunzhong Gao <Yunzhong_Gao@playstation.sony.com>
Wed, 21 Aug 2013 22:11:15 +0000 (22:11 +0000)
Replace "(255 & value)" with "(0xFF & value)" to improve clarity.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188941 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Utils/SimplifyLibCalls.cpp

index ff0d5d9e8dd52688fcf1ce4e74b9c04f3ec1f9be..83636fbb5acc8dbdd67cd562f85b6bf5a3a3530b 100644 (file)
@@ -477,7 +477,7 @@ struct StrChrOpt : public LibCallOptimization {
 
     // Compute the offset, make sure to handle the case when we're searching for
     // zero (a weird way to spell strlen).
 
     // 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());
         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 LibCallOptimization {
     }
 
     // Compute the offset.
     }
 
     // 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());
         Str.size() : Str.rfind(CharC->getSExtValue());
     if (I == StringRef::npos) // Didn't find the char. Return null.
       return Constant::getNullValue(CI->getType());