Add constructor to ShapedTypeComponents for unranked with element type.
authorStella Laurenzo <laurenzo@google.com>
Thu, 23 Apr 2020 23:52:16 +0000 (16:52 -0700)
committerStella Laurenzo <laurenzo@google.com>
Fri, 24 Apr 2020 17:43:08 +0000 (10:43 -0700)
Subscribers: mehdi_amini, rriddle, jpienaar, shauheen, antiagainst, nicolasvasilache, arpith-jacob, mgester, lucyrfox, liufengdb, Joonsoo, grosul1, frgossen, Kayjukh, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D78774

mlir/include/mlir/Interfaces/InferTypeOpInterface.h

index 0da1125..c13f2e3 100644 (file)
@@ -38,7 +38,8 @@ class ShapedTypeComponents {
 public:
   /// Default construction is an unranked shape.
   ShapedTypeComponents() : ranked(false), elementType(nullptr), attr(nullptr){};
-
+  ShapedTypeComponents(Type elementType)
+      : ranked(false), elementType(elementType), attr(nullptr) {}
   template <typename Arg, typename = typename std::enable_if_t<
                               std::is_constructible<ShapeStorageT, Arg>::value>>
   ShapedTypeComponents(Arg &&arg, Type elementType = nullptr,