aboutsummaryrefslogtreecommitdiff
path: root/tools/llvm-mc/llvm-mc.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-06-21 19:21:25 +0000
committerChris Lattner <sabre@nondot.org>2009-06-21 19:21:25 +0000
commit4651bca31bdad27184fa0d36640bf5ef1d83cf5c (patch)
treeb97455dfc60462b5a65c04d5b95393f838627af2 /tools/llvm-mc/llvm-mc.cpp
parent1c3329f7072356c8da84534ed0a7033b10f73062 (diff)
implement enough of a lexer to get through Olden/health/Output/health.llc.s
without errors. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73855 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-mc/llvm-mc.cpp')
-rw-r--r--tools/llvm-mc/llvm-mc.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/tools/llvm-mc/llvm-mc.cpp b/tools/llvm-mc/llvm-mc.cpp
index 83642988e3..20f353ca67 100644
--- a/tools/llvm-mc/llvm-mc.cpp
+++ b/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();