================
@@ -373,8 +373,27 @@ mlir::Attribute ConstantEmitter::tryEmitPrivate(const 
APValue &value,
                              elements, typedFiller);
   }
   case APValue::Vector: {
-    cgm.errorNYI("ConstExprEmitter::tryEmitPrivate vector");
-    return {};
+    const QualType elementType =
+        destType->castAs<VectorType>()->getElementType();
+    const unsigned numElements = value.getVectorLength();
+
+    SmallVector<mlir::Attribute, 16> elements;
+    elements.reserve(numElements);
+
+    for (unsigned i = 0; i < numElements; ++i) {
+      const mlir::Attribute element =
+          tryEmitPrivateForMemory(value.getVectorElt(i), elementType);
+      if (!element)
+        return {};
----------------
AmrDeveloper wrote:

As far as I understood, yes the destructor will be called when we early return 
and will clean the vector

https://github.com/llvm/llvm-project/pull/137511
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to