Skip to content

Commit

Permalink
[Support][MathExtras] Add missing include and disable _BitScan{Forwar…
Browse files Browse the repository at this point in the history
…d,Reverse}64 on non x64 MSVC systems.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182671 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
Bigcheese committed May 24, 2013
1 parent 7932798 commit a0cfb8f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions include/llvm/Support/MathExtras.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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)
Expand All @@ -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.
Expand Down Expand Up @@ -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)
Expand All @@ -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.
Expand Down

0 comments on commit a0cfb8f

Please sign in to comment.