diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2015-06-21 14:00:56 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2015-06-21 14:00:56 +0000 |
commit | 2e645aa5697838f16ec570eb07c2bee7e13d0e0b (patch) | |
tree | a764184c2fc9486979b074250b013a0937ee64e5 /lib/Lex/TokenConcatenation.cpp | |
parent | 798321d8eb5630cd4a8f490a4f25e32ef195fb07 (diff) |
Notes
Diffstat (limited to 'lib/Lex/TokenConcatenation.cpp')
-rw-r--r-- | lib/Lex/TokenConcatenation.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/Lex/TokenConcatenation.cpp b/lib/Lex/TokenConcatenation.cpp index 08327496ab8a..27b4eab1a28d 100644 --- a/lib/Lex/TokenConcatenation.cpp +++ b/lib/Lex/TokenConcatenation.cpp @@ -178,20 +178,20 @@ bool TokenConcatenation::AvoidConcat(const Token &PrevPrevTok, if (ConcatInfo & aci_avoid_equal) { // If the next token is '=' or '==', avoid concatenation. - if (Tok.is(tok::equal) || Tok.is(tok::equalequal)) + if (Tok.isOneOf(tok::equal, tok::equalequal)) return true; ConcatInfo &= ~aci_avoid_equal; } if (Tok.isAnnotation()) { // Modules annotation can show up when generated automatically for includes. - assert((Tok.is(tok::annot_module_include) || - Tok.is(tok::annot_module_begin) || - Tok.is(tok::annot_module_end)) && + assert(Tok.isOneOf(tok::annot_module_include, tok::annot_module_begin, + tok::annot_module_end) && "unexpected annotation in AvoidConcat"); ConcatInfo = 0; } - if (ConcatInfo == 0) return false; + if (ConcatInfo == 0) + return false; // Basic algorithm: we look at the first character of the second token, and // determine whether it, if appended to the first token, would form (or @@ -238,11 +238,11 @@ bool TokenConcatenation::AvoidConcat(const Token &PrevPrevTok, if (Tok.is(tok::numeric_constant)) return GetFirstChar(PP, Tok) != '.'; - if (Tok.getIdentifierInfo() || Tok.is(tok::wide_string_literal) || - Tok.is(tok::utf8_string_literal) || Tok.is(tok::utf16_string_literal) || - Tok.is(tok::utf32_string_literal) || Tok.is(tok::wide_char_constant) || - Tok.is(tok::utf8_char_constant) || Tok.is(tok::utf16_char_constant) || - Tok.is(tok::utf32_char_constant)) + if (Tok.getIdentifierInfo() || + Tok.isOneOf(tok::wide_string_literal, tok::utf8_string_literal, + tok::utf16_string_literal, tok::utf32_string_literal, + tok::wide_char_constant, tok::utf8_char_constant, + tok::utf16_char_constant, tok::utf32_char_constant)) return true; // If this isn't identifier + string, we're done. |