mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-25 05:22:04 +00:00
Consolidate some TableGen diagnostic helper functions.
TableGen had diagnostic printers sprinkled about in a few places. Pull them together into a single location in Error.cpp. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133568 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -26,6 +26,7 @@
|
||||
#include "DAGISelEmitter.h"
|
||||
#include "DisassemblerEmitter.h"
|
||||
#include "EDEmitter.h"
|
||||
#include "Error.h"
|
||||
#include "FastISelEmitter.h"
|
||||
#include "InstrEnumEmitter.h"
|
||||
#include "InstrInfoEmitter.h"
|
||||
@@ -194,12 +195,6 @@ namespace {
|
||||
}
|
||||
|
||||
|
||||
static SourceMgr SrcMgr;
|
||||
|
||||
void llvm::PrintError(SMLoc ErrorLoc, const Twine &Msg) {
|
||||
SrcMgr.PrintMessage(ErrorLoc, Msg, "error");
|
||||
}
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
RecordKeeper Records;
|
||||
|
||||
@@ -403,13 +398,11 @@ int main(int argc, char **argv) {
|
||||
return 0;
|
||||
|
||||
} catch (const TGError &Error) {
|
||||
errs() << argv[0] << ": error:\n";
|
||||
PrintError(Error.getLoc(), Error.getMessage());
|
||||
|
||||
PrintError(Error);
|
||||
} catch (const std::string &Error) {
|
||||
errs() << argv[0] << ": " << Error << "\n";
|
||||
PrintError(Error);
|
||||
} catch (const char *Error) {
|
||||
errs() << argv[0] << ": " << Error << "\n";
|
||||
PrintError(Error);
|
||||
} catch (...) {
|
||||
errs() << argv[0] << ": Unknown unexpected exception occurred.\n";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user