From 1ab40bef8dfe416cc82455eea39d01d496752d90 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. llvm-svn: 75631 --- llvm/lib/Support/ErrorHandling.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'llvm/lib/Support/ErrorHandling.cpp') diff --git a/llvm/lib/Support/ErrorHandling.cpp b/llvm/lib/Support/ErrorHandling.cpp index f2e247c5274..be0b3803f15 100644 --- a/llvm/lib/Support/ErrorHandling.cpp +++ b/llvm/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