mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-13 04:38:24 +00:00
Allow llvm_report_error to accept a Twine.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76961 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -12,7 +12,7 @@
|
||||
// Callbacks can be registered for these errors through this API.
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "llvm/ADT/SmallVector.h"
|
||||
#include "llvm/ADT/Twine.h"
|
||||
#include "llvm/Support/ErrorHandling.h"
|
||||
#include "llvm/Support/raw_ostream.h"
|
||||
#include "llvm/System/Threading.h"
|
||||
@ -35,16 +35,25 @@ void llvm_remove_error_handler(void) {
|
||||
ErrorHandler = 0;
|
||||
}
|
||||
|
||||
void llvm_report_error(const char *reason) {
|
||||
llvm_report_error(Twine(reason));
|
||||
}
|
||||
|
||||
void llvm_report_error(const std::string &reason) {
|
||||
llvm_report_error(Twine(reason));
|
||||
}
|
||||
|
||||
void llvm_report_error(const Twine &reason) {
|
||||
if (!ErrorHandler) {
|
||||
errs() << "LLVM ERROR: " << reason << "\n";
|
||||
} else {
|
||||
ErrorHandler(reason);
|
||||
ErrorHandler(reason.str());
|
||||
}
|
||||
exit(1);
|
||||
}
|
||||
|
||||
void llvm_unreachable_internal(const char *msg, const char *file, unsigned line) {
|
||||
void llvm_unreachable_internal(const char *msg, const char *file,
|
||||
unsigned line) {
|
||||
if (msg)
|
||||
errs() << msg << "\n";
|
||||
errs() << "UNREACHABLE executed";
|
||||
|
Reference in New Issue
Block a user