<div dir="ltr"><div dir="ltr"><a class="gmail_plusreply gmail-cremed cremed" id="gmail-plusReplyChip-0">+</a>llvm-commits<div><br></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jan 21, 2019 at 11:25 PM Vitaly Buka <<a href="mailto:vitalybuka@google.com">vitalybuka@google.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><div dir="ltr">I've removed it and then reverted it back r351786.</div><div>This assert is not the only problem on the bot <a href="http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-android" target="_blank">http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-android</a>.</div><div>I'll try to upgrade libstdc++</div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail-m_8051598157468697820gmail_attr">On Mon, Jan 21, 2019 at 10:13 PM Vitaly Buka <<a href="mailto:vitalybuka@google.com" target="_blank">vitalybuka@google.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr">It breaks this bot.<div>I guess problem is here:</div><div>+#if (__has_feature(is_trivially_copyable) || (defined(__GNUC__) && __GNUC__ >= 5))<br>+  static_assert(value == std::is_trivially_copyable<T>::value, "inconsistent behavior between llvm:: and std:: implementation of is_trivially_copyable");<br>+#endif<br></div><div><br></div><div>compiler there is clang, so it passed __has_feature</div><div>however libstdc++ is from gcc 4.6 so is_trivially_copyable not there</div><div><br></div><div>I'll temporarily remove this assert to fix the bot</div><div><br></div></div><div class="gmail_quote"><div dir="ltr" class="gmail-m_8051598157468697820gmail-m_1768041016579344334gmail_attr">On Sun, Jan 20, 2019 at 1:20 PM Serge Guelton via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Author: serge_sans_paille<br>
Date: Sun Jan 20 13:19:56 2019<br>
New Revision: 351701<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=351701&view=rev" rel="noreferrer" class="gmail-m_8051598157468697820gmail-m_1768041016579344334cremed" target="_blank">http://llvm.org/viewvc/llvm-project?rev=351701&view=rev</a><br>
Log:<br>
Replace llvm::isPodLike<...>  by llvm::is_trivially_copyable<...><br>
<br>
As noted in <a href="https://bugs.llvm.org/show_bug.cgi?id=36651" rel="noreferrer" class="gmail-m_8051598157468697820gmail-m_1768041016579344334cremed" target="_blank">https://bugs.llvm.org/show_bug.cgi?id=36651</a>, the specialization for<br>
isPodLike<std::pair<...>> did not match the expectation of<br>
std::is_trivially_copyable which makes the memcpy optimization invalid.<br>
<br>
This patch renames the llvm::isPodLike trait into llvm::is_trivially_copyable.<br>
Unfortunately std::is_trivially_copyable is not portable across compiler / STL<br>
versions. So a portable version is provided too.<br>
<br>
Note that the following specialization were invalid:<br>
<br>
    std::pair<T0, T1><br>
    llvm::Optional<T><br>
<br>
Tests have been added to assert that former specialization are respected by the<br>
standard usage of llvm::is_trivially_copyable, and that when a decent version<br>
of std::is_trivially_copyable is available, llvm::is_trivially_copyable is<br>
compared to std::is_trivially_copyable.<br>
<br>
As of this patch, llvm::Optional is no longer considered trivially copyable,<br>
even if T is. This is to be fixed in a later patch, as it has impact on a<br>
long-running bug (see r347004)<br>
<br>
Note that GCC warns about this UB, but this got silented by <a href="https://reviews.llvm.org/D50296" rel="noreferrer" class="gmail-m_8051598157468697820gmail-m_1768041016579344334cremed" target="_blank">https://reviews.llvm.org/D50296</a>.<br>
<br>
Differential Revision: <a href="https://reviews.llvm.org/D54472" rel="noreferrer" class="gmail-m_8051598157468697820gmail-m_1768041016579344334cremed" target="_blank">https://reviews.llvm.org/D54472</a><br>
<br>
<br>
Modified:<br>
    llvm/trunk/docs/ProgrammersManual.rst<br>
    llvm/trunk/include/llvm/ADT/ArrayRef.h<br>
    llvm/trunk/include/llvm/ADT/DenseMap.h<br>
    llvm/trunk/include/llvm/ADT/ImmutableList.h<br>
    llvm/trunk/include/llvm/ADT/Optional.h<br>
    llvm/trunk/include/llvm/ADT/PointerIntPair.h<br>
    llvm/trunk/include/llvm/ADT/SmallVector.h<br>
    llvm/trunk/include/llvm/ADT/StringRef.h<br>
    llvm/trunk/include/llvm/ADT/bit.h<br>
    llvm/trunk/include/llvm/Analysis/BlockFrequencyInfoImpl.h<br>
    llvm/trunk/include/llvm/Bitcode/BitCodes.h<br>
    llvm/trunk/include/llvm/CodeGen/DIE.h<br>
    llvm/trunk/include/llvm/CodeGen/RegisterPressure.h<br>
    llvm/trunk/include/llvm/CodeGen/ScheduleDAG.h<br>
    llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h<br>
    llvm/trunk/include/llvm/CodeGen/SlotIndexes.h<br>
    llvm/trunk/include/llvm/CodeGen/TargetPassConfig.h<br>
    llvm/trunk/include/llvm/IR/CFG.h<br>
    llvm/trunk/include/llvm/IR/ValueHandle.h<br>
    llvm/trunk/include/llvm/MC/MCInst.h<br>
    llvm/trunk/include/llvm/Support/ScaledNumber.h<br>
    llvm/trunk/include/llvm/Support/type_traits.h<br>
    llvm/trunk/lib/Transforms/Scalar/SROA.cpp<br>
    llvm/trunk/tools/llvm-diff/DifferenceEngine.cpp<br>
    llvm/trunk/unittests/ADT/ArrayRefTest.cpp<br>
    llvm/trunk/unittests/ADT/ImmutableListTest.cpp<br>
    llvm/trunk/unittests/ADT/PointerIntPairTest.cpp<br>
    llvm/trunk/unittests/ADT/StringRefTest.cpp<br>
    llvm/trunk/unittests/Analysis/BlockFrequencyInfoTest.cpp<br>
    llvm/trunk/unittests/Bitcode/BitstreamReaderTest.cpp<br>
    llvm/trunk/unittests/CodeGen/CMakeLists.txt<br>
    llvm/trunk/unittests/CodeGen/MachineInstrTest.cpp<br>
    llvm/trunk/unittests/IR/CFGBuilder.cpp<br>
    llvm/trunk/unittests/Support/ScaledNumberTest.cpp<br>
<br>
Modified: llvm/trunk/docs/ProgrammersManual.rst<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/ProgrammersManual.rst?rev=351701&r1=351700&r2=351701&view=diff" rel="noreferrer" class="gmail-m_8051598157468697820gmail-m_1768041016579344334cremed" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/ProgrammersManual.rst?rev=351701&r1=351700&r2=351701&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/docs/ProgrammersManual.rst (original)<br>
+++ llvm/trunk/docs/ProgrammersManual.rst Sun Jan 20 13:19:56 2019<br>
@@ -1456,7 +1456,7 @@ SmallVector has grown a few other minor<br>
 #. std::vector is exception-safe, and some implementations have pessimizations<br>
    that copy elements when SmallVector would move them.<br>
<br>
-#. SmallVector understands ``isPodLike<Type>`` and uses realloc aggressively.<br>
+#. SmallVector understands ``llvm::is_trivially_copyable<Type>`` and uses realloc aggressively.<br>
<br>
 #. Many LLVM APIs take a SmallVectorImpl as an out parameter (see the note<br>
    below).<br>
<br>
Modified: llvm/trunk/include/llvm/ADT/ArrayRef.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/ArrayRef.h?rev=351701&r1=351700&r2=351701&view=diff" rel="noreferrer" class="gmail-m_8051598157468697820gmail-m_1768041016579344334cremed" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/ArrayRef.h?rev=351701&r1=351700&r2=351701&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/ADT/ArrayRef.h (original)<br>
+++ llvm/trunk/include/llvm/ADT/ArrayRef.h Sun Jan 20 13:19:56 2019<br>
@@ -525,12 +525,6 @@ namespace llvm {<br>
<br>
   /// @}<br>
<br>
-  // ArrayRefs can be treated like a POD type.<br>
-  template <typename T> struct isPodLike;<br>
-  template <typename T> struct isPodLike<ArrayRef<T>> {<br>
-    static const bool value = true;<br>
-  };<br>
-<br>
   template <typename T> hash_code hash_value(ArrayRef<T> S) {<br>
     return hash_combine_range(S.begin(), S.end());<br>
   }<br>
<br>
Modified: llvm/trunk/include/llvm/ADT/DenseMap.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/DenseMap.h?rev=351701&r1=351700&r2=351701&view=diff" rel="noreferrer" class="gmail-m_8051598157468697820gmail-m_1768041016579344334cremed" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/DenseMap.h?rev=351701&r1=351700&r2=351701&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/ADT/DenseMap.h (original)<br>
+++ llvm/trunk/include/llvm/ADT/DenseMap.h Sun Jan 20 13:19:56 2019<br>
@@ -145,7 +145,8 @@ public:<br>
     }<br>
<br>
     const KeyT EmptyKey = getEmptyKey(), TombstoneKey = getTombstoneKey();<br>
-    if (isPodLike<KeyT>::value && isPodLike<ValueT>::value) {<br>
+    if (is_trivially_copyable<KeyT>::value &&<br>
+        is_trivially_copyable<ValueT>::value) {<br>
       // Use a simpler loop when these are trivial types.<br>
       for (BucketT *P = getBuckets(), *E = getBucketsEnd(); P != E; ++P)<br>
         P->getFirst() = EmptyKey;<br>
@@ -421,7 +422,8 @@ protected:<br>
     setNumEntries(other.getNumEntries());<br>
     setNumTombstones(other.getNumTombstones());<br>
<br>
-    if (isPodLike<KeyT>::value && isPodLike<ValueT>::value)<br>
+    if (is_trivially_copyable<KeyT>::value &&<br>
+        is_trivially_copyable<ValueT>::value)<br>
       memcpy(reinterpret_cast<void *>(getBuckets()), other.getBuckets(),<br>
              getNumBuckets() * sizeof(BucketT));<br>
     else<br>
<br>
Modified: llvm/trunk/include/llvm/ADT/ImmutableList.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/ImmutableList.h?rev=351701&r1=351700&r2=351701&view=diff" rel="noreferrer" class="gmail-m_8051598157468697820gmail-m_1768041016579344334cremed" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/ImmutableList.h?rev=351701&r1=351700&r2=351701&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/ADT/ImmutableList.h (original)<br>
+++ llvm/trunk/include/llvm/ADT/ImmutableList.h Sun Jan 20 13:19:56 2019<br>
@@ -241,10 +241,6 @@ template<typename T> struct DenseMapInfo<br>
   }<br>
 };<br>
<br>
-template <typename T> struct isPodLike;<br>
-template <typename T><br>
-struct isPodLike<ImmutableList<T>> { static const bool value = true; };<br>
-<br>
 } // end namespace llvm<br>
<br>
 #endif // LLVM_ADT_IMMUTABLELIST_H<br>
<br>
Modified: llvm/trunk/include/llvm/ADT/Optional.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/Optional.h?rev=351701&r1=351700&r2=351701&view=diff" rel="noreferrer" class="gmail-m_8051598157468697820gmail-m_1768041016579344334cremed" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/Optional.h?rev=351701&r1=351700&r2=351701&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/ADT/Optional.h (original)<br>
+++ llvm/trunk/include/llvm/ADT/Optional.h Sun Jan 20 13:19:56 2019<br>
@@ -30,7 +30,7 @@ class raw_ostream;<br>
<br>
 namespace optional_detail {<br>
 /// Storage for any type.<br>
-template <typename T, bool = isPodLike<T>::value> struct OptionalStorage {<br>
+template <typename T, bool = is_trivially_copyable<T>::value> struct OptionalStorage {<br>
   AlignedCharArrayUnion<T> storage;<br>
   bool hasVal = false;<br>
<br>
@@ -185,11 +185,6 @@ public:<br>
 #endif<br>
 };<br>
<br>
-template <typename T> struct isPodLike<Optional<T>> {<br>
-  // An Optional<T> is pod-like if T is.<br>
-  static const bool value = isPodLike<T>::value;<br>
-};<br>
-<br>
 template <typename T, typename U><br>
 bool operator==(const Optional<T> &X, const Optional<U> &Y) {<br>
   if (X && Y)<br>
<br>
Modified: llvm/trunk/include/llvm/ADT/PointerIntPair.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/PointerIntPair.h?rev=351701&r1=351700&r2=351701&view=diff" rel="noreferrer" class="gmail-m_8051598157468697820gmail-m_1768041016579344334cremed" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/PointerIntPair.h?rev=351701&r1=351700&r2=351701&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/ADT/PointerIntPair.h (original)<br>
+++ llvm/trunk/include/llvm/ADT/PointerIntPair.h Sun Jan 20 13:19:56 2019<br>
@@ -175,12 +175,6 @@ struct PointerIntPairInfo {<br>
   }<br>
 };<br>
<br>
-template <typename T> struct isPodLike;<br>
-template <typename PointerTy, unsigned IntBits, typename IntType><br>
-struct isPodLike<PointerIntPair<PointerTy, IntBits, IntType>> {<br>
-  static const bool value = true;<br>
-};<br>
-<br>
 // Provide specialization of DenseMapInfo for PointerIntPair.<br>
 template <typename PointerTy, unsigned IntBits, typename IntType><br>
 struct DenseMapInfo<PointerIntPair<PointerTy, IntBits, IntType>> {<br>
<br>
Modified: llvm/trunk/include/llvm/ADT/SmallVector.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/SmallVector.h?rev=351701&r1=351700&r2=351701&view=diff" rel="noreferrer" class="gmail-m_8051598157468697820gmail-m_1768041016579344334cremed" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/SmallVector.h?rev=351701&r1=351700&r2=351701&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/ADT/SmallVector.h (original)<br>
+++ llvm/trunk/include/llvm/ADT/SmallVector.h Sun Jan 20 13:19:56 2019<br>
@@ -179,9 +179,9 @@ public:<br>
   }<br>
 };<br>
<br>
-/// SmallVectorTemplateBase<isPodLike = false> - This is where we put method<br>
+/// SmallVectorTemplateBase<TriviallyCopyable = false> - This is where we put method<br>
 /// implementations that are designed to work with non-POD-like T's.<br>
-template <typename T, bool = isPodLike<T>::value><br>
+template <typename T, bool = is_trivially_copyable<T>::value><br>
 class SmallVectorTemplateBase : public SmallVectorTemplateCommon<T> {<br>
 protected:<br>
   SmallVectorTemplateBase(size_t Size) : SmallVectorTemplateCommon<T>(Size) {}<br>
@@ -235,8 +235,8 @@ public:<br>
 };<br>
<br>
 // Define this out-of-line to dissuade the C++ compiler from inlining it.<br>
-template <typename T, bool isPodLike><br>
-void SmallVectorTemplateBase<T, isPodLike>::grow(size_t MinSize) {<br>
+template <typename T, bool TriviallyCopyable><br>
+void SmallVectorTemplateBase<T, TriviallyCopyable>::grow(size_t MinSize) {<br>
   if (MinSize > UINT32_MAX)<br>
     report_bad_alloc_error("SmallVector capacity overflow during allocation");<br>
<br>
@@ -259,9 +259,8 @@ void SmallVectorTemplateBase<T, isPodLik<br>
   this->Capacity = NewCapacity;<br>
 }<br>
<br>
-<br>
-/// SmallVectorTemplateBase<isPodLike = true> - This is where we put method<br>
-/// implementations that are designed to work with POD-like T's.<br>
+/// SmallVectorTemplateBase<TriviallyCopyable = true> - This is where we put<br>
+/// method implementations that are designed to work with POD-like T's.<br>
 template <typename T><br>
 class SmallVectorTemplateBase<T, true> : public SmallVectorTemplateCommon<T> {<br>
 protected:<br>
@@ -330,7 +329,7 @@ public:<br>
 protected:<br>
   // Default ctor - Initialize to empty.<br>
   explicit SmallVectorImpl(unsigned N)<br>
-      : SmallVectorTemplateBase<T, isPodLike<T>::value>(N) {}<br>
+      : SmallVectorTemplateBase<T>(N) {}<br>
<br>
 public:<br>
   SmallVectorImpl(const SmallVectorImpl &) = delete;<br>
<br>
Modified: llvm/trunk/include/llvm/ADT/StringRef.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/StringRef.h?rev=351701&r1=351700&r2=351701&view=diff" rel="noreferrer" class="gmail-m_8051598157468697820gmail-m_1768041016579344334cremed" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/StringRef.h?rev=351701&r1=351700&r2=351701&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/ADT/StringRef.h (original)<br>
+++ llvm/trunk/include/llvm/ADT/StringRef.h Sun Jan 20 13:19:56 2019<br>
@@ -927,10 +927,6 @@ namespace llvm {<br>
   LLVM_NODISCARD<br>
   hash_code hash_value(StringRef S);<br>
<br>
-  // StringRefs can be treated like a POD type.<br>
-  template <typename T> struct isPodLike;<br>
-  template <> struct isPodLike<StringRef> { static const bool value = true; };<br>
-<br>
 } // end namespace llvm<br>
<br>
 #endif // LLVM_ADT_STRINGREF_H<br>
<br>
Modified: llvm/trunk/include/llvm/ADT/bit.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/bit.h?rev=351701&r1=351700&r2=351701&view=diff" rel="noreferrer" class="gmail-m_8051598157468697820gmail-m_1768041016579344334cremed" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/bit.h?rev=351701&r1=351700&r2=351701&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/ADT/bit.h (original)<br>
+++ llvm/trunk/include/llvm/ADT/bit.h Sun Jan 20 13:19:56 2019<br>
@@ -40,11 +40,11 @@ template <typename To, typename From<br>
           , typename = typename std::enable_if<__is_trivially_copyable(To)>::type<br>
           , typename = typename std::enable_if<__is_trivially_copyable(From)>::type<br>
 #else<br>
-  // This case is GCC 4.x. clang with libc++ or libstdc++ never get here. Unlike<br>
-  // llvm/Support/type_traits.h's isPodLike we don't want to provide a<br>
-  // good-enough answer here: developers in that configuration will hit<br>
-  // compilation failures on the bots instead of locally. That's acceptable<br>
-  // because it's very few developers, and only until we move past C++11.<br>
+// This case is GCC 4.x. clang with libc++ or libstdc++ never get here. Unlike<br>
+// llvm/Support/type_traits.h's is_trivially_copyable we don't want to<br>
+// provide a good-enough answer here: developers in that configuration will hit<br>
+// compilation failures on the bots instead of locally. That's acceptable<br>
+// because it's very few developers, and only until we move past C++11.<br>
 #endif<br>
 ><br>
 inline To bit_cast(const From &from) noexcept {<br>
<br>
Modified: llvm/trunk/include/llvm/Analysis/BlockFrequencyInfoImpl.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/BlockFrequencyInfoImpl.h?rev=351701&r1=351700&r2=351701&view=diff" rel="noreferrer" class="gmail-m_8051598157468697820gmail-m_1768041016579344334cremed" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/BlockFrequencyInfoImpl.h?rev=351701&r1=351700&r2=351701&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/Analysis/BlockFrequencyInfoImpl.h (original)<br>
+++ llvm/trunk/include/llvm/Analysis/BlockFrequencyInfoImpl.h Sun Jan 20 13:19:56 2019<br>
@@ -159,10 +159,6 @@ inline raw_ostream &operator<<(raw_ostre<br>
<br>
 } // end namespace bfi_detail<br>
<br>
-template <> struct isPodLike<bfi_detail::BlockMass> {<br>
-  static const bool value = true;<br>
-};<br>
-<br>
 /// Base class for BlockFrequencyInfoImpl<br>
 ///<br>
 /// BlockFrequencyInfoImplBase has supporting data structures and some<br>
@@ -186,9 +182,9 @@ public:<br>
   struct BlockNode {<br>
     using IndexType = uint32_t;<br>
<br>
-    IndexType Index = std::numeric_limits<uint32_t>::max();<br>
+    IndexType Index;<br>
<br>
-    BlockNode() = default;<br>
+    BlockNode() : Index(std::numeric_limits<uint32_t>::max()) {}<br>
     BlockNode(IndexType Index) : Index(Index) {}<br>
<br>
     bool operator==(const BlockNode &X) const { return Index == X.Index; }<br>
<br>
Modified: llvm/trunk/include/llvm/Bitcode/BitCodes.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Bitcode/BitCodes.h?rev=351701&r1=351700&r2=351701&view=diff" rel="noreferrer" class="gmail-m_8051598157468697820gmail-m_1768041016579344334cremed" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Bitcode/BitCodes.h?rev=351701&r1=351700&r2=351701&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/Bitcode/BitCodes.h (original)<br>
+++ llvm/trunk/include/llvm/Bitcode/BitCodes.h Sun Jan 20 13:19:56 2019<br>
@@ -159,8 +159,6 @@ public:<br>
<br>
 };<br>
<br>
-template <> struct isPodLike<BitCodeAbbrevOp> { static const bool value=true; };<br>
-<br>
 /// BitCodeAbbrev - This class represents an abbreviation record.  An<br>
 /// abbreviation allows a complex record that has redundancy to be stored in a<br>
 /// specialized format instead of the fully-general, fully-vbr, format.<br>
<br>
Modified: llvm/trunk/include/llvm/CodeGen/DIE.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/DIE.h?rev=351701&r1=351700&r2=351701&view=diff" rel="noreferrer" class="gmail-m_8051598157468697820gmail-m_1768041016579344334cremed" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/DIE.h?rev=351701&r1=351700&r2=351701&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/CodeGen/DIE.h (original)<br>
+++ llvm/trunk/include/llvm/CodeGen/DIE.h Sun Jan 20 13:19:56 2019<br>
@@ -799,7 +799,7 @@ class DIEUnit {<br>
   const uint16_t Version; /// The Dwarf version number for this unit.<br>
   const uint8_t AddrSize; /// The size in bytes of an address for this unit.<br>
 protected:<br>
-  ~DIEUnit() = default;<br>
+  virtual ~DIEUnit() = default;<br>
<br>
 public:<br>
   DIEUnit(uint16_t Version, uint8_t AddrSize, dwarf::Tag UnitTag);<br>
<br>
Modified: llvm/trunk/include/llvm/CodeGen/RegisterPressure.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/RegisterPressure.h?rev=351701&r1=351700&r2=351701&view=diff" rel="noreferrer" class="gmail-m_8051598157468697820gmail-m_1768041016579344334cremed" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/RegisterPressure.h?rev=351701&r1=351700&r2=351701&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/CodeGen/RegisterPressure.h (original)<br>
+++ llvm/trunk/include/llvm/CodeGen/RegisterPressure.h Sun Jan 20 13:19:56 2019<br>
@@ -131,10 +131,6 @@ public:<br>
   }<br>
 };<br>
<br>
-template <> struct isPodLike<PressureChange> {<br>
-   static const bool value = true;<br>
-};<br>
-<br>
 /// List of PressureChanges in order of increasing, unique PSetID.<br>
 ///<br>
 /// Use a small fixed number, because we can fit more PressureChanges in an<br>
<br>
Modified: llvm/trunk/include/llvm/CodeGen/ScheduleDAG.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/ScheduleDAG.h?rev=351701&r1=351700&r2=351701&view=diff" rel="noreferrer" class="gmail-m_8051598157468697820gmail-m_1768041016579344334cremed" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/ScheduleDAG.h?rev=351701&r1=351700&r2=351701&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/CodeGen/ScheduleDAG.h (original)<br>
+++ llvm/trunk/include/llvm/CodeGen/ScheduleDAG.h Sun Jan 20 13:19:56 2019<br>
@@ -238,9 +238,6 @@ class TargetRegisterInfo;<br>
     void dump(const TargetRegisterInfo *TRI = nullptr) const;<br>
   };<br>
<br>
-  template <><br>
-  struct isPodLike<SDep> { static const bool value = true; };<br>
-<br>
   /// Scheduling unit. This is a node in the scheduling DAG.<br>
   class SUnit {<br>
   private:<br>
<br>
Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h?rev=351701&r1=351700&r2=351701&view=diff" rel="noreferrer" class="gmail-m_8051598157468697820gmail-m_1768041016579344334cremed" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h?rev=351701&r1=351700&r2=351701&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h (original)<br>
+++ llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h Sun Jan 20 13:19:56 2019<br>
@@ -231,7 +231,6 @@ template<> struct DenseMapInfo<SDValue><br>
     return LHS == RHS;<br>
   }<br>
 };<br>
-template <> struct isPodLike<SDValue> { static const bool value = true; };<br>
<br>
 /// Allow casting operators to work directly on<br>
 /// SDValues as if they were SDNode*'s.<br>
<br>
Modified: llvm/trunk/include/llvm/CodeGen/SlotIndexes.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SlotIndexes.h?rev=351701&r1=351700&r2=351701&view=diff" rel="noreferrer" class="gmail-m_8051598157468697820gmail-m_1768041016579344334cremed" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SlotIndexes.h?rev=351701&r1=351700&r2=351701&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/CodeGen/SlotIndexes.h (original)<br>
+++ llvm/trunk/include/llvm/CodeGen/SlotIndexes.h Sun Jan 20 13:19:56 2019<br>
@@ -301,8 +301,6 @@ class raw_ostream;<br>
     }<br>
   };<br>
<br>
-  template <> struct isPodLike<SlotIndex> { static const bool value = true; };<br>
-<br>
   inline raw_ostream& operator<<(raw_ostream &os, SlotIndex li) {<br>
     li.print(os);<br>
     return os;<br>
<br>
Modified: llvm/trunk/include/llvm/CodeGen/TargetPassConfig.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/TargetPassConfig.h?rev=351701&r1=351700&r2=351701&view=diff" rel="noreferrer" class="gmail-m_8051598157468697820gmail-m_1768041016579344334cremed" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/TargetPassConfig.h?rev=351701&r1=351700&r2=351701&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/CodeGen/TargetPassConfig.h (original)<br>
+++ llvm/trunk/include/llvm/CodeGen/TargetPassConfig.h Sun Jan 20 13:19:56 2019<br>
@@ -74,9 +74,6 @@ public:<br>
   }<br>
 };<br>
<br>
-template <> struct isPodLike<IdentifyingPassPtr> {<br>
-  static const bool value = true;<br>
-};<br>
<br>
 /// Target-Independent Code Generator Pass Configuration Options.<br>
 ///<br>
<br>
Modified: llvm/trunk/include/llvm/IR/CFG.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/CFG.h?rev=351701&r1=351700&r2=351701&view=diff" rel="noreferrer" class="gmail-m_8051598157468697820gmail-m_1768041016579344334cremed" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/CFG.h?rev=351701&r1=351700&r2=351701&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/IR/CFG.h (original)<br>
+++ llvm/trunk/include/llvm/IR/CFG.h Sun Jan 20 13:19:56 2019<br>
@@ -237,10 +237,6 @@ public:<br>
   }<br>
 };<br>
<br>
-template <typename T, typename U> struct isPodLike<SuccIterator<T, U>> {<br>
-  static const bool value = isPodLike<T>::value;<br>
-};<br>
-<br>
 using succ_iterator = SuccIterator<Instruction, BasicBlock>;<br>
 using succ_const_iterator = SuccIterator<const Instruction, const BasicBlock>;<br>
 using succ_range = iterator_range<succ_iterator>;<br>
<br>
Modified: llvm/trunk/include/llvm/IR/ValueHandle.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/ValueHandle.h?rev=351701&r1=351700&r2=351701&view=diff" rel="noreferrer" class="gmail-m_8051598157468697820gmail-m_1768041016579344334cremed" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/ValueHandle.h?rev=351701&r1=351700&r2=351701&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/IR/ValueHandle.h (original)<br>
+++ llvm/trunk/include/llvm/IR/ValueHandle.h Sun Jan 20 13:19:56 2019<br>
@@ -308,15 +308,6 @@ struct DenseMapInfo<AssertingVH<T>> {<br>
   }<br>
 };<br>
<br>
-template <typename T><br>
-struct isPodLike<AssertingVH<T>> {<br>
-#ifdef NDEBUG<br>
-  static const bool value = true;<br>
-#else<br>
-  static const bool value = false;<br>
-#endif<br>
-};<br>
-<br>
 /// Value handle that tracks a Value across RAUW.<br>
 ///<br>
 /// TrackingVH is designed for situations where a client needs to hold a handle<br>
@@ -548,14 +539,6 @@ template <typename T> struct DenseMapInf<br>
   }<br>
 };<br>
<br>
-template <typename T> struct isPodLike<PoisoningVH<T>> {<br>
-#ifdef NDEBUG<br>
-  static const bool value = true;<br>
-#else<br>
-  static const bool value = false;<br>
-#endif<br>
-};<br>
-<br>
 } // end namespace llvm<br>
<br>
 #endif // LLVM_IR_VALUEHANDLE_H<br>
<br>
Modified: llvm/trunk/include/llvm/MC/MCInst.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCInst.h?rev=351701&r1=351700&r2=351701&view=diff" rel="noreferrer" class="gmail-m_8051598157468697820gmail-m_1768041016579344334cremed" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCInst.h?rev=351701&r1=351700&r2=351701&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/MC/MCInst.h (original)<br>
+++ llvm/trunk/include/llvm/MC/MCInst.h Sun Jan 20 13:19:56 2019<br>
@@ -153,8 +153,6 @@ public:<br>
   bool evaluateAsConstantImm(int64_t &Imm) const;<br>
 };<br>
<br>
-template <> struct isPodLike<MCOperand> { static const bool value = true; };<br>
-<br>
 /// Instances of this class represent a single low-level machine<br>
 /// instruction.<br>
 class MCInst {<br>
<br>
Modified: llvm/trunk/include/llvm/Support/ScaledNumber.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/ScaledNumber.h?rev=351701&r1=351700&r2=351701&view=diff" rel="noreferrer" class="gmail-m_8051598157468697820gmail-m_1768041016579344334cremed" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/ScaledNumber.h?rev=351701&r1=351700&r2=351701&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/Support/ScaledNumber.h (original)<br>
+++ llvm/trunk/include/llvm/Support/ScaledNumber.h Sun Jan 20 13:19:56 2019<br>
@@ -886,10 +886,6 @@ template <class DigitsT> void ScaledNumb<br>
   Digits >>= Shift;<br>
 }<br>
<br>
-template <typename T> struct isPodLike;<br>
-template <typename T> struct isPodLike<ScaledNumber<T>> {<br>
-  static const bool value = true;<br>
-};<br>
<br>
 } // end namespace llvm<br>
<br>
<br>
Modified: llvm/trunk/include/llvm/Support/type_traits.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/type_traits.h?rev=351701&r1=351700&r2=351701&view=diff" rel="noreferrer" class="gmail-m_8051598157468697820gmail-m_1768041016579344334cremed" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/type_traits.h?rev=351701&r1=351700&r2=351701&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/Support/type_traits.h (original)<br>
+++ llvm/trunk/include/llvm/Support/type_traits.h Sun Jan 20 13:19:56 2019<br>
@@ -24,35 +24,6 @@<br>
<br>
 namespace llvm {<br>
<br>
-/// isPodLike - This is a type trait that is used to determine whether a given<br>
-/// type can be copied around with memcpy instead of running ctors etc.<br>
-template <typename T><br>
-struct isPodLike {<br>
-  // std::is_trivially_copyable is available in libc++ with clang, libstdc++<br>
-  // that comes with GCC 5.  MSVC 2015 and newer also have<br>
-  // std::is_trivially_copyable.<br>
-#if (__has_feature(is_trivially_copyable) && defined(_LIBCPP_VERSION)) ||      \<br>
-    (defined(__GNUC__) && __GNUC__ >= 5) || defined(_MSC_VER)<br>
-  // If the compiler supports the is_trivially_copyable trait use it, as it<br>
-  // matches the definition of isPodLike closely.<br>
-  static const bool value = std::is_trivially_copyable<T>::value;<br>
-#elif __has_feature(is_trivially_copyable)<br>
-  // Use the internal name if the compiler supports is_trivially_copyable but we<br>
-  // don't know if the standard library does. This is the case for clang in<br>
-  // conjunction with libstdc++ from GCC 4.x.<br>
-  static const bool value = __is_trivially_copyable(T);<br>
-#else<br>
-  // If we don't know anything else, we can (at least) assume that all non-class<br>
-  // types are PODs.<br>
-  static const bool value = !std::is_class<T>::value;<br>
-#endif<br>
-};<br>
-<br>
-// std::pair's are pod-like if their elements are.<br>
-template<typename T, typename U><br>
-struct isPodLike<std::pair<T, U>> {<br>
-  static const bool value = isPodLike<T>::value && isPodLike<U>::value;<br>
-};<br>
<br>
 /// Metafunction that determines whether the given type is either an<br>
 /// integral type or an enumeration type, including enum classes.<br>
@@ -119,6 +90,11 @@ template<typename T> union move_construc<br>
     move_construction_triviality_helper(move_construction_triviality_helper&&) = default;<br>
     ~move_construction_triviality_helper() = default;<br>
 };<br>
+<br>
+template<class T><br>
+union trivial_helper {<br>
+    T t;<br>
+};<br>
 } // end namespace detail<br>
<br>
 /// An implementation of `std::is_trivially_copy_constructible` since we have<br>
@@ -143,6 +119,56 @@ struct is_trivially_move_constructible<T<br>
 template <typename T><br>
 struct is_trivially_move_constructible<T &&> : std::true_type {};<br>
<br>
+// An implementation of `std::is_trivially_copyable` since STL version<br>
+// is not equally supported by all compilers, especially GCC 4.9.<br>
+// Uniform implementation of this trait is important for ABI compatibility<br>
+// as it has an impact on SmallVector's ABI (among others).<br>
+template <typename T><br>
+class is_trivially_copyable {<br>
+<br>
+  // copy constructors<br>
+  static constexpr bool has_trivial_copy_constructor =<br>
+      std::is_copy_constructible<detail::trivial_helper<T>>::value;<br>
+  static constexpr bool has_deleted_copy_constructor =<br>
+      !std::is_copy_constructible<T>::value;<br>
+<br>
+  // move constructors<br>
+  static constexpr bool has_trivial_move_constructor =<br>
+      std::is_move_constructible<detail::trivial_helper<T>>::value;<br>
+  static constexpr bool has_deleted_move_constructor =<br>
+      !std::is_move_constructible<T>::value;<br>
+<br>
+  // copy assign<br>
+  static constexpr bool has_trivial_copy_assign =<br>
+      std::is_copy_assignable<detail::trivial_helper<T>>::value;<br>
+  static constexpr bool has_deleted_copy_assign =<br>
+      !std::is_copy_assignable<T>::value;<br>
+<br>
+  // move assign<br>
+  static constexpr bool has_trivial_move_assign =<br>
+      std::is_move_assignable<detail::trivial_helper<T>>::value;<br>
+  static constexpr bool has_deleted_move_assign =<br>
+      !std::is_move_assignable<T>::value;<br>
+<br>
+  // destructor<br>
+  static constexpr bool has_trivial_destructor =<br>
+      std::is_destructible<detail::trivial_helper<T>>::value;<br>
+<br>
+  public:<br>
+<br>
+  static constexpr bool value =<br>
+      has_trivial_destructor &&<br>
+      (has_deleted_move_assign || has_trivial_move_assign) &&<br>
+      (has_deleted_move_constructor || has_trivial_move_constructor) &&<br>
+      (has_deleted_copy_assign || has_trivial_copy_assign) &&<br>
+      (has_deleted_copy_constructor || has_trivial_copy_constructor);<br>
+<br>
+#if (__has_feature(is_trivially_copyable) || (defined(__GNUC__) && __GNUC__ >= 5))<br>
+  static_assert(value == std::is_trivially_copyable<T>::value, "inconsistent behavior between llvm:: and std:: implementation of is_trivially_copyable");<br>
+#endif<br>
+};<br>
+<br>
+<br>
 } // end namespace llvm<br>
<br>
 // If the compiler supports detecting whether a class is final, define<br>
<br>
Modified: llvm/trunk/lib/Transforms/Scalar/SROA.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/SROA.cpp?rev=351701&r1=351700&r2=351701&view=diff" rel="noreferrer" class="gmail-m_8051598157468697820gmail-m_1768041016579344334cremed" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/SROA.cpp?rev=351701&r1=351700&r2=351701&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Transforms/Scalar/SROA.cpp (original)<br>
+++ llvm/trunk/lib/Transforms/Scalar/SROA.cpp Sun Jan 20 13:19:56 2019<br>
@@ -221,13 +221,6 @@ public:<br>
<br>
 } // end anonymous namespace<br>
<br>
-namespace llvm {<br>
-<br>
-template <typename T> struct isPodLike;<br>
-template <> struct isPodLike<Slice> { static const bool value = true; };<br>
-<br>
-} // end namespace llvm<br>
-<br>
 /// Representation of the alloca slices.<br>
 ///<br>
 /// This class represents the slices of an alloca which are formed by its<br>
<br>
Modified: llvm/trunk/tools/llvm-diff/DifferenceEngine.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-diff/DifferenceEngine.cpp?rev=351701&r1=351700&r2=351701&view=diff" rel="noreferrer" class="gmail-m_8051598157468697820gmail-m_1768041016579344334cremed" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-diff/DifferenceEngine.cpp?rev=351701&r1=351700&r2=351701&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/tools/llvm-diff/DifferenceEngine.cpp (original)<br>
+++ llvm/trunk/tools/llvm-diff/DifferenceEngine.cpp Sun Jan 20 13:19:56 2019<br>
@@ -67,7 +67,7 @@ public:<br>
     unsigned NewSize = Storage.size() - 1;<br>
     if (NewSize) {<br>
       // Move the slot at the end to the beginning.<br>
-      if (isPodLike<T>::value)<br>
+      if (is_trivially_copyable<T>::value)<br>
         Storage[0] = Storage[NewSize];<br>
       else<br>
         std::swap(Storage[0], Storage[NewSize]);<br>
<br>
Modified: llvm/trunk/unittests/ADT/ArrayRefTest.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/ADT/ArrayRefTest.cpp?rev=351701&r1=351700&r2=351701&view=diff" rel="noreferrer" class="gmail-m_8051598157468697820gmail-m_1768041016579344334cremed" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/ADT/ArrayRefTest.cpp?rev=351701&r1=351700&r2=351701&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/unittests/ADT/ArrayRefTest.cpp (original)<br>
+++ llvm/trunk/unittests/ADT/ArrayRefTest.cpp Sun Jan 20 13:19:56 2019<br>
@@ -248,4 +248,7 @@ TEST(ArrayRefTest, makeArrayRef) {<br>
   EXPECT_TRUE(AR2.equals(AR2Ref));<br>
 }<br>
<br>
+static_assert(is_trivially_copyable<ArrayRef<int>>::value,<br>
+              "trivially copyable");<br>
+<br>
 } // end anonymous namespace<br>
<br>
Modified: llvm/trunk/unittests/ADT/ImmutableListTest.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/ADT/ImmutableListTest.cpp?rev=351701&r1=351700&r2=351701&view=diff" rel="noreferrer" class="gmail-m_8051598157468697820gmail-m_1768041016579344334cremed" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/ADT/ImmutableListTest.cpp?rev=351701&r1=351700&r2=351701&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/unittests/ADT/ImmutableListTest.cpp (original)<br>
+++ llvm/trunk/unittests/ADT/ImmutableListTest.cpp Sun Jan 20 13:19:56 2019<br>
@@ -267,4 +267,7 @@ TEST_F(ImmutableListTest, LongListOrderi<br>
   ASSERT_EQ(6, i);<br>
 }<br>
<br>
+static_assert(is_trivially_copyable<ImmutableList<Wrapper<long>>>::value,<br>
+              "trivially copyable");<br>
+<br>
 } // namespace<br>
<br>
Modified: llvm/trunk/unittests/ADT/PointerIntPairTest.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/ADT/PointerIntPairTest.cpp?rev=351701&r1=351700&r2=351701&view=diff" rel="noreferrer" class="gmail-m_8051598157468697820gmail-m_1768041016579344334cremed" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/ADT/PointerIntPairTest.cpp?rev=351701&r1=351700&r2=351701&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/unittests/ADT/PointerIntPairTest.cpp (original)<br>
+++ llvm/trunk/unittests/ADT/PointerIntPairTest.cpp Sun Jan 20 13:19:56 2019<br>
@@ -61,6 +61,9 @@ TEST(PointerIntPairTest, GetSet) {<br>
   Pair2.setPointerAndInt(&s, E::Case3);<br>
   EXPECT_EQ(&s, Pair2.getPointer());<br>
   EXPECT_EQ(E::Case3, Pair2.getInt());<br>
+<br>
+  static_assert(is_trivially_copyable<PointerIntPair<S *, 2, E>>::value,<br>
+                "trivially copyable");<br>
 }<br>
<br>
 TEST(PointerIntPairTest, DefaultInitialize) {<br>
@@ -96,6 +99,11 @@ TEST(PointerIntPairTest, ManyUnusedBits)<br>
<br>
   EXPECT_EQ(FixnumPointerTraits::NumLowBitsAvailable - 1,<br>
             PointerLikeTypeTraits<decltype(pair)>::NumLowBitsAvailable);<br>
+<br>
+  static_assert(<br>
+      is_trivially_copyable<<br>
+          PointerIntPair<Fixnum31, 1, bool, FixnumPointerTraits>>::value,<br>
+      "trivially copyable");<br>
 }<br>
<br>
 } // end anonymous namespace<br>
<br>
Modified: llvm/trunk/unittests/ADT/StringRefTest.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/ADT/StringRefTest.cpp?rev=351701&r1=351700&r2=351701&view=diff" rel="noreferrer" class="gmail-m_8051598157468697820gmail-m_1768041016579344334cremed" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/ADT/StringRefTest.cpp?rev=351701&r1=351700&r2=351701&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/unittests/ADT/StringRefTest.cpp (original)<br>
+++ llvm/trunk/unittests/ADT/StringRefTest.cpp Sun Jan 20 13:19:56 2019<br>
@@ -1061,4 +1061,6 @@ TEST(StringRefTest, StringLiteral) {<br>
   EXPECT_EQ(StringRef("Bar"), Strings[1]);<br>
 }<br>
<br>
+static_assert(is_trivially_copyable<StringRef>::value, "trivially copyable");<br>
+<br>
 } // end anonymous namespace<br>
<br>
Modified: llvm/trunk/unittests/Analysis/BlockFrequencyInfoTest.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/Analysis/BlockFrequencyInfoTest.cpp?rev=351701&r1=351700&r2=351701&view=diff" rel="noreferrer" class="gmail-m_8051598157468697820gmail-m_1768041016579344334cremed" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/Analysis/BlockFrequencyInfoTest.cpp?rev=351701&r1=351700&r2=351701&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/unittests/Analysis/BlockFrequencyInfoTest.cpp (original)<br>
+++ llvm/trunk/unittests/Analysis/BlockFrequencyInfoTest.cpp Sun Jan 20 13:19:56 2019<br>
@@ -7,6 +7,7 @@<br>
 //===----------------------------------------------------------------------===//<br>
<br>
 #include "llvm/Analysis/BlockFrequencyInfo.h"<br>
+#include "llvm/Analysis/BlockFrequencyInfoImpl.h"<br>
 #include "llvm/Analysis/BranchProbabilityInfo.h"<br>
 #include "llvm/Analysis/LoopInfo.h"<br>
 #include "llvm/AsmParser/Parser.h"<br>
@@ -90,5 +91,8 @@ TEST_F(BlockFrequencyInfoTest, Basic) {<br>
   EXPECT_EQ(BFI.getBlockFreq(BB3).getFrequency(), BB3Freq);<br>
 }<br>
<br>
+static_assert(is_trivially_copyable<bfi_detail::BlockMass>::value,<br>
+              "trivially copyable");<br>
+<br>
 } // end anonymous namespace<br>
 } // end namespace llvm<br>
<br>
Modified: llvm/trunk/unittests/Bitcode/BitstreamReaderTest.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/Bitcode/BitstreamReaderTest.cpp?rev=351701&r1=351700&r2=351701&view=diff" rel="noreferrer" class="gmail-m_8051598157468697820gmail-m_1768041016579344334cremed" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/Bitcode/BitstreamReaderTest.cpp?rev=351701&r1=351700&r2=351701&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/unittests/Bitcode/BitstreamReaderTest.cpp (original)<br>
+++ llvm/trunk/unittests/Bitcode/BitstreamReaderTest.cpp Sun Jan 20 13:19:56 2019<br>
@@ -147,4 +147,7 @@ TEST(BitstreamReaderTest, shortRead) {<br>
   }<br>
 }<br>
<br>
+static_assert(is_trivially_copyable<BitCodeAbbrevOp>::value,<br>
+              "trivially copyable");<br>
+<br>
 } // end anonymous namespace<br>
<br>
Modified: llvm/trunk/unittests/CodeGen/CMakeLists.txt<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/CodeGen/CMakeLists.txt?rev=351701&r1=351700&r2=351701&view=diff" rel="noreferrer" class="gmail-m_8051598157468697820gmail-m_1768041016579344334cremed" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/CodeGen/CMakeLists.txt?rev=351701&r1=351700&r2=351701&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/unittests/CodeGen/CMakeLists.txt (original)<br>
+++ llvm/trunk/unittests/CodeGen/CMakeLists.txt Sun Jan 20 13:19:56 2019<br>
@@ -19,6 +19,7 @@ add_llvm_unittest(CodeGenTests<br>
   MachineInstrTest.cpp<br>
   MachineOperandTest.cpp<br>
   ScalableVectorMVTsTest.cpp<br>
+  TypeTraitsTest.cpp<br>
   )<br>
<br>
 add_subdirectory(GlobalISel)<br>
<br>
Modified: llvm/trunk/unittests/CodeGen/MachineInstrTest.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/CodeGen/MachineInstrTest.cpp?rev=351701&r1=351700&r2=351701&view=diff" rel="noreferrer" class="gmail-m_8051598157468697820gmail-m_1768041016579344334cremed" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/CodeGen/MachineInstrTest.cpp?rev=351701&r1=351700&r2=351701&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/unittests/CodeGen/MachineInstrTest.cpp (original)<br>
+++ llvm/trunk/unittests/CodeGen/MachineInstrTest.cpp Sun Jan 20 13:19:56 2019<br>
@@ -272,4 +272,6 @@ TEST(MachineInstrPrintingTest, DebugLocP<br>
       StringRef(OS.str()).endswith("filename:1:5"));<br>
 }<br>
<br>
+static_assert(is_trivially_copyable<MCOperand>::value, "trivially copyable");<br>
+<br>
 } // end namespace<br>
<br>
Modified: llvm/trunk/unittests/IR/CFGBuilder.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/IR/CFGBuilder.cpp?rev=351701&r1=351700&r2=351701&view=diff" rel="noreferrer" class="gmail-m_8051598157468697820gmail-m_1768041016579344334cremed" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/IR/CFGBuilder.cpp?rev=351701&r1=351700&r2=351701&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/unittests/IR/CFGBuilder.cpp (original)<br>
+++ llvm/trunk/unittests/IR/CFGBuilder.cpp Sun Jan 20 13:19:56 2019<br>
@@ -8,6 +8,7 @@<br>
<br>
 #include "CFGBuilder.h"<br>
<br>
+#include "llvm/IR/CFG.h"<br>
 #include "llvm/IR/IRBuilder.h"<br>
 #include "llvm/IR/LLVMContext.h"<br>
 #include "llvm/Support/Debug.h"<br>
@@ -265,3 +266,11 @@ TEST(CFGBuilder, Rebuild) {<br>
   EXPECT_TRUE(isa<SwitchInst>(B.getOrAddBlock("c")->getTerminator()));<br>
   EXPECT_TRUE(isa<SwitchInst>(B.getOrAddBlock("d")->getTerminator()));<br>
 }<br>
+<br>
+static_assert(is_trivially_copyable<succ_iterator>::value,<br>
+              "trivially copyable");<br>
+static_assert(is_trivially_copyable<succ_const_iterator>::value,<br>
+              "trivially copyable");<br>
+static_assert(is_trivially_copyable<succ_range>::value, "trivially copyable");<br>
+static_assert(is_trivially_copyable<succ_const_range>::value,<br>
+              "trivially copyable");<br>
<br>
Modified: llvm/trunk/unittests/Support/ScaledNumberTest.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/Support/ScaledNumberTest.cpp?rev=351701&r1=351700&r2=351701&view=diff" rel="noreferrer" class="gmail-m_8051598157468697820gmail-m_1768041016579344334cremed" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/Support/ScaledNumberTest.cpp?rev=351701&r1=351700&r2=351701&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/unittests/Support/ScaledNumberTest.cpp (original)<br>
+++ llvm/trunk/unittests/Support/ScaledNumberTest.cpp Sun Jan 20 13:19:56 2019<br>
@@ -562,4 +562,7 @@ TEST(ScaledNumberHelpersTest, toIntBug)<br>
   EXPECT_EQ(1u, (n * n).toInt<uint32_t>());<br>
 }<br>
<br>
+static_assert(is_trivially_copyable<ScaledNumber<uint32_t>>::value,<br>
+              "trivially copyable");<br>
+<br>
 } // end namespace<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org" class="gmail-m_8051598157468697820gmail-m_1768041016579344334cremed" target="_blank">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" class="gmail-m_8051598157468697820gmail-m_1768041016579344334cremed" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</blockquote></div></div>
</blockquote></div>
</blockquote></div>