From: Craig Topper Date: Thu, 11 Aug 2011 05:10:55 +0000 (+0000) Subject: Raw string followup. Pass a couple StringRefs by value. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=03720fce6e709661af020f3e4e6dfd08a96e8044;p=clang Raw string followup. Pass a couple StringRefs by value. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137301 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Lex/LiteralSupport.h b/include/clang/Lex/LiteralSupport.h index 3a3782a3b2..5d7feb3a1a 100644 --- a/include/clang/Lex/LiteralSupport.h +++ b/include/clang/Lex/LiteralSupport.h @@ -197,7 +197,7 @@ public: private: void init(const Token *StringToks, unsigned NumStringToks); - void CopyStringFragment(const StringRef &Fragment); + void CopyStringFragment(StringRef Fragment); }; } // end namespace clang diff --git a/lib/Lex/LiteralSupport.cpp b/lib/Lex/LiteralSupport.cpp index c74b1466f3..19398bb6d9 100644 --- a/lib/Lex/LiteralSupport.cpp +++ b/lib/Lex/LiteralSupport.cpp @@ -1119,7 +1119,7 @@ void StringLiteralParser::init(const Token *StringToks, unsigned NumStringToks){ /// copyStringFragment - This function copies from Start to End into ResultPtr. /// Performs widening for multi-byte characters. -void StringLiteralParser::CopyStringFragment(const StringRef &Fragment) { +void StringLiteralParser::CopyStringFragment(StringRef Fragment) { // Copy the character span over. if (CharByteWidth == 1) { memcpy(ResultPtr, Fragment.data(), Fragment.size()); diff --git a/lib/Lex/TokenConcatenation.cpp b/lib/Lex/TokenConcatenation.cpp index d6f3bc493f..2940b52d68 100644 --- a/lib/Lex/TokenConcatenation.cpp +++ b/lib/Lex/TokenConcatenation.cpp @@ -19,7 +19,7 @@ using namespace clang; /// IsStringPrefix - Return true if Str is a string prefix. /// 'L', 'u', 'U', or 'u8'. Including raw versions. -static bool IsStringPrefix(const StringRef &Str, bool CPlusPlus0x) { +static bool IsStringPrefix(StringRef Str, bool CPlusPlus0x) { if (Str[0] == 'L' || (CPlusPlus0x && (Str[0] == 'u' || Str[0] == 'U' || Str[0] == 'R'))) {