================
@@ -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 {};
----------------
andykaylor wrote:
What happens to any elements that are already in the `elements` vector? Do they
get cleaned up and deleted properly?
https://github.com/llvm/llvm-project/pull/137511
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits