[clang] [CIR] Upstream support for calling through method pointers (PR #176063)

Henrich Lauko via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 15 01:51:19 PST 2026


================
@@ -710,6 +710,36 @@ class CIRBaseBuilderTy : public mlir::OpBuilder {
   cir::YieldOp createYield(mlir::Location loc, mlir::ValueRange value = {}) {
     return cir::YieldOp::create(*this, loc, value);
   }
+
+  struct GetMethodResults {
+    mlir::Value callee;
+    mlir::Value adjustedThis;
+  };
+
+  GetMethodResults createGetMethod(mlir::Location loc, mlir::Value method,
+                                   mlir::Value objectPtr) {
+    // Build the callee function type.
+    auto methodFuncTy =
+        mlir::cast<cir::MethodType>(method.getType()).getMemberFuncTy();
+    auto methodFuncInputTypes = methodFuncTy.getInputs();
----------------
xlauko wrote:

I guess no `auto` here.

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


More information about the cfe-commits mailing list