[Lldb-commits] [lldb] 2078350 - Use std::make_unsigned_t (NFC)

Kazu Hirata via lldb-commits lldb-commits at lists.llvm.org
Sun Sep 18 18:41:13 PDT 2022


Author: Kazu Hirata
Date: 2022-09-18T18:41:02-07:00
New Revision: 207835064514e968e40685bdc48b7bb0fc5c2779

URL: https://github.com/llvm/llvm-project/commit/207835064514e968e40685bdc48b7bb0fc5c2779
DIFF: https://github.com/llvm/llvm-project/commit/207835064514e968e40685bdc48b7bb0fc5c2779.diff

LOG: Use std::make_unsigned_t (NFC)

Added: 
    

Modified: 
    lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp
    llvm/include/llvm/ADT/Bitfields.h

Removed: 
    


################################################################################
diff  --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp
index 7ee15fd7af4e5..c2c01d1e46053 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp
@@ -772,7 +772,7 @@ template <typename T, typename U>
 static void fill_clamp(T &dest, U src, typename T::value_type fallback) {
   static_assert(std::is_unsigned<typename T::value_type>::value,
                 "Destination type must be unsigned.");
-  using UU = typename std::make_unsigned<U>::type;
+  using UU = std::make_unsigned_t<U>;
   constexpr auto T_max = std::numeric_limits<typename T::value_type>::max();
   dest = src >= 0 && static_cast<UU>(src) <= T_max ? src : fallback;
 }

diff  --git a/llvm/include/llvm/ADT/Bitfields.h b/llvm/include/llvm/ADT/Bitfields.h
index aaf876d896d4c..045704a470b9c 100644
--- a/llvm/include/llvm/ADT/Bitfields.h
+++ b/llvm/include/llvm/ADT/Bitfields.h
@@ -96,7 +96,7 @@ template <typename T, unsigned Bits> struct BitPatterns {
   /// undefined operations over signed types (e.g. Bitwise shift operators).
   /// Moreover same size casting from unsigned to signed is well defined but not
   /// the other way around.
-  using Unsigned = typename std::make_unsigned<T>::type;
+  using Unsigned = std::make_unsigned_t<T>;
   static_assert(sizeof(Unsigned) == sizeof(T), "Types must have same size");
 
   static constexpr unsigned TypeBits = sizeof(Unsigned) * CHAR_BIT;


        


More information about the lldb-commits mailing list