@@ -671,8 +671,8 @@ static LValue emitFunctionDeclLValue(CIRGenFunction &cgf, const Expr *e,
671671
672672 mlir::Type fnTy = funcOp.getFunctionType ();
673673 mlir::Type ptrTy = cir::PointerType::get (fnTy);
674- mlir::Value addr = cgf. getBuilder (). create < cir::GetGlobalOp>(
675- loc, ptrTy, funcOp.getSymName ());
674+ mlir::Value addr = cir::GetGlobalOp::create (cgf. getBuilder (), loc, ptrTy,
675+ funcOp.getSymName ());
676676
677677 if (funcOp.getFunctionType () != cgf.convertType (fd->getType ())) {
678678 fnTy = cgf.convertType (fd->getType ());
@@ -1820,10 +1820,12 @@ CIRGenCallee CIRGenFunction::emitCallee(const clang::Expr *e) {
18201820 // Resolve direct calls.
18211821 const auto *funcDecl = cast<FunctionDecl>(declRef->getDecl ());
18221822 return emitDirectCallee (funcDecl);
1823- } else if (isa<MemberExpr>(e)) {
1824- cgm.errorNYI (e->getSourceRange (),
1825- " emitCallee: call to member function is NYI" );
1826- return {};
1823+ } else if (auto me = dyn_cast<MemberExpr>(e)) {
1824+ if (const auto *fd = dyn_cast<FunctionDecl>(me->getMemberDecl ())) {
1825+ emitIgnoredExpr (me->getBase ());
1826+ return emitDirectCallee (fd);
1827+ }
1828+ // Else fall through to the indirect reference handling below.
18271829 } else if (auto *pde = dyn_cast<CXXPseudoDestructorExpr>(e)) {
18281830 return CIRGenCallee::forPseudoDestructor (pde);
18291831 }
@@ -2020,18 +2022,17 @@ mlir::Value CIRGenFunction::emitOpOnBoolExpr(mlir::Location loc,
20202022 mlir::Value condV = emitOpOnBoolExpr (loc, condOp->getCond ());
20212023
20222024 mlir::Value ternaryOpRes =
2023- builder
2024- .create <cir::TernaryOp>(
2025- loc, condV, /* thenBuilder=*/
2026- [this , trueExpr](mlir::OpBuilder &b, mlir::Location loc) {
2027- mlir::Value lhs = emitScalarExpr (trueExpr);
2028- cir::YieldOp::create (b, loc, lhs);
2029- },
2030- /* elseBuilder=*/
2031- [this , falseExpr](mlir::OpBuilder &b, mlir::Location loc) {
2032- mlir::Value rhs = emitScalarExpr (falseExpr);
2033- cir::YieldOp::create (b, loc, rhs);
2034- })
2025+ cir::TernaryOp::create (
2026+ builder, loc, condV, /* thenBuilder=*/
2027+ [this , trueExpr](mlir::OpBuilder &b, mlir::Location loc) {
2028+ mlir::Value lhs = emitScalarExpr (trueExpr);
2029+ cir::YieldOp::create (b, loc, lhs);
2030+ },
2031+ /* elseBuilder=*/
2032+ [this , falseExpr](mlir::OpBuilder &b, mlir::Location loc) {
2033+ mlir::Value rhs = emitScalarExpr (falseExpr);
2034+ cir::YieldOp::create (b, loc, rhs);
2035+ })
20352036 .getResult ();
20362037
20372038 return emitScalarConversion (ternaryOpRes, condOp->getType (),
0 commit comments