[clang] [CIR] LLVMIR lowering for cir.call (PR #138873)
Andy Kaylor via cfe-commits
cfe-commits at lists.llvm.org
Thu May 8 13:12:57 PDT 2025
================
@@ -651,6 +651,50 @@ mlir::LogicalResult CIRToLLVMReturnOpLowering::matchAndRewrite(
return mlir::LogicalResult::success();
}
+static mlir::LogicalResult
+rewriteCallOrInvoke(mlir::Operation *op, mlir::ValueRange callOperands,
+ mlir::ConversionPatternRewriter &rewriter,
+ const mlir::TypeConverter *converter,
+ mlir::FlatSymbolRefAttr calleeAttr) {
+ llvm::SmallVector<mlir::Type, 8> llvmResults;
+ auto cirResults = op->getResultTypes();
+
+ if (converter->convertTypes(cirResults, llvmResults).failed())
+ return mlir::failure();
+
+ assert(!cir::MissingFeatures::opCallCallConv());
+ assert(!cir::MissingFeatures::opCallSideEffect());
+
+ mlir::LLVM::LLVMFunctionType llvmFnTy;
+ if (calleeAttr) { // direct call
+ auto fn =
----------------
andykaylor wrote:
```suggestion
cir::FuncOp fn =
```
I'm not sure this is the correct type. Mainly, don't use auto here.
https://github.com/llvm/llvm-project/pull/138873
More information about the cfe-commits
mailing list