[PATCH] D86240: [llvm] Do not delete default constructor of `llvm::ElementCount`.

Francesco Petrogalli via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 19 13:14:41 PDT 2020


fpetrogalli updated this revision to Diff 286647.
fpetrogalli added a comment.

I re-enabled the default contructor so that the code actually builds on linux.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D86240

Files:
  llvm/include/llvm/IR/Intrinsics.h
  llvm/include/llvm/Support/TypeSize.h


Index: llvm/include/llvm/Support/TypeSize.h
===================================================================
--- llvm/include/llvm/Support/TypeSize.h
+++ llvm/include/llvm/Support/TypeSize.h
@@ -35,14 +35,12 @@
   ElementCount(unsigned Min, bool Scalable) : Min(Min), Scalable(Scalable) {}
 
 public:
-  /// No default constructor. Users should use one of the `get*`
-  /// static methods below, as they should always make a conscious
-  /// choice on the type of `ElementCount` they are requesting.
-  ElementCount() = delete;
   unsigned Min;  // Minimum number of vector elements.
   bool Scalable; // If true, NumElements is a multiple of 'Min' determined
                  // at runtime rather than compile time.
 
+  ElementCount() = default;
+
   ElementCount operator*(unsigned RHS) {
     return { Min * RHS, Scalable };
   }
Index: llvm/include/llvm/IR/Intrinsics.h
===================================================================
--- llvm/include/llvm/IR/Intrinsics.h
+++ llvm/include/llvm/IR/Intrinsics.h
@@ -134,9 +134,7 @@
       unsigned Pointer_AddressSpace;
       unsigned Struct_NumElements;
       unsigned Argument_Info;
-      // There is no default constructor in `ElementCount`, so we need
-      // to explicitly initialize this field with a value.
-      ElementCount Vector_Width = ElementCount::getFixed(0);
+      ElementCount Vector_Width;
     };
 
     enum ArgKind {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D86240.286647.patch
Type: text/x-patch
Size: 1406 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200819/8bc55319/attachment.bin>


More information about the llvm-commits mailing list