mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-22 18:54:02 +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/MathExtras.h"
|
||||
#include <algorithm>
|
||||
#include <cassert>
|
||||
#include <climits>
|
||||
#include <cstring>
|
||||
@ -1699,8 +1698,10 @@ public:
|
||||
/// \returns BitWidth if the value is zero, otherwise returns the number of
|
||||
/// zeros from the least significant bit to the first one bit.
|
||||
unsigned countTrailingZeros() const {
|
||||
if (isSingleWord())
|
||||
return std::min(unsigned(llvm::countTrailingZeros(U.VAL)), BitWidth);
|
||||
if (isSingleWord()) {
|
||||
unsigned TrailingZeros = llvm::countTrailingZeros(U.VAL);
|
||||
return (TrailingZeros > BitWidth ? BitWidth : TrailingZeros);
|
||||
}
|
||||
return countTrailingZerosSlowCase();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user