summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexey Samsonov <samsonov@google.com>2012-10-09 08:42:07 +0000
committerAlexey Samsonov <samsonov@google.com>2012-10-09 08:42:07 +0000
commit45418d1ccb083cad3cb84e0b8184adfb85876fc5 (patch)
tree038cf2d6129fc007b0b57fbe751b3eddfa8d7ddc
parent444a185d855bccf806f12572d3e8a01eee7c09bf (diff)
downloadcompiler-rt-45418d1ccb083cad3cb84e0b8184adfb85876fc5.tar.gz
[Sanitizer] Add UNREACHABLE(msg) macro
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@165492 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/sanitizer_common/sanitizer_internal_defs.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/sanitizer_common/sanitizer_internal_defs.h b/lib/sanitizer_common/sanitizer_internal_defs.h
index 884fd5b7b..76f3b6917 100644
--- a/lib/sanitizer_common/sanitizer_internal_defs.h
+++ b/lib/sanitizer_common/sanitizer_internal_defs.h
@@ -130,7 +130,12 @@ void NORETURN CheckFailed(const char *file, int line, const char *cond,
#define DCHECK_GE(a, b)
#endif
-#define UNIMPLEMENTED() CHECK("unimplemented" && 0)
+#define UNREACHABLE(msg) do { \
+ CHECK(0 && msg); \
+ Die(); \
+} while(0)
+
+#define UNIMPLEMENTED() UNREACHABLE("unimplemented")
#define COMPILER_CHECK(pred) IMPL_COMPILER_ASSERT(pred, __LINE__)