summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael J. Spencer <bigcheesegs@gmail.com>2013-05-24 20:51:59 +0000
committerMichael J. Spencer <bigcheesegs@gmail.com>2013-05-24 20:51:59 +0000
commit0d9d75f2ec63d259c21648a0a580eb0cd96e7da4 (patch)
tree6a3d1083cc2bbd4c247b5451329b34f05b330558
parente67f40c514db1371971f664b490e543158bad3b9 (diff)
downloadbcm5719-llvm-0d9d75f2ec63d259c21648a0a580eb0cd96e7da4.tar.gz
bcm5719-llvm-0d9d75f2ec63d259c21648a0a580eb0cd96e7da4.zip
[Support][MathExtras] Add missing include and disable _BitScan{Forward,Reverse}64 on non x64 MSVC systems.
llvm-svn: 182671
-rw-r--r--llvm/include/llvm/Support/MathExtras.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/include/llvm/Support/MathExtras.h b/llvm/include/llvm/Support/MathExtras.h
index d77a1cb7e74..ba65fcbff2c 100644
--- a/llvm/include/llvm/Support/MathExtras.h
+++ b/llvm/include/llvm/Support/MathExtras.h
@@ -14,6 +14,7 @@
#ifndef LLVM_SUPPORT_MATHEXTRAS_H
#define LLVM_SUPPORT_MATHEXTRAS_H
+#include "llvm/Support/Compiler.h"
#include "llvm/Support/SwapByteOrder.h"
#include "llvm/Support/type_traits.h"
@@ -86,6 +87,7 @@ inline std::size_t countTrailingZeros<uint32_t>(uint32_t Val, ZeroBehavior ZB) {
#endif
}
+#if !defined(_MSC_VER) || defined(_M_X64)
template <>
inline std::size_t countTrailingZeros<uint64_t>(uint64_t Val, ZeroBehavior ZB) {
if (ZB != ZB_Undefined && Val == 0)
@@ -100,6 +102,7 @@ inline std::size_t countTrailingZeros<uint64_t>(uint64_t Val, ZeroBehavior ZB) {
#endif
}
#endif
+#endif
/// \brief Count number of 0's from the most significant bit to the least
/// stopping at the first 1.
@@ -148,6 +151,7 @@ inline std::size_t countLeadingZeros<uint32_t>(uint32_t Val, ZeroBehavior ZB) {
#endif
}
+#if !defined(_MSC_VER) || defined(_M_X64)
template <>
inline std::size_t countLeadingZeros<uint64_t>(uint64_t Val, ZeroBehavior ZB) {
if (ZB != ZB_Undefined && Val == 0)
@@ -162,6 +166,7 @@ inline std::size_t countLeadingZeros<uint64_t>(uint64_t Val, ZeroBehavior ZB) {
#endif
}
#endif
+#endif
/// \brief Get the index of the first set bit starting from the least
/// significant bit.
OpenPOWER on IntegriCloud