[llvm] 5447e5d - Fix MSVC truncation of constant value warning.
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 29 08:03:11 PDT 2020
Author: Simon Pilgrim
Date: 2020-06-29T16:03:00+01:00
New Revision: 5447e5d973bfccb5a32d3ca9cb0105340f178b85
URL: https://github.com/llvm/llvm-project/commit/5447e5d973bfccb5a32d3ca9cb0105340f178b85
DIFF: https://github.com/llvm/llvm-project/commit/5447e5d973bfccb5a32d3ca9cb0105340f178b85.diff
LOG: Fix MSVC truncation of constant value warning.
Added:
Modified:
llvm/include/llvm/ADT/Bitfields.h
Removed:
################################################################################
diff --git a/llvm/include/llvm/ADT/Bitfields.h b/llvm/include/llvm/ADT/Bitfields.h
index 7278ec6a07d9..2e38cca673ea 100644
--- a/llvm/include/llvm/ADT/Bitfields.h
+++ b/llvm/include/llvm/ADT/Bitfields.h
@@ -110,7 +110,7 @@ template <typename T, unsigned Bits> struct BitPatterns {
static constexpr Unsigned SignBitMask = Unsigned(1) << (Bits - 1); // 00100000
static constexpr Unsigned Smax = Umax >> 1U; // 00011111
static constexpr Unsigned Smin = ~Smax; // 11100000
- static constexpr Unsigned SignExtend = Smin << 1U; // 11000000
+ static constexpr Unsigned SignExtend = Unsigned(Smin << 1U); // 11000000
};
/// `Compressor` is used to manipulate the bits of a (possibly signed) integer
More information about the llvm-commits
mailing list