diff options
-rw-r--r-- | include/llvm/Support/ErrorHandling.h | 2 | ||||
-rw-r--r-- | lib/Support/ErrorHandling.cpp | 4 |
2 files changed, 6 insertions, 0 deletions
diff --git a/include/llvm/Support/ErrorHandling.h b/include/llvm/Support/ErrorHandling.h index 6a0b6a30bb..5eca438d8b 100644 --- a/include/llvm/Support/ErrorHandling.h +++ b/include/llvm/Support/ErrorHandling.h @@ -16,6 +16,7 @@ #define LLVM_SUPPORT_ERRORHANDLING_H #include "llvm/Support/Compiler.h" +#include "llvm/ADT/StringRef.h" #include <string> namespace llvm { @@ -74,6 +75,7 @@ namespace llvm { /// does not return. LLVM_ATTRIBUTE_NORETURN void report_fatal_error(const char *reason); LLVM_ATTRIBUTE_NORETURN void report_fatal_error(const std::string &reason); + LLVM_ATTRIBUTE_NORETURN void report_fatal_error(StringRef reason); LLVM_ATTRIBUTE_NORETURN void report_fatal_error(const Twine &reason); /// This function calls abort(), and prints the optional message to stderr. diff --git a/lib/Support/ErrorHandling.cpp b/lib/Support/ErrorHandling.cpp index 839c405250..66b2c83fe7 100644 --- a/lib/Support/ErrorHandling.cpp +++ b/lib/Support/ErrorHandling.cpp @@ -58,6 +58,10 @@ void llvm::report_fatal_error(const std::string &Reason) { report_fatal_error(Twine(Reason)); } +void llvm::report_fatal_error(StringRef Reason) { + report_fatal_error(Twine(Reason)); +} + void llvm::report_fatal_error(const Twine &Reason) { if (ErrorHandler) { ErrorHandler(ErrorHandlerUserData, Reason.str()); |