From 93990d775ea4ac13c9c2614e84fc19a7a2161771 Mon Sep 17 00:00:00 2001 From: Torok Edwin Date: Tue, 14 Jul 2009 12:49:22 +0000 Subject: After converting assert(0) to LLVM_UNREACHABLE we lost file/line location. Fix by making the LLVM_UNREACHABLE pass __FILE__ and __LINE__ to llvm_unreachable. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75631 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Support/ErrorHandling.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib/Support/ErrorHandling.cpp') diff --git a/lib/Support/ErrorHandling.cpp b/lib/Support/ErrorHandling.cpp index f2e247c527..be0b3803f1 100644 --- a/lib/Support/ErrorHandling.cpp +++ b/lib/Support/ErrorHandling.cpp @@ -44,9 +44,13 @@ void llvm_report_error(const std::string &reason) { exit(1); } -void llvm_unreachable(const char *msg) { +void llvm_unreachable(const char *msg, const char *file, unsigned line) { if (msg) errs() << msg << "\n"; + errs() << "UNREACHABLE executed"; + if (file) + errs() << " at " << file << ":" << line; + errs() << "!\n"; abort(); } } -- cgit v1.2.3