diff options
author | dim <dim@FreeBSD.org> | 2013-04-08 18:45:10 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2013-04-08 18:45:10 +0000 |
commit | c72c57c9e9b69944e3e009cd5e209634839581d3 (patch) | |
tree | 4fc2f184c499d106f29a386c452b49e5197bf63d /lib/Lex/MacroArgs.cpp | |
parent | 5b20025c30d23d521e12c1f33ec8fa6b821952cd (diff) | |
download | FreeBSD-src-c72c57c9e9b69944e3e009cd5e209634839581d3.zip FreeBSD-src-c72c57c9e9b69944e3e009cd5e209634839581d3.tar.gz |
Vendor import of clang trunk r178860:
http://llvm.org/svn/llvm-project/cfe/trunk@178860
Diffstat (limited to 'lib/Lex/MacroArgs.cpp')
-rw-r--r-- | lib/Lex/MacroArgs.cpp | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/lib/Lex/MacroArgs.cpp b/lib/Lex/MacroArgs.cpp index ed8873d..f6e781a 100644 --- a/lib/Lex/MacroArgs.cpp +++ b/lib/Lex/MacroArgs.cpp @@ -12,9 +12,9 @@ //===----------------------------------------------------------------------===// #include "MacroArgs.h" +#include "clang/Lex/LexDiagnostic.h" #include "clang/Lex/MacroInfo.h" #include "clang/Lex/Preprocessor.h" -#include "clang/Lex/LexDiagnostic.h" #include "llvm/ADT/SmallString.h" #include "llvm/Support/SaveAndRestore.h" #include <algorithm> @@ -23,7 +23,7 @@ using namespace clang; /// MacroArgs ctor function - This destroys the vector passed in. MacroArgs *MacroArgs::create(const MacroInfo *MI, - llvm::ArrayRef<Token> UnexpArgTokens, + ArrayRef<Token> UnexpArgTokens, bool VarargsElided, Preprocessor &PP) { assert(MI->isFunctionLike() && "Can't have args for an object-like macro!"); @@ -215,15 +215,11 @@ Token MacroArgs::StringifyArgument(const Token *ArgToks, // If this is a string or character constant, escape the token as specified // by 6.10.3.2p2. - if (Tok.is(tok::string_literal) || // "foo" - Tok.is(tok::wide_string_literal) || // L"foo" - Tok.is(tok::utf8_string_literal) || // u8"foo" - Tok.is(tok::utf16_string_literal) || // u"foo" - Tok.is(tok::utf32_string_literal) || // U"foo" - Tok.is(tok::char_constant) || // 'x' - Tok.is(tok::wide_char_constant) || // L'x'. - Tok.is(tok::utf16_char_constant) || // u'x'. - Tok.is(tok::utf32_char_constant)) { // U'x'. + if (tok::isStringLiteral(Tok.getKind()) || // "foo", u8R"x(foo)x"_bar, etc. + Tok.is(tok::char_constant) || // 'x' + Tok.is(tok::wide_char_constant) || // L'x'. + Tok.is(tok::utf16_char_constant) || // u'x'. + Tok.is(tok::utf32_char_constant)) { // U'x'. bool Invalid = false; std::string TokStr = PP.getSpelling(Tok, &Invalid); if (!Invalid) { |