summaryrefslogtreecommitdiffstats
path: root/llvm/utils/TableGen/TableGen.cpp
diff options
context:
space:
mode:
authorJim Grosbach <grosbach@apple.com>2011-06-21 22:55:50 +0000
committerJim Grosbach <grosbach@apple.com>2011-06-21 22:55:50 +0000
commit797cff050437d8bd9db53bd1de1e54e168155ae3 (patch)
treeba1ec250171f2626012be8efeb34c08a1b72096b /llvm/utils/TableGen/TableGen.cpp
parentd1955e78b4d5f2d6c592d10046bf9d23f804b304 (diff)
downloadbcm5719-llvm-797cff050437d8bd9db53bd1de1e54e168155ae3.tar.gz
bcm5719-llvm-797cff050437d8bd9db53bd1de1e54e168155ae3.zip
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. llvm-svn: 133568
Diffstat (limited to 'llvm/utils/TableGen/TableGen.cpp')
-rw-r--r--llvm/utils/TableGen/TableGen.cpp15
1 files changed, 4 insertions, 11 deletions
diff --git a/llvm/utils/TableGen/TableGen.cpp b/llvm/utils/TableGen/TableGen.cpp
index 4e4da366ae0..39fe9934cd3 100644
--- a/llvm/utils/TableGen/TableGen.cpp
+++ b/llvm/utils/TableGen/TableGen.cpp
@@ -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";
}
OpenPOWER on IntegriCloud