diff options
author | Chris Lattner <sabre@nondot.org> | 2012-01-31 04:54:27 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2012-01-31 04:54:27 +0000 |
commit | 2cf07eccff674b5157febbc4fb4f4246e47806c7 (patch) | |
tree | ee364097361650f4906550cd7fa0d200f81fd521 | |
parent | 6f72ac4799a1a20c07cd96cc994dd6394ebff9a2 (diff) | |
download | external_llvm-2cf07eccff674b5157febbc4fb4f4246e47806c7.zip external_llvm-2cf07eccff674b5157febbc4fb4f4246e47806c7.tar.gz external_llvm-2cf07eccff674b5157febbc4fb4f4246e47806c7.tar.bz2 |
eliminate the last uses of GetConstantStringInfo from this file, I didn't realize I was that close...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149354 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Transforms/Scalar/SimplifyLibCalls.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/Transforms/Scalar/SimplifyLibCalls.cpp b/lib/Transforms/Scalar/SimplifyLibCalls.cpp index 8935cc7..9c49ec1 100644 --- a/lib/Transforms/Scalar/SimplifyLibCalls.cpp +++ b/lib/Transforms/Scalar/SimplifyLibCalls.cpp @@ -545,9 +545,9 @@ struct StrPBrkOpt : public LibCallOptimization { FT->getReturnType() != FT->getParamType(0)) return 0; - std::string S1, S2; - bool HasS1 = GetConstantStringInfo(CI->getArgOperand(0), S1); - bool HasS2 = GetConstantStringInfo(CI->getArgOperand(1), S2); + StringRef S1, S2; + bool HasS1 = getConstantStringInfo(CI->getArgOperand(0), S1); + bool HasS2 = getConstantStringInfo(CI->getArgOperand(1), S2); // strpbrk(s, "") -> NULL // strpbrk("", s) -> NULL @@ -694,9 +694,9 @@ struct StrStrOpt : public LibCallOptimization { } // See if either input string is a constant string. - std::string SearchStr, ToFindStr; - bool HasStr1 = GetConstantStringInfo(CI->getArgOperand(0), SearchStr); - bool HasStr2 = GetConstantStringInfo(CI->getArgOperand(1), ToFindStr); + StringRef SearchStr, ToFindStr; + bool HasStr1 = getConstantStringInfo(CI->getArgOperand(0), SearchStr); + bool HasStr2 = getConstantStringInfo(CI->getArgOperand(1), ToFindStr); // fold strstr(x, "") -> x. if (HasStr2 && ToFindStr.empty()) @@ -706,7 +706,7 @@ struct StrStrOpt : public LibCallOptimization { if (HasStr1 && HasStr2) { std::string::size_type Offset = SearchStr.find(ToFindStr); - if (Offset == std::string::npos) // strstr("foo", "bar") -> null + if (Offset == StringRef::npos) // strstr("foo", "bar") -> null return Constant::getNullValue(CI->getType()); // strstr("abcd", "bc") -> gep((char*)"abcd", 1) |