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

Tobias Gysi llvmlistbot at llvm.org
Mon Nov 6 23:02:36 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.
----------------
gysit wrote:

If I am not completely confused, which may be the case it is still early :), then the vararg function type is printed on line 1125? The code before printing the calling convention is just accessing the type of the callee to figure out if the call is a var arg call. 

I agree that it makes sense to add a test!


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


More information about the Mlir-commits mailing list