[clang] [CIR] Upstream cir.call with scalar arguments (PR #136810)
Sirui Mu via cfe-commits
cfe-commits at lists.llvm.org
Sat Apr 26 09:03:30 PDT 2025
================
@@ -1516,6 +1520,41 @@ class CIR_CallOpBase<string mnemonic, list<Trait> extra_traits = []>
!listconcat(extra_traits,
[DeclareOpInterfaceMethods<CIRCallOpInterface>,
DeclareOpInterfaceMethods<SymbolUserOpInterface>])> {
+ let extraClassDeclaration = [{
+ /// Get the argument operands to the called function.
+ mlir::OperandRange getArgOperands() {
+ return {arg_operand_begin(), arg_operand_end()};
+ }
+
+ mlir::MutableOperandRange getArgOperandsMutable() {
+ llvm_unreachable("NYI");
+ }
+
+ /// Return the callee of this operation
+ mlir::CallInterfaceCallable getCallableForCallee() {
+ return (*this)->getAttrOfType<mlir::SymbolRefAttr>("callee");
+ }
+
+ /// Set the callee for this operation.
+ void setCalleeFromCallable(::mlir::CallInterfaceCallable callee) {
+ (*this)->setAttr(getCalleeAttrName(),
+ mlir::cast<mlir::SymbolRefAttr>(callee));
+ }
+
+ ::mlir::ArrayAttr getArgAttrsAttr() { return {}; }
----------------
Lancern wrote:
Done.
https://github.com/llvm/llvm-project/pull/136810
More information about the cfe-commits
mailing list