[Mlir-commits] [mlir] [MLIR] Add support for calling conventions to LLVM::CallOp and LLVM::InvokeOp (PR #71319)
Mehdi Amini
llvmlistbot at llvm.org
Mon Nov 6 21:53:47 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.
----------------
joker-eph wrote:
The printer seems to print first the function type and then the CConvAttr, but the parser here seems reverse. Is there a test for this?
https://github.com/llvm/llvm-project/pull/71319
More information about the Mlir-commits
mailing list