From 29c6d769ca2efa6b10287a1b0e4d8149480379fc Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Wed, 19 Apr 2017 23:52:59 +0000 Subject: [PATCH] [APInt] Use ugt(uint64_t) for the compare in getLimitedValue(uint64_t) since the code is identical to it. NFC git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300796 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/ADT/APInt.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/include/llvm/ADT/APInt.h b/include/llvm/ADT/APInt.h index cdcb178c97f..e517a13af1e 100644 --- a/include/llvm/ADT/APInt.h +++ b/include/llvm/ADT/APInt.h @@ -426,8 +426,7 @@ public: /// If this value is smaller than the specified limit, return it, otherwise /// return the limit value. This causes the value to saturate to the limit. uint64_t getLimitedValue(uint64_t Limit = UINT64_MAX) const { - return (getActiveBits() > 64 || getZExtValue() > Limit) ? Limit - : getZExtValue(); + return ugt(Limit) ? Limit : getZExtValue(); } /// \brief Check if the APInt consists of a repeated bit pattern. -- 2.40.0