mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 03:02:36 +01:00
[Support] APInt.h - remove <algorithm> include. NFCI.
Replace std::min use which should allow us to avoid including the <algorithm> header in every include of APInt.h.
This commit is contained in:
parent
246fbb1f2f
commit
a2304db8c0
@ -17,7 +17,6 @@
|
|||||||
|
|
||||||
#include "llvm/Support/Compiler.h"
|
#include "llvm/Support/Compiler.h"
|
||||||
#include "llvm/Support/MathExtras.h"
|
#include "llvm/Support/MathExtras.h"
|
||||||
#include <algorithm>
|
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <climits>
|
#include <climits>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
@ -1699,8 +1698,10 @@ public:
|
|||||||
/// \returns BitWidth if the value is zero, otherwise returns the number of
|
/// \returns BitWidth if the value is zero, otherwise returns the number of
|
||||||
/// zeros from the least significant bit to the first one bit.
|
/// zeros from the least significant bit to the first one bit.
|
||||||
unsigned countTrailingZeros() const {
|
unsigned countTrailingZeros() const {
|
||||||
if (isSingleWord())
|
if (isSingleWord()) {
|
||||||
return std::min(unsigned(llvm::countTrailingZeros(U.VAL)), BitWidth);
|
unsigned TrailingZeros = llvm::countTrailingZeros(U.VAL);
|
||||||
|
return (TrailingZeros > BitWidth ? BitWidth : TrailingZeros);
|
||||||
|
}
|
||||||
return countTrailingZerosSlowCase();
|
return countTrailingZerosSlowCase();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user