[PATCH] D36701: Use Token::isOneOf method in Parser.
Frederich Munch via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Aug 14 11:11:36 PDT 2017
marsupial created this revision.
Easier to read and possibly optimize.
https://reviews.llvm.org/D36701
Files:
include/clang/Parse/Parser.h
Index: include/clang/Parse/Parser.h
===================================================================
--- include/clang/Parse/Parser.h
+++ include/clang/Parse/Parser.h
@@ -355,15 +355,15 @@
/// isTokenParen - Return true if the cur token is '(' or ')'.
bool isTokenParen() const {
- return Tok.getKind() == tok::l_paren || Tok.getKind() == tok::r_paren;
+ return Tok.isOneOf(tok::l_paren, tok::r_paren);
}
/// isTokenBracket - Return true if the cur token is '[' or ']'.
bool isTokenBracket() const {
- return Tok.getKind() == tok::l_square || Tok.getKind() == tok::r_square;
+ return Tok.isOneOf(tok::l_square, tok::r_square);
}
/// isTokenBrace - Return true if the cur token is '{' or '}'.
bool isTokenBrace() const {
- return Tok.getKind() == tok::l_brace || Tok.getKind() == tok::r_brace;
+ return Tok.isOneOf(tok::l_brace, tok::r_brace);
}
/// isTokenStringLiteral - True if this token is a string-literal.
bool isTokenStringLiteral() const {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D36701.111034.patch
Type: text/x-patch
Size: 1004 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170814/cdf67a2e/attachment.bin>
More information about the cfe-commits
mailing list