[llvm] 0e754e1 - Migrate away from C++20-deprecated POD type traits

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 25 16:15:46 PST 2023


Author: David Blaikie
Date: 2023-01-26T00:14:58Z
New Revision: 0e754e114a68a6c6be7f90f39989177cc8a5a1b7

URL: https://github.com/llvm/llvm-project/commit/0e754e114a68a6c6be7f90f39989177cc8a5a1b7
DIFF: https://github.com/llvm/llvm-project/commit/0e754e114a68a6c6be7f90f39989177cc8a5a1b7.diff

LOG: Migrate away from C++20-deprecated POD type traits

Added: 
    

Modified: 
    llvm/include/llvm/Demangle/ItaniumDemangle.h
    llvm/tools/llvm-exegesis/lib/Target.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/Demangle/ItaniumDemangle.h b/llvm/include/llvm/Demangle/ItaniumDemangle.h
index 0dd49ea91455b..374bbd196b113 100644
--- a/llvm/include/llvm/Demangle/ItaniumDemangle.h
+++ b/llvm/include/llvm/Demangle/ItaniumDemangle.h
@@ -27,18 +27,18 @@
 #include <cstring>
 #include <limits>
 #include <new>
+#include <type_traits>
 #include <utility>
 
 DEMANGLE_NAMESPACE_BEGIN
 
 template <class T, size_t N> class PODSmallVector {
-  static_assert(std::is_pod<T>::value,
-                "T is required to be a plain old data type");
+  static_assert(std::is_trivial_v<T>, "T is required to be a trivial type");
 
   T *First = nullptr;
   T *Last = nullptr;
   T *Cap = nullptr;
-  T Inline[N] = {0};
+  T Inline[N] = {};
 
   bool isInline() const { return First == Inline; }
 

diff  --git a/llvm/tools/llvm-exegesis/lib/Target.cpp b/llvm/tools/llvm-exegesis/lib/Target.cpp
index f22601546f0cf..f12444af68b55 100644
--- a/llvm/tools/llvm-exegesis/lib/Target.cpp
+++ b/llvm/tools/llvm-exegesis/lib/Target.cpp
@@ -134,7 +134,7 @@ std::unique_ptr<BenchmarkRunner> ExegesisTarget::createUopsBenchmarkRunner(
   return std::make_unique<UopsBenchmarkRunner>(State, BenchmarkPhaseSelector);
 }
 
-static_assert(std::is_pod<PfmCountersInfo>::value,
+static_assert(std::is_trivial_v<PfmCountersInfo>,
               "We shouldn't have dynamic initialization here");
 const PfmCountersInfo PfmCountersInfo::Default = {nullptr, nullptr, nullptr,
                                                   0u};


        


More information about the llvm-commits mailing list