[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:36 PDT 2025


================
@@ -185,12 +193,26 @@ RValue CIRGenFunction::emitCall(const CIRGenFunctionInfo &funcInfo,
 
   assert(!cir::MissingFeatures::invokeOp());
 
-  auto directFuncOp = dyn_cast<cir::FuncOp>(calleePtr);
-  assert(!cir::MissingFeatures::opCallIndirect());
+  cir::FuncType indirectFuncTy;
+  mlir::Value indirectFuncVal;
+  cir::FuncOp directFuncOp;
+  if (auto fnOp = dyn_cast<cir::FuncOp>(calleePtr))
+    directFuncOp = fnOp;
+  else {
+    [[maybe_unused]] auto resultTypes = calleePtr->getResultTypes();
----------------
andykaylor wrote:

Don't use auto here.

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


More information about the cfe-commits mailing list