diff options
Diffstat (limited to 'Lex/Lexer.cpp')
-rw-r--r-- | Lex/Lexer.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Lex/Lexer.cpp b/Lex/Lexer.cpp index f712bec719..646d575bae 100644 --- a/Lex/Lexer.cpp +++ b/Lex/Lexer.cpp @@ -51,6 +51,13 @@ tok::ObjCKeywordKind Token::getObjCKeywordID() const { return specId ? specId->getObjCKeywordID() : tok::objc_not_keyword; } +/// isNamedIdentifier - Return true if this token is a ppidentifier with the +/// specified name. For example, tok.isNamedIdentifier("this"). +bool Token::isNamedIdentifier(const char *Name) const { + return IdentInfo && !strcmp(IdentInfo->getName(), Name); +} + + //===----------------------------------------------------------------------===// // Lexer Class Implementation //===----------------------------------------------------------------------===// |