From a3c924f83aefd4c883ed17a200876d258e0ad1e2 Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Tue, 28 Jul 2009 16:56:42 +0000 Subject: Switch AsmLexer::Lex to returning a reference to the current token. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77328 91177308-0d34-0410-b5e6-96231b3b80d8 --- tools/llvm-mc/llvm-mc.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'tools/llvm-mc/llvm-mc.cpp') diff --git a/tools/llvm-mc/llvm-mc.cpp b/tools/llvm-mc/llvm-mc.cpp index 63cb70d504..a64c8a6505 100644 --- a/tools/llvm-mc/llvm-mc.cpp +++ b/tools/llvm-mc/llvm-mc.cpp @@ -83,9 +83,8 @@ static int AsLexInput(const char *ProgName) { bool Error = false; - AsmToken::TokenKind Tok = Lexer.Lex(); - while (Tok != AsmToken::Eof) { - switch (Tok) { + while (Lexer.Lex().isNot(AsmToken::Eof)) { + switch (Lexer.getKind()) { default: Lexer.PrintMessage(Lexer.getLoc(), "unknown token", "warning"); Error = true; @@ -136,8 +135,6 @@ static int AsLexInput(const char *ProgName) { case AsmToken::Star: outs() << "Star\n"; break; case AsmToken::Tilde: outs() << "Tilde\n"; break; } - - Tok = Lexer.Lex(); } return Error; -- cgit v1.2.3