mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-27 14:24:40 +00:00
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
This commit is contained in:
@ -40,6 +40,9 @@ void PrintError(const char *Loc, const Twine &Msg);
|
|||||||
void PrintError(const Twine &Msg);
|
void PrintError(const Twine &Msg);
|
||||||
void PrintError(const TGError &Error);
|
void PrintError(const TGError &Error);
|
||||||
|
|
||||||
|
LLVM_ATTRIBUTE_NORETURN void PrintFatalError(const std::string &Msg);
|
||||||
|
LLVM_ATTRIBUTE_NORETURN void PrintFatalError(ArrayRef<SMLoc> ErrorLoc,
|
||||||
|
const std::string &Msg);
|
||||||
|
|
||||||
extern SourceMgr SrcMgr;
|
extern SourceMgr SrcMgr;
|
||||||
|
|
||||||
|
@ -16,6 +16,8 @@
|
|||||||
#include "llvm/ADT/Twine.h"
|
#include "llvm/ADT/Twine.h"
|
||||||
#include "llvm/Support/raw_ostream.h"
|
#include "llvm/Support/raw_ostream.h"
|
||||||
|
|
||||||
|
#include <cstdlib>
|
||||||
|
|
||||||
namespace llvm {
|
namespace llvm {
|
||||||
|
|
||||||
SourceMgr SrcMgr;
|
SourceMgr SrcMgr;
|
||||||
@ -63,4 +65,14 @@ void PrintError(const TGError &Error) {
|
|||||||
PrintError(Error.getLoc(), Error.getMessage());
|
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
|
} // end namespace llvm
|
||||||
|
Reference in New Issue
Block a user