@@ -147,7 +147,7 @@ static unsigned ProcessCharEscape(const char *ThisTokBegin,
147147 // that would have been \", which would not have been the end of string.
148148 unsigned ResultChar = *ThisTokBuf++;
149149 char Escape = ResultChar;
150- bool Translate = true ;
150+ bool Transcode = true ;
151151 bool Invalid = false ;
152152 switch (ResultChar) {
153153 // These map to themselves.
@@ -189,7 +189,7 @@ static unsigned ProcessCharEscape(const char *ThisTokBegin,
189189 ResultChar = 11 ;
190190 break ;
191191 case ' x' : { // Hex escape.
192- Translate = false ;
192+ Transcode = false ;
193193 ResultChar = 0 ;
194194 if (ThisTokBuf != ThisTokEnd && *ThisTokBuf == ' {' ) {
195195 Delimited = true ;
@@ -253,7 +253,7 @@ static unsigned ProcessCharEscape(const char *ThisTokBegin,
253253 case ' 4' : case ' 5' : case ' 6' : case ' 7' : {
254254 // Octal escapes.
255255 --ThisTokBuf;
256- Translate = false ;
256+ Transcode = false ;
257257 ResultChar = 0 ;
258258
259259 // Octal escapes are a series of octal digits with maximum length 3.
@@ -373,7 +373,7 @@ static unsigned ProcessCharEscape(const char *ThisTokBegin,
373373 HadError = true ;
374374 }
375375
376- if (Translate && Converter) {
376+ if (Transcode && Converter) {
377377 // Invalid escapes are written as '?' and then translated.
378378 char ByteChar = Invalid ? ' ?' : ResultChar;
379379 SmallString<8 > ResultCharConv;
@@ -1834,8 +1834,8 @@ CharLiteralParser::CharLiteralParser(const char *begin, const char *end,
18341834 }
18351835
18361836 llvm::TextEncodingConverter *Converter = nullptr ;
1837- if (!isUTFLiteral (Kind) && LiteralConv)
1838- Converter = LiteralConv->getConverter (ToExecEncoding );
1837+ if (!isUTFLiteral (Kind) && ! isWideLiteral (Kind) && LiteralConv)
1838+ Converter = LiteralConv->getConverter (CA_ToExecEncoding );
18391839
18401840 while (begin != end) {
18411841 // Is this a span of non-escape characters?
@@ -2142,7 +2142,7 @@ void StringLiteralParser::init(ArrayRef<Token> StringToks,
21422142 SourceLocation UDSuffixTokLoc;
21432143
21442144 llvm::TextEncodingConverter *Converter = nullptr ;
2145- if (!isUTFLiteral (Kind) && LiteralConv)
2145+ if (!isUTFLiteral (Kind) && ! isWideLiteral (Kind) && LiteralConv)
21462146 Converter = LiteralConv->getConverter (Action);
21472147
21482148 for (unsigned i = 0 , e = StringToks.size (); i != e; ++i) {
0 commit comments