From: Manuel Klimek Date: Fri, 28 Mar 2014 09:27:09 +0000 (+0000) Subject: Get rid of the adapted isLiteral method. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f5b10e63a39521dc435a97088820ee4870d9107b;p=clang Get rid of the adapted isLiteral method. We don't want to deviate from clang's standard terminology. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@204997 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Format/FormatToken.h b/lib/Format/FormatToken.h index b7262f396d..42d4a8dc24 100644 --- a/lib/Format/FormatToken.h +++ b/lib/Format/FormatToken.h @@ -282,10 +282,6 @@ struct FormatToken { (!ColonRequired || (Next && Next->is(tok::colon))); } - bool isLiteral() const { - return Tok.isLiteral() || isOneOf(tok::kw_true, tok::kw_false); - } - /// \brief Determine whether the token is a simple-type-specifier. bool isSimpleTypeSpecifier() const; diff --git a/lib/Format/TokenAnnotator.cpp b/lib/Format/TokenAnnotator.cpp index c3312cc66b..6a0e03461e 100644 --- a/lib/Format/TokenAnnotator.cpp +++ b/lib/Format/TokenAnnotator.cpp @@ -862,9 +862,12 @@ private: PrevToken->MatchingParen->Previous->is(tok::kw_typeof)) return TT_PointerOrReference; - if (PrevToken->isLiteral() || - PrevToken->isOneOf(tok::r_paren, tok::r_square) || - NextToken->isLiteral() || NextToken->isUnaryOperator() || + if (PrevToken->Tok.isLiteral() || + PrevToken->isOneOf(tok::r_paren, tok::r_square, tok::kw_true, + tok::kw_false) || + NextToken->Tok.isLiteral() || + NextToken->isOneOf(tok::kw_true, tok::kw_false) || + NextToken->isUnaryOperator() || // If we know we're in a template argument, there are no named // declarations. Thus, having an identifier on the right-hand side // indicates a binary operator.