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
diff --git a/tools/llvm-mc/AsmLexer.cpp b/tools/llvm-mc/AsmLexer.cpp
index ba0d247..758fac4 100644
--- a/tools/llvm-mc/AsmLexer.cpp
+++ b/tools/llvm-mc/AsmLexer.cpp
@@ -44,7 +44,8 @@
 /// ReturnError - Set the error to the specified string at the specified
 /// location.  This is defined to always return AsmToken::Error.
 AsmToken AsmLexer::ReturnError(const char *Loc, const std::string &Msg) {
-  PrintMessage(SMLoc::getFromPointer(Loc), Msg, "error");
+  SetError(SMLoc::getFromPointer(Loc), Msg);
+  
   return AsmToken(AsmToken::Error, StringRef(Loc, 0));
 }