diff options
author | Chris Lattner <sabre@nondot.org> | 2009-06-21 19:21:25 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-06-21 19:21:25 +0000 |
commit | d0765617d236a9603fc4f992dde2a6d179be22b3 (patch) | |
tree | b457663f96f136ff9aaf63ac2ce95bb71b6658b8 /llvm/tools/llvm-mc/llvm-mc.cpp | |
parent | 99b57fb987ac846306459e95de19472b2a9ae609 (diff) | |
download | bcm5719-llvm-d0765617d236a9603fc4f992dde2a6d179be22b3.tar.gz bcm5719-llvm-d0765617d236a9603fc4f992dde2a6d179be22b3.zip |
implement enough of a lexer to get through Olden/health/Output/health.llc.s
without errors.
llvm-svn: 73855
Diffstat (limited to 'llvm/tools/llvm-mc/llvm-mc.cpp')
-rw-r--r-- | llvm/tools/llvm-mc/llvm-mc.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/llvm/tools/llvm-mc/llvm-mc.cpp b/llvm/tools/llvm-mc/llvm-mc.cpp index 83642988e37..20f353ca670 100644 --- a/llvm/tools/llvm-mc/llvm-mc.cpp +++ b/llvm/tools/llvm-mc/llvm-mc.cpp @@ -72,17 +72,29 @@ static int AssembleInput(const char *ProgName) { asmtok::TokKind Tok = Lexer.Lex(); while (Tok != asmtok::Eof) { switch (Tok) { - default: outs() << "<<unknown token>>\n"; break; - case asmtok::Error: outs() << "<<error>>\n"; break; + default: Lexer.PrintError(Lexer.getLoc(), "driver: unknown token"); break; + case asmtok::Error: + Lexer.PrintError(Lexer.getLoc(), "error, bad token"); + break; case asmtok::Identifier: outs() << "identifier: " << Lexer.getCurStrVal() << '\n'; break; + case asmtok::Register: + outs() << "register: " << Lexer.getCurStrVal() << '\n'; + break; case asmtok::IntVal: outs() << "int: " << Lexer.getCurIntVal() << '\n'; break; + case asmtok::EndOfStatement: outs() << "EndOfStatement\n"; break; case asmtok::Colon: outs() << "Colon\n"; break; case asmtok::Plus: outs() << "Plus\n"; break; case asmtok::Minus: outs() << "Minus\n"; break; + case asmtok::Slash: outs() << "Slash\n"; break; + case asmtok::LParen: outs() << "LParen\n"; break; + case asmtok::RParen: outs() << "RParen\n"; break; + case asmtok::Star: outs() << "Star\n"; break; + case asmtok::Comma: outs() << "Comma\n"; break; + case asmtok::Dollar: outs() << "Dollar\n"; break; } Tok = Lexer.Lex(); |