diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-07-24 07:58:10 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-07-24 07:58:10 +0000 |
commit | cd51ea510af48e4a323381beb2e733968c080b45 (patch) | |
tree | 3fa7cf44bf727d04d370e6d472162c29aa020368 /llvm/lib/Support/ErrorHandling.cpp | |
parent | 95fc6ee51a520bf7e2b4bfe3cc9bc3d276a4846f (diff) | |
download | llvm-cd51ea510af48e4a323381beb2e733968c080b45.zip llvm-cd51ea510af48e4a323381beb2e733968c080b45.tar.gz llvm-cd51ea510af48e4a323381beb2e733968c080b45.tar.bz2 |
Allow llvm_report_error to accept a Twine.
llvm-svn: 76961
Diffstat (limited to 'llvm/lib/Support/ErrorHandling.cpp')
-rw-r--r-- | llvm/lib/Support/ErrorHandling.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/llvm/lib/Support/ErrorHandling.cpp b/llvm/lib/Support/ErrorHandling.cpp index e1ee188..d60dc1d 100644 --- a/llvm/lib/Support/ErrorHandling.cpp +++ b/llvm/lib/Support/ErrorHandling.cpp @@ -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"; |