[libc-commits] [PATCH] D148794: [libc] Make UInt<T> trivially copyable

Phabricator via libc-commits libc-commits at lists.llvm.org
Thu Apr 20 09:01:40 PDT 2023


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG5db12eca1f70: [libc] Make UInt<T> trivially copyable (authored by Mikhail R. Gadelha <mikhail at igalia.com>).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D148794/new/

https://reviews.llvm.org/D148794

Files:
  libc/src/__support/UInt.h


Index: libc/src/__support/UInt.h
===================================================================
--- libc/src/__support/UInt.h
+++ libc/src/__support/UInt.h
@@ -35,12 +35,9 @@
   static constexpr uint64_t low(uint64_t v) { return v & MASK32; }
   static constexpr uint64_t high(uint64_t v) { return (v >> 32) & MASK32; }
 
-  constexpr UInt() {}
+  constexpr UInt() = default;
 
-  constexpr UInt(const UInt<Bits> &other) {
-    for (size_t i = 0; i < WORDCOUNT; ++i)
-      val[i] = other.val[i];
-  }
+  constexpr UInt(const UInt<Bits> &other) = default;
 
   template <size_t OtherBits> constexpr UInt(const UInt<OtherBits> &other) {
     if (OtherBits >= Bits) {
@@ -90,11 +87,7 @@
     return uint8_t(uint64_t(*this));
   }
 
-  UInt<Bits> &operator=(const UInt<Bits> &other) {
-    for (size_t i = 0; i < WORDCOUNT; ++i)
-      val[i] = other.val[i];
-    return *this;
-  }
+  UInt<Bits> &operator=(const UInt<Bits> &other) = default;
 
   constexpr bool is_zero() const {
     for (size_t i = 0; i < WORDCOUNT; ++i) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D148794.515350.patch
Type: text/x-patch
Size: 1030 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libc-commits/attachments/20230420/aa545e4c/attachment.bin>


More information about the libc-commits mailing list