util: Implement unreachable for MSVC using __assume

Based on the description of __assume at:

http://msdn.microsoft.com/en-us/library/1b3fsfxw.aspx

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
This commit is contained in:
Ian Romanick
2014-10-22 16:41:41 -07:00
parent 1ca88aa582
commit 6f3b8bb747

View File

@@ -69,6 +69,12 @@ do { \
assert(!str); \
__builtin_unreachable(); \
} while (0)
#elif _MSC_VER >= 1200
#define unreachable(str) \
do { \
assert(!str); \
__assume(0); \
} while (0)
#endif
#ifndef unreachable