From a53dfb3621b2f1e0b42b3fae0e6a88e7d347c9a1 Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Tue, 1 Aug 2017 04:18:34 +0000 Subject: [PATCH] [MathExtras] Remove unnecessary cast of a constant 1 in a subtract. Pretty sure this will automatically promoted to match the type of the other operand of the subtract. There's plenty of other similar code around here without this cast. llvm-svn: 309653 --- include/llvm/Support/MathExtras.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/llvm/Support/MathExtras.h b/include/llvm/Support/MathExtras.h index fd29865c847..db01e99334a 100644 --- a/include/llvm/Support/MathExtras.h +++ b/include/llvm/Support/MathExtras.h @@ -424,7 +424,7 @@ constexpr inline bool isPowerOf2_32(uint32_t Value) { /// Return true if the argument is a power of two > 0 (64 bit edition.) constexpr inline bool isPowerOf2_64(uint64_t Value) { - return Value && !(Value & (Value - int64_t(1L))); + return Value && !(Value & (Value - 1)); } /// Return a byte-swapped representation of the 16-bit argument.