llvm.org GIT mirror llvm / 0eafc7f
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 Joerg Sonnenberger 7 years ago
2 changed file(s) with 15 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
3939 void PrintError(const Twine &Msg);
4040 void PrintError(const TGError &Error);
4141
42 LLVM_ATTRIBUTE_NORETURN void PrintFatalError(const std::string &Msg);
43 LLVM_ATTRIBUTE_NORETURN void PrintFatalError(ArrayRef ErrorLoc,
44 const std::string &Msg);
4245
4346 extern SourceMgr SrcMgr;
4447
1414 #include "llvm/TableGen/Error.h"
1515 #include "llvm/ADT/Twine.h"
1616 #include "llvm/Support/raw_ostream.h"
17
18 #include
1719
1820 namespace llvm {
1921
6264 PrintError(Error.getLoc(), Error.getMessage());
6365 }
6466
67 void PrintFatalError(const std::string &Msg) {
68 PrintError(Twine(Msg));
69 std::exit(1);
70 }
71
72 void PrintFatalError(ArrayRef ErrorLoc, const std::string &Msg) {
73 PrintError(ErrorLoc, Msg);
74 std::exit(1);
75 }
76
6577 } // end namespace llvm