================
@@ -521,6 +522,20 @@ mlir::Value
CIRAttrToValue::visitCirAttr(cir::GlobalViewAttr globalAttr) {
llvm_unreachable("Expecting pointer or integer type for GlobalViewAttr");
}
+// TypeInfoAttr visitor.
+mlir::Value CIRAttrToValue::visitCirAttr(cir::TypeInfoAttr typeinfoArr) {
+ mlir::Type llvmTy = converter->convertType(typeinfoArr.getType());
+ mlir::Location loc = parentOp->getLoc();
+ mlir::Value result = rewriter.create<mlir::LLVM::UndefOp>(loc, llvmTy);
+
+ for (auto [idx, elt] : llvm::enumerate(typeinfoArr.getData())) {
+ mlir::Value init = visit(elt);
+ result = rewriter.create<mlir::LLVM::InsertValueOp>(loc, result, init,
idx);
----------------
xlauko wrote:
```suggestion
result = mlir::LLVM::InsertValueOp::create(rewriter, loc, result, init,
idx);
```
https://github.com/llvm/llvm-project/pull/159426
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits