[clang] [CIR] Add support for indirect calls (PR #139748)

Andy Kaylor via cfe-commits cfe-commits at lists.llvm.org
Thu May 15 11:49:34 PDT 2025


================
@@ -539,15 +573,16 @@ mlir::ParseResult cir::CallOp::parse(mlir::OpAsmParser &parser,
 }
 
 void cir::CallOp::print(mlir::OpAsmPrinter &p) {
-  printCallCommon(*this, getCalleeAttr(), p);
+  mlir::Value indirectCallee = isIndirect() ? getIndirectCall() : nullptr;
+  printCallCommon(*this, getCalleeAttr(), indirectCallee, p);
 }
 
 static LogicalResult
 verifyCallCommInSymbolUses(mlir::Operation *op,
                            SymbolTableCollection &symbolTable) {
   auto fnAttr = op->getAttrOfType<FlatSymbolRefAttr>("callee");
   if (!fnAttr)
-    return mlir::failure();
+    return mlir::success();
----------------
andykaylor wrote:

I feel like this needs a comment. This is success because we're assuming this is an indirect call, right?

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


More information about the cfe-commits mailing list