@@ -72,7 +72,7 @@ static RValue emitUnaryFPBuiltin(CIRGenFunction &CGF, const CallExpr &E) {
7272template <typename Op>
7373static RValue emitUnaryMaybeConstrainedFPToIntBuiltin (CIRGenFunction &CGF,
7474 const CallExpr &E) {
75- auto ResultType = CGF.ConvertType (E.getType ());
75+ auto ResultType = CGF.convertType (E.getType ());
7676 auto Src = CGF.emitScalarExpr (E.getArg (0 ));
7777
7878 if (CGF.getBuilder ().getIsFPConstrained ())
@@ -88,7 +88,7 @@ static RValue emitBinaryFPBuiltin(CIRGenFunction &CGF, const CallExpr &E) {
8888 auto Arg1 = CGF.emitScalarExpr (E.getArg (1 ));
8989
9090 auto Loc = CGF.getLoc (E.getExprLoc ());
91- auto Ty = CGF.ConvertType (E.getType ());
91+ auto Ty = CGF.convertType (E.getType ());
9292 auto Call = CGF.getBuilder ().create <Op>(Loc, Ty, Arg0, Arg1);
9393
9494 return RValue::get (Call->getResult (0 ));
@@ -101,7 +101,7 @@ static mlir::Value emitBinaryMaybeConstrainedFPBuiltin(CIRGenFunction &CGF,
101101 auto Arg1 = CGF.emitScalarExpr (E.getArg (1 ));
102102
103103 auto Loc = CGF.getLoc (E.getExprLoc ());
104- auto Ty = CGF.ConvertType (E.getType ());
104+ auto Ty = CGF.convertType (E.getType ());
105105
106106 if (CGF.getBuilder ().getIsFPConstrained ()) {
107107 CIRGenFunction::CIRGenFPOptionsRAII FPOptsRAII (CGF, &E);
@@ -122,7 +122,7 @@ emitBuiltinBitOp(CIRGenFunction &CGF, const CallExpr *E,
122122 else
123123 arg = CGF.emitScalarExpr (E->getArg (0 ));
124124
125- auto resultTy = CGF.ConvertType (E->getType ());
125+ auto resultTy = CGF.convertType (E->getType ());
126126 auto op =
127127 CGF.getBuilder ().create <Op>(CGF.getLoc (E->getExprLoc ()), resultTy, arg);
128128 return RValue::get (op);
@@ -415,7 +415,7 @@ RValue CIRGenFunction::emitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID,
415415 // of the type. We feel it should be Ok to use expression type because
416416 // it is hard to imagine a builtin function evaluates to
417417 // a value that over/underflows its own defined type.
418- mlir::Type resTy = getCIRType (E->getType ());
418+ mlir::Type resTy = convertType (E->getType ());
419419 return RValue::get (builder.getConstFP (getLoc (E->getExprLoc ()), resTy,
420420 Result.Val .getFloat ()));
421421 }
@@ -1173,7 +1173,7 @@ RValue CIRGenFunction::emitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID,
11731173 return emitRotate (E, true );
11741174
11751175 case Builtin::BI__builtin_constant_p: {
1176- mlir::Type ResultType = ConvertType (E->getType ());
1176+ mlir::Type ResultType = convertType (E->getType ());
11771177
11781178 const Expr *Arg = E->getArg (0 );
11791179 QualType ArgType = Arg->getType ();
@@ -1199,7 +1199,7 @@ RValue CIRGenFunction::emitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID,
11991199 // Convert Objective-C objects to id because we cannot distinguish between
12001200 // LLVM types for Obj-C classes as they are opaque.
12011201 ArgType = CGM.getASTContext ().getObjCIdType ();
1202- ArgValue = builder.createBitcast (ArgValue, ConvertType (ArgType));
1202+ ArgValue = builder.createBitcast (ArgValue, convertType (ArgType));
12031203
12041204 mlir::Value Result = builder.create <cir::IsConstantOp>(
12051205 getLoc (E->getSourceRange ()), ArgValue);
@@ -1215,7 +1215,7 @@ RValue CIRGenFunction::emitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID,
12151215 case Builtin::BI__builtin_object_size: {
12161216 unsigned Type =
12171217 E->getArg (1 )->EvaluateKnownConstInt (getContext ()).getZExtValue ();
1218- auto ResType = mlir::dyn_cast<cir::IntType>(ConvertType (E->getType ()));
1218+ auto ResType = mlir::dyn_cast<cir::IntType>(convertType (E->getType ()));
12191219 assert (ResType && " not sure what to do?" );
12201220
12211221 // We pass this builtin onto the optimizer so that it can figure out the
@@ -1306,7 +1306,7 @@ RValue CIRGenFunction::emitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID,
13061306 llvm_unreachable (" BI__builtin_nondeterministic_value NYI" );
13071307
13081308 case Builtin::BI__builtin_elementwise_abs: {
1309- mlir::Type cirTy = ConvertType (E->getArg (0 )->getType ());
1309+ mlir::Type cirTy = convertType (E->getArg (0 )->getType ());
13101310 bool isIntTy = cir::isIntOrIntVectorTy (cirTy);
13111311 if (!isIntTy) {
13121312 mlir::Type eltTy = cirTy;
@@ -1851,7 +1851,7 @@ RValue CIRGenFunction::emitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID,
18511851 auto loc = getLoc (E->getBeginLoc ());
18521852 return RValue::get (builder.createZExtOrBitCast (
18531853 loc, emitSignBit (loc, *this , emitScalarExpr (E->getArg (0 ))),
1854- ConvertType (E->getType ())));
1854+ convertType (E->getType ())));
18551855 }
18561856
18571857 case Builtin::BI__warn_memset_zero_len:
@@ -1897,8 +1897,7 @@ RValue CIRGenFunction::emitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID,
18971897
18981898 auto EncompassingCIRTy = cir::IntType::get (
18991899 &getMLIRContext (), EncompassingInfo.Width , EncompassingInfo.Signed );
1900- auto ResultCIRTy =
1901- mlir::cast<cir::IntType>(CGM.getTypes ().ConvertType (ResultQTy));
1900+ auto ResultCIRTy = mlir::cast<cir::IntType>(CGM.convertType (ResultQTy));
19021901
19031902 mlir::Value Left = emitScalarExpr (LeftArg);
19041903 mlir::Value Right = emitScalarExpr (RightArg);
@@ -2008,8 +2007,7 @@ RValue CIRGenFunction::emitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID,
20082007
20092008 clang::QualType ResultQTy =
20102009 ResultArg->getType ()->castAs <clang::PointerType>()->getPointeeType ();
2011- auto ResultCIRTy =
2012- mlir::cast<cir::IntType>(CGM.getTypes ().ConvertType (ResultQTy));
2010+ auto ResultCIRTy = mlir::cast<cir::IntType>(CGM.convertType (ResultQTy));
20132011
20142012 auto Loc = getLoc (E->getSourceRange ());
20152013 auto ArithResult =
@@ -2304,7 +2302,7 @@ RValue CIRGenFunction::emitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID,
23042302 // FIXME: We should use builder.createZExt once createZExt is available.
23052303 return RValue::get (builder.createZExtOrBitCast (
23062304 Loc, builder.createIsFPClass (Loc, V, FPClassTest::fcNan),
2307- ConvertType (E->getType ())));
2305+ convertType (E->getType ())));
23082306 }
23092307
23102308 case Builtin::BI__builtin_issignaling: {
@@ -2314,7 +2312,7 @@ RValue CIRGenFunction::emitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID,
23142312 // FIXME: We should use builder.createZExt once createZExt is available.
23152313 return RValue::get (builder.createZExtOrBitCast (
23162314 Loc, builder.createIsFPClass (Loc, V, FPClassTest::fcSNan),
2317- ConvertType (E->getType ())));
2315+ convertType (E->getType ())));
23182316 }
23192317
23202318 case Builtin::BI__builtin_isinf: {
@@ -2326,7 +2324,7 @@ RValue CIRGenFunction::emitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID,
23262324 // FIXME: We should use builder.createZExt once createZExt is available.
23272325 return RValue::get (builder.createZExtOrBitCast (
23282326 Loc, builder.createIsFPClass (Loc, V, FPClassTest::fcInf),
2329- ConvertType (E->getType ())));
2327+ convertType (E->getType ())));
23302328 }
23312329
23322330 case Builtin::BIfinite:
@@ -2344,7 +2342,7 @@ RValue CIRGenFunction::emitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID,
23442342 // FIXME: We should use builder.createZExt once createZExt is available.
23452343 return RValue::get (builder.createZExtOrBitCast (
23462344 Loc, builder.createIsFPClass (Loc, V, FPClassTest::fcFinite),
2347- ConvertType (E->getType ())));
2345+ convertType (E->getType ())));
23482346 }
23492347
23502348 case Builtin::BI__builtin_isnormal: {
@@ -2354,7 +2352,7 @@ RValue CIRGenFunction::emitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID,
23542352 // FIXME: We should use builder.createZExt once createZExt is available.
23552353 return RValue::get (builder.createZExtOrBitCast (
23562354 Loc, builder.createIsFPClass (Loc, V, FPClassTest::fcNormal),
2357- ConvertType (E->getType ())));
2355+ convertType (E->getType ())));
23582356 }
23592357
23602358 case Builtin::BI__builtin_issubnormal: {
@@ -2364,7 +2362,7 @@ RValue CIRGenFunction::emitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID,
23642362 // FIXME: We should use builder.createZExt once createZExt is available.
23652363 return RValue::get (builder.createZExtOrBitCast (
23662364 Loc, builder.createIsFPClass (Loc, V, FPClassTest::fcSubnormal),
2367- ConvertType (E->getType ())));
2365+ convertType (E->getType ())));
23682366 }
23692367
23702368 case Builtin::BI__builtin_iszero: {
@@ -2374,7 +2372,7 @@ RValue CIRGenFunction::emitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID,
23742372 // FIXME: We should use builder.createZExt once createZExt is available.
23752373 return RValue::get (builder.createZExtOrBitCast (
23762374 Loc, builder.createIsFPClass (Loc, V, FPClassTest::fcZero),
2377- ConvertType (E->getType ())));
2375+ convertType (E->getType ())));
23782376 }
23792377
23802378 case Builtin::BI__builtin_isfpclass: {
@@ -2389,7 +2387,7 @@ RValue CIRGenFunction::emitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID,
23892387
23902388 // FIXME: We should use builder.createZExt once createZExt is available.
23912389 return RValue::get (builder.createZExtOrBitCast (
2392- Loc, builder.createIsFPClass (Loc, V, Test), ConvertType (E->getType ())));
2390+ Loc, builder.createIsFPClass (Loc, V, Test), convertType (E->getType ())));
23932391 }
23942392 }
23952393
@@ -2706,6 +2704,6 @@ cir::FuncOp CIRGenModule::getBuiltinLibFunction(const FunctionDecl *FD,
27062704 Name = StringRef (astContext.BuiltinInfo .getName (BuiltinID).data (), 10 );
27072705 }
27082706
2709- auto Ty = getTypes (). ConvertType (FD->getType ());
2707+ auto Ty = convertType (FD->getType ());
27102708 return GetOrCreateCIRFunction (Name, Ty, D, /* ForVTable=*/ false );
27112709}
0 commit comments