From 98c1f7cfded03d3f5656611059796da514a9211e Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Tue, 9 Oct 2007 18:02:16 +0000 Subject: Switch lexer/pp over to new Token::is/isNot api llvm-svn: 42799 --- clang/Lex/Lexer.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'clang/Lex/Lexer.cpp') diff --git a/clang/Lex/Lexer.cpp b/clang/Lex/Lexer.cpp index 0c67d2ab735..a14e51fa6a6 100644 --- a/clang/Lex/Lexer.cpp +++ b/clang/Lex/Lexer.cpp @@ -41,8 +41,8 @@ static void InitCharacterInfo(); /// isObjCAtKeyword - Return true if we have an ObjC keyword identifier. bool Token::isObjCAtKeyword(tok::ObjCKeywordKind objcKey) const { - return getKind() == tok::identifier && - getIdentifierInfo()->getObjCKeywordID() == objcKey; + return is(tok::identifier) && + getIdentifierInfo()->getObjCKeywordID() == objcKey; } /// getObjCKeywordID - Return the ObjC keyword kind. @@ -979,7 +979,7 @@ void Lexer::LexIncludeFilename(Token &FilenameTok) { ParsingFilename = false; // No filename? - if (FilenameTok.getKind() == tok::eom) + if (FilenameTok.is(tok::eom)) Diag(FilenameTok.getLocation(), diag::err_pp_expects_filename); } @@ -1015,7 +1015,7 @@ std::string Lexer::ReadToEndOfLine() { // Next, lex the character, which should handle the EOM transition. Lex(Tmp); - assert(Tmp.getKind() == tok::eom && "Unexpected token!"); + assert(Tmp.is(tok::eom) && "Unexpected token!"); // Finally, we're done, return the string we found. return Result; @@ -1096,9 +1096,9 @@ unsigned Lexer::isNextPPTokenLParen() { // Restore the lexer back to non-skipping mode. LexingRawMode = false; - if (Tok.getKind() == tok::eof) + if (Tok.is(tok::eof)) return 2; - return Tok.getKind() == tok::l_paren; + return Tok.is(tok::l_paren); } -- cgit v1.2.3