From c48acf9e6cb477471d333b525ab063bddefc196c Mon Sep 17 00:00:00 2001
From: Daniel Marjamaki <daniel.marjamaki@evidente.se>
Date: Thu, 11 Jun 2015 12:28:14 +0000
Subject: [PATCH] Token: complement is() method with isOneOf() to allow easier
 usage

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@239526 91177308-0d34-0410-b5e6-96231b3b80d8
---
 include/clang/Lex/Token.h | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/include/clang/Lex/Token.h b/include/clang/Lex/Token.h
index e0878093402..7ba22b2f626 100644
--- a/include/clang/Lex/Token.h
+++ b/include/clang/Lex/Token.h
@@ -94,6 +94,13 @@ public:
   /// "if (Tok.is(tok::l_brace)) {...}".
   bool is(tok::TokenKind K) const { return Kind == K; }
   bool isNot(tok::TokenKind K) const { return Kind != K; }
+  bool isOneOf(tok::TokenKind K1, tok::TokenKind K2) const {
+    return is(K1) || is(K2);
+  }
+  template <typename... Ts>
+  bool isOneOf(tok::TokenKind K1, tok::TokenKind K2, Ts... Ks) const {
+    return is(K1) || isOneOf(K2, Ks...);
+  }
 
   /// \brief Return true if this is a raw identifier (when lexing
   /// in raw mode) or a non-keyword identifier (when lexing in non-raw mode).
-- 
GitLab