r204997 - Get rid of the adapted isLiteral method.

Manuel Klimek klimek at google.com
Fri Mar 28 02:27:10 PDT 2014


Author: klimek
Date: Fri Mar 28 04:27:09 2014
New Revision: 204997

URL: http://llvm.org/viewvc/llvm-project?rev=204997&view=rev
Log:
Get rid of the adapted isLiteral method.

We don't want to deviate from clang's standard terminology.

Modified:
    cfe/trunk/lib/Format/FormatToken.h
    cfe/trunk/lib/Format/TokenAnnotator.cpp

Modified: cfe/trunk/lib/Format/FormatToken.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Format/FormatToken.h?rev=204997&r1=204996&r2=204997&view=diff
==============================================================================
--- cfe/trunk/lib/Format/FormatToken.h (original)
+++ cfe/trunk/lib/Format/FormatToken.h Fri Mar 28 04:27:09 2014
@@ -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;
 

Modified: cfe/trunk/lib/Format/TokenAnnotator.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Format/TokenAnnotator.cpp?rev=204997&r1=204996&r2=204997&view=diff
==============================================================================
--- cfe/trunk/lib/Format/TokenAnnotator.cpp (original)
+++ cfe/trunk/lib/Format/TokenAnnotator.cpp Fri Mar 28 04:27:09 2014
@@ -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.





More information about the cfe-commits mailing list