aboutsummaryrefslogtreecommitdiffstats
path: root/lib/TableGen
diff options
context:
space:
mode:
authorJoerg Sonnenberger <joerg@bec.de>2012-10-25 16:35:18 +0000
committerJoerg Sonnenberger <joerg@bec.de>2012-10-25 16:35:18 +0000
commit0eafc7fc37e48b27aad907bcdf0b726d2e6a9af8 (patch)
treea72567537c4104bfb7aed5067fb0d73f1ad42a24 /lib/TableGen
parent8e4e0074092f5e6e429f4ac5415a82a8423ec4f9 (diff)
downloadexternal_llvm-0eafc7fc37e48b27aad907bcdf0b726d2e6a9af8.zip
external_llvm-0eafc7fc37e48b27aad907bcdf0b726d2e6a9af8.tar.gz
external_llvm-0eafc7fc37e48b27aad907bcdf0b726d2e6a9af8.tar.bz2
In preparation for removing exception handling in tablegen, add
PrintFatalError, which combines PrintError with exit(1). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166690 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/TableGen')
-rw-r--r--lib/TableGen/Error.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/TableGen/Error.cpp b/lib/TableGen/Error.cpp
index 5dd688c..ad98fba 100644
--- a/lib/TableGen/Error.cpp
+++ b/lib/TableGen/Error.cpp
@@ -16,6 +16,8 @@
#include "llvm/ADT/Twine.h"
#include "llvm/Support/raw_ostream.h"
+#include <cstdlib>
+
namespace llvm {
SourceMgr SrcMgr;
@@ -63,4 +65,14 @@ void PrintError(const TGError &Error) {
PrintError(Error.getLoc(), Error.getMessage());
}
+void PrintFatalError(const std::string &Msg) {
+ PrintError(Twine(Msg));
+ std::exit(1);
+}
+
+void PrintFatalError(ArrayRef<SMLoc> ErrorLoc, const std::string &Msg) {
+ PrintError(ErrorLoc, Msg);
+ std::exit(1);
+}
+
} // end namespace llvm