summaryrefslogtreecommitdiff
path: root/lib/Support/ErrorHandling.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-07-24 07:58:10 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-07-24 07:58:10 +0000
commit82a29b6a02324e65847ed99bae84dafb2755ea32 (patch)
tree2ee8d4ed76619169df8e0b7b7ea1c1cf0eb095e6 /lib/Support/ErrorHandling.cpp
parent23ed52752bb40a9085c9d36bbc6603972c3e0080 (diff)
downloadllvm-82a29b6a02324e65847ed99bae84dafb2755ea32.tar.gz
llvm-82a29b6a02324e65847ed99bae84dafb2755ea32.tar.bz2
llvm-82a29b6a02324e65847ed99bae84dafb2755ea32.tar.xz
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
Diffstat (limited to 'lib/Support/ErrorHandling.cpp')
-rw-r--r--lib/Support/ErrorHandling.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/lib/Support/ErrorHandling.cpp b/lib/Support/ErrorHandling.cpp
index e1ee1880c6..d60dc1d2ad 100644
--- a/lib/Support/ErrorHandling.cpp
+++ b/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";