From a2304db8c017d2ce8c3e78d006b9601407cab4a6 Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Tue, 20 Apr 2021 11:21:26 +0100 Subject: [PATCH] [Support] APInt.h - remove include. NFCI. Replace std::min use which should allow us to avoid including the header in every include of APInt.h. --- include/llvm/ADT/APInt.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/include/llvm/ADT/APInt.h b/include/llvm/ADT/APInt.h index 0fca6bac43f..0cd4a0c9fc9 100644 --- a/include/llvm/ADT/APInt.h +++ b/include/llvm/ADT/APInt.h @@ -17,7 +17,6 @@ #include "llvm/Support/Compiler.h" #include "llvm/Support/MathExtras.h" -#include #include #include #include @@ -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(); }