diff options
Diffstat (limited to 'lib/TableGen/Error.cpp')
| -rw-r--r-- | lib/TableGen/Error.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/lib/TableGen/Error.cpp b/lib/TableGen/Error.cpp index 5dd688c..ec84a72 100644 --- a/lib/TableGen/Error.cpp +++ b/lib/TableGen/Error.cpp @@ -15,6 +15,7 @@ #include "llvm/TableGen/Error.h" #include "llvm/ADT/Twine.h" #include "llvm/Support/raw_ostream.h" +#include <cstdlib> namespace llvm { @@ -43,10 +44,6 @@ void PrintWarning(const Twine &Msg) { errs() << "warning:" << Msg << "\n"; } -void PrintWarning(const TGError &Warning) { - PrintWarning(Warning.getLoc(), Warning.getMessage()); -} - void PrintError(ArrayRef<SMLoc> ErrorLoc, const Twine &Msg) { PrintMessage(ErrorLoc, SourceMgr::DK_Error, Msg); } @@ -59,8 +56,14 @@ void PrintError(const Twine &Msg) { errs() << "error:" << Msg << "\n"; } -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 |
