Modified MCAsmLexer to return error information upward

rather than printing it locally, reducing its dependence
on SourceMgr.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94041 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Sean Callanan
2010-01-20 22:18:24 +00:00
parent 73a1aa0966
commit 79036e421f
3 changed files with 29 additions and 4 deletions

View File

@ -101,7 +101,12 @@ bool AsmParser::TokError(const char *Msg) {
}
const AsmToken &AsmParser::Lex() {
return Lexer.Lex();
const AsmToken &tok = Lexer.Lex();
if (tok.is(AsmToken::Error))
Lexer.PrintMessage(Lexer.getErrLoc(), Lexer.getErr(), "error");
return tok;
}
bool AsmParser::Run() {