From 0eafc7fc37e48b27aad907bcdf0b726d2e6a9af8 Mon Sep 17 00:00:00 2001 From: Joerg Sonnenberger Date: Thu, 25 Oct 2012 16:35:18 +0000 Subject: 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 --- lib/TableGen/Error.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'lib/TableGen/Error.cpp') diff --git a/lib/TableGen/Error.cpp b/lib/TableGen/Error.cpp index 5dd688cb67..ad98fba9ba 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 + 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 ErrorLoc, const std::string &Msg) { + PrintError(ErrorLoc, Msg); + std::exit(1); +} + } // end namespace llvm -- cgit v1.2.3-18-g5258