aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/Support/ErrorHandling.h
diff options
context:
space:
mode:
authorTorok Edwin <edwintorok@gmail.com>2009-07-14 12:49:22 +0000
committerTorok Edwin <edwintorok@gmail.com>2009-07-14 12:49:22 +0000
commit93990d775ea4ac13c9c2614e84fc19a7a2161771 (patch)
treee69669ec2326194c39d4bd84335cd70504a1e133 /include/llvm/Support/ErrorHandling.h
parent481d15a12289ec4d058b863da93794fd8be1e702 (diff)
downloadexternal_llvm-93990d775ea4ac13c9c2614e84fc19a7a2161771.zip
external_llvm-93990d775ea4ac13c9c2614e84fc19a7a2161771.tar.gz
external_llvm-93990d775ea4ac13c9c2614e84fc19a7a2161771.tar.bz2
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
Diffstat (limited to 'include/llvm/Support/ErrorHandling.h')
-rw-r--r--include/llvm/Support/ErrorHandling.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/include/llvm/Support/ErrorHandling.h b/include/llvm/Support/ErrorHandling.h
index 07faba7..c14eed9 100644
--- a/include/llvm/Support/ErrorHandling.h
+++ b/include/llvm/Support/ErrorHandling.h
@@ -49,11 +49,15 @@ namespace llvm {
/// This function calls abort(), and prints the optional message to stderr.
/// Call this instead of assert(0), so that compiler knows the path is not
/// reachable even for NDEBUG builds.
- void llvm_unreachable(const char *msg=0) NORETURN;
+ /// Use the LLVM_UNREACHABLE macro instead that adds location info.
+ void llvm_unreachable(const char *msg=0, const char *file=0,
+ unsigned line=0) NORETURN;
}
+/// Macro that calls llvm_unreachable with location info and message in
+/// debug mode. In NDEBUG mode it calls llvm_unreachable with no message.
#ifndef NDEBUG
-#define LLVM_UNREACHABLE(msg) llvm_unreachable(msg)
+#define LLVM_UNREACHABLE(msg) llvm_unreachable(msg, __FILE__, __LINE__)
#else
#define LLVM_UNREACHABLE(msg) llvm_unreachable()
#endif