[Mlir-commits] [mlir] [MLIR] Add support for calling conventions to LLVM::CallOp and LLVM::InvokeOp (PR #71319)

Christian Ulmann llvmlistbot at llvm.org
Mon Nov 6 22:34:50 PST 2023


================
@@ -1146,6 +1202,12 @@ ParseResult CallOp::parse(OpAsmParser &parser, OperationState &result) {
   TypeAttr calleeType;
   SmallVector<OpAsmParser::UnresolvedOperand> operands;
 
+  // Default to C Calling Convention if no keyword is provided.
+  result.addAttribute(
+      getCConvAttrName(result.name),
+      CConvAttr::get(parser.getContext(), parseOptionalLLVMKeyword<CConv>(
+                                              parser, result, LLVM::CConv::C)));
+
   // Parse a function pointer for indirect calls.
----------------
Dinistro wrote:

There is a roundtrip test in `func.mlir` that seems to cover this for direct function calls. It might be a good idea to add a small test for indirect calls, though. 

https://github.com/llvm/llvm-project/pull/71319


More information about the Mlir-commits mailing list