diff options
author | Nick Lewycky <nicholas@mxc.ca> | 2013-08-21 18:57:51 +0000 |
---|---|---|
committer | Nick Lewycky <nicholas@mxc.ca> | 2013-08-21 18:57:51 +0000 |
commit | 8054f1de882851f35c1abf435c12fe228cec5d49 (patch) | |
tree | a1e00f8d0659d58ab1eef212d812ca03e1ac094e /clang/lib/Lex | |
parent | e5e9f8911fabaf42dd3df4c98aa0e23d0f7d7f8d (diff) | |
download | bcm5719-llvm-8054f1de882851f35c1abf435c12fe228cec5d49.tar.gz bcm5719-llvm-8054f1de882851f35c1abf435c12fe228cec5d49.zip |
Revert r188863 which could propose wrong fixits for multibyte character literals.
llvm-svn: 188918
Diffstat (limited to 'clang/lib/Lex')
-rw-r--r-- | clang/lib/Lex/LiteralSupport.cpp | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/clang/lib/Lex/LiteralSupport.cpp b/clang/lib/Lex/LiteralSupport.cpp index 2301aaed821..08d6c438d32 100644 --- a/clang/lib/Lex/LiteralSupport.cpp +++ b/clang/lib/Lex/LiteralSupport.cpp @@ -978,7 +978,7 @@ CharLiteralParser::CharLiteralParser(const char *begin, const char *end, uint32_t largest_character_for_kind; if (tok::wide_char_constant == Kind) { largest_character_for_kind = - 0xFFFFFFFFu >> (32 - PP.getTargetInfo().getWCharWidth()); + 0xFFFFFFFFu >> (32-PP.getTargetInfo().getWCharWidth()); } else if (tok::utf16_char_constant == Kind) { largest_character_for_kind = 0xFFFF; } else if (tok::utf32_char_constant == Kind) { @@ -1009,13 +1009,7 @@ CharLiteralParser::CharLiteralParser(const char *begin, const char *end, unsigned Msg = diag::err_bad_character_encoding; if (NoErrorOnBadEncoding) Msg = diag::warn_bad_character_encoding; - std::string escaped = llvm::utohexstr(static_cast<uint8_t>(*start)); - FullSourceLoc SourceLoc(Loc, PP.getSourceManager()); - PP.Diag(Loc, Msg) << FixItHint::CreateReplacement( - MakeCharSourceRange(PP.getLangOpts(), - SourceLoc, TokBegin, start, - start + 1), - "\\x" + escaped); + PP.Diag(Loc, Msg); if (NoErrorOnBadEncoding) { start = tmp_in_start; buffer_begin = tmp_out_start; @@ -1053,7 +1047,7 @@ CharLiteralParser::CharLiteralParser(const char *begin, const char *end, unsigned CharWidth = getCharWidth(Kind, PP.getTargetInfo()); uint64_t result = ProcessCharEscape(TokBegin, begin, end, HadError, - FullSourceLoc(Loc, PP.getSourceManager()), + FullSourceLoc(Loc,PP.getSourceManager()), CharWidth, &PP.getDiagnostics(), PP.getLangOpts()); *buffer_begin++ = result; } |