summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorNAKAMURA Takumi <geek4civic@gmail.com>2013-01-03 03:30:22 +0000
committerNAKAMURA Takumi <geek4civic@gmail.com>2013-01-03 03:30:22 +0000
commit1eae141f195b7edd060c2c872ea3eac4ce937262 (patch)
tree5b04e84752e70803ad014d63813b68fa956d68b1 /include
parent82860f63e1678077fe665c21179b9df47fd313bb (diff)
downloadllvm-1eae141f195b7edd060c2c872ea3eac4ce937262.tar.gz
llvm-1eae141f195b7edd060c2c872ea3eac4ce937262.tar.bz2
llvm-1eae141f195b7edd060c2c872ea3eac4ce937262.tar.xz
Compiler.h: Leave LLVM_BUILTIN_UNREACHABLE undefined if it is unavailable in host compiler.
Users of LLVM_BUILTIN_UNREACHABLE should be responsible in the case when LLVM_BUILTIN_UNREACHABLE is undefined. Actually, (0, (p)) in LLVM_ASSUME_ALIGNED(p, a) caused thousands of warnings on g++-4.4. It was a motivation in this commit. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171455 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/Support/Compiler.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/include/llvm/Support/Compiler.h b/include/llvm/Support/Compiler.h
index 5ed30a4ef2..b32939eac0 100644
--- a/include/llvm/Support/Compiler.h
+++ b/include/llvm/Support/Compiler.h
@@ -225,8 +225,6 @@
# define LLVM_BUILTIN_UNREACHABLE __builtin_unreachable()
#elif defined(_MSC_VER)
# define LLVM_BUILTIN_UNREACHABLE __assume(false)
-#else
-# define LLVM_BUILTIN_UNREACHABLE 0
#endif
/// LLVM_BUILTIN_TRAP - On compilers which support it, expands to an expression
@@ -244,9 +242,11 @@
|| (__GNUC__ == 4 && __GNUC_MINOR__ >= 7))
// FIXME: Enable on clang when it supports it.
# define LLVM_ASSUME_ALIGNED(p, a) __builtin_assume_aligned(p, a)
-#else
+#elif defined(LLVM_BUILTIN_UNREACHABLE)
# define LLVM_ASSUME_ALIGNED(p, a) \
(((uintptr_t(p) % (a)) == 0) ? (p) : (LLVM_BUILTIN_UNREACHABLE, (p)))
+#else
+# define LLVM_ASSUME_ALIGNED(p, a) (p)
#endif
#endif