[clang] [CIR] Upstream support for C++ member function calls (PR #140290)
Sirui Mu via cfe-commits
cfe-commits at lists.llvm.org
Sun May 18 19:56:19 PDT 2025
================
@@ -1148,6 +1146,35 @@ mlir::Value CIRGenFunction::emitAlloca(StringRef name, mlir::Type ty,
return addr;
}
+// Note: this function also emit constructor calls to support a MSVC extensions
+// allowing explicit constructor function call.
+RValue CIRGenFunction::emitCXXMemberCallExpr(const CXXMemberCallExpr *ce,
+ ReturnValueSlot returnValue) {
+ const Expr *callee = ce->getCallee()->IgnoreParens();
+
+ if (isa<BinaryOperator>(callee)) {
+ cgm.errorNYI(ce->getSourceRange(),
+ "emitCXXMemberCallExpr: C++ binary operator");
+ return RValue::get(nullptr);
+ }
+
+ const auto *me = cast<MemberExpr>(callee);
+ const auto *md = cast<CXXMethodDecl>(me->getMemberDecl());
+
+ if (md->isStatic()) {
+ cgm.errorNYI(ce->getSourceRange(), "emitCXXMemberCallExpr: static method");
+ return RValue::get(nullptr);
+ }
----------------
Lancern wrote:
Can we include static method calls in this PR? This looks like a direct invocation into existing function call CIRGen.
https://github.com/llvm/llvm-project/pull/140290
More information about the cfe-commits
mailing list