================ @@ -2391,6 +2396,45 @@ mlir::LogicalResult CIRToLLVMTrapOpLowering::matchAndRewrite( return mlir::success(); } +static mlir::Value +getValueForVTableSymbol(mlir::Operation *op, + mlir::ConversionPatternRewriter &rewriter, + const mlir::TypeConverter *converter, + mlir::FlatSymbolRefAttr nameAttr, mlir::Type &eltType) { + auto module = op->getParentOfType<mlir::ModuleOp>(); + mlir::Operation *symbol = mlir::SymbolTable::lookupSymbolIn(module, nameAttr); + if (auto llvmSymbol = mlir::dyn_cast<mlir::LLVM::GlobalOp>(symbol)) + eltType = llvmSymbol.getType(); + else if (auto cirSymbol = mlir::dyn_cast<cir::GlobalOp>(symbol)) + eltType = converter->convertType(cirSymbol.getSymType()); ---------------- andykaylor wrote:
I'm not sure what else this would be if it isn't a `cir::GlobalOp` or `LLVM::GlobalOp`. Maybe the else should call `op.emitError()`? https://github.com/llvm/llvm-project/pull/153243 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits