[llvm] r182671 - [Support][MathExtras] Add missing include and disable _BitScan{Forward, Reverse}64 on non x64 MSVC systems.
Michael J. Spencer
bigcheesegs at gmail.com
Fri May 24 13:51:59 PDT 2013
Author: mspencer
Date: Fri May 24 15:51:59 2013
New Revision: 182671
URL: http://llvm.org/viewvc/llvm-project?rev=182671&view=rev
Log:
[Support][MathExtras] Add missing include and disable _BitScan{Forward,Reverse}64 on non x64 MSVC systems.
Modified:
llvm/trunk/include/llvm/Support/MathExtras.h
Modified: llvm/trunk/include/llvm/Support/MathExtras.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/MathExtras.h?rev=182671&r1=182670&r2=182671&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/MathExtras.h (original)
+++ llvm/trunk/include/llvm/Support/MathExtras.h Fri May 24 15:51:59 2013
@@ -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<ui
#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<ui
#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<uin
#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<uin
#endif
}
#endif
+#endif
/// \brief Get the index of the first set bit starting from the least
/// significant bit.
More information about the llvm-commits
mailing list