@@ -72,7 +72,7 @@ static RValue emitUnaryFPBuiltin(CIRGenFunction &CGF, const CallExpr &E) {
72
72
template <typename Op>
73
73
static RValue emitUnaryMaybeConstrainedFPToIntBuiltin (CIRGenFunction &CGF,
74
74
const CallExpr &E) {
75
- auto ResultType = CGF.ConvertType (E.getType ());
75
+ auto ResultType = CGF.convertType (E.getType ());
76
76
auto Src = CGF.emitScalarExpr (E.getArg (0 ));
77
77
78
78
if (CGF.getBuilder ().getIsFPConstrained ())
@@ -88,7 +88,7 @@ static RValue emitBinaryFPBuiltin(CIRGenFunction &CGF, const CallExpr &E) {
88
88
auto Arg1 = CGF.emitScalarExpr (E.getArg (1 ));
89
89
90
90
auto Loc = CGF.getLoc (E.getExprLoc ());
91
- auto Ty = CGF.ConvertType (E.getType ());
91
+ auto Ty = CGF.convertType (E.getType ());
92
92
auto Call = CGF.getBuilder ().create <Op>(Loc, Ty, Arg0, Arg1);
93
93
94
94
return RValue::get (Call->getResult (0 ));
@@ -101,7 +101,7 @@ static mlir::Value emitBinaryMaybeConstrainedFPBuiltin(CIRGenFunction &CGF,
101
101
auto Arg1 = CGF.emitScalarExpr (E.getArg (1 ));
102
102
103
103
auto Loc = CGF.getLoc (E.getExprLoc ());
104
- auto Ty = CGF.ConvertType (E.getType ());
104
+ auto Ty = CGF.convertType (E.getType ());
105
105
106
106
if (CGF.getBuilder ().getIsFPConstrained ()) {
107
107
CIRGenFunction::CIRGenFPOptionsRAII FPOptsRAII (CGF, &E);
@@ -122,7 +122,7 @@ emitBuiltinBitOp(CIRGenFunction &CGF, const CallExpr *E,
122
122
else
123
123
arg = CGF.emitScalarExpr (E->getArg (0 ));
124
124
125
- auto resultTy = CGF.ConvertType (E->getType ());
125
+ auto resultTy = CGF.convertType (E->getType ());
126
126
auto op =
127
127
CGF.getBuilder ().create <Op>(CGF.getLoc (E->getExprLoc ()), resultTy, arg);
128
128
return RValue::get (op);
@@ -415,7 +415,7 @@ RValue CIRGenFunction::emitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID,
415
415
// of the type. We feel it should be Ok to use expression type because
416
416
// it is hard to imagine a builtin function evaluates to
417
417
// a value that over/underflows its own defined type.
418
- mlir::Type resTy = getCIRType (E->getType ());
418
+ mlir::Type resTy = convertType (E->getType ());
419
419
return RValue::get (builder.getConstFP (getLoc (E->getExprLoc ()), resTy,
420
420
Result.Val .getFloat ()));
421
421
}
@@ -1173,7 +1173,7 @@ RValue CIRGenFunction::emitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID,
1173
1173
return emitRotate (E, true );
1174
1174
1175
1175
case Builtin::BI__builtin_constant_p: {
1176
- mlir::Type ResultType = ConvertType (E->getType ());
1176
+ mlir::Type ResultType = convertType (E->getType ());
1177
1177
1178
1178
const Expr *Arg = E->getArg (0 );
1179
1179
QualType ArgType = Arg->getType ();
@@ -1199,7 +1199,7 @@ RValue CIRGenFunction::emitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID,
1199
1199
// Convert Objective-C objects to id because we cannot distinguish between
1200
1200
// LLVM types for Obj-C classes as they are opaque.
1201
1201
ArgType = CGM.getASTContext ().getObjCIdType ();
1202
- ArgValue = builder.createBitcast (ArgValue, ConvertType (ArgType));
1202
+ ArgValue = builder.createBitcast (ArgValue, convertType (ArgType));
1203
1203
1204
1204
mlir::Value Result = builder.create <cir::IsConstantOp>(
1205
1205
getLoc (E->getSourceRange ()), ArgValue);
@@ -1215,7 +1215,7 @@ RValue CIRGenFunction::emitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID,
1215
1215
case Builtin::BI__builtin_object_size: {
1216
1216
unsigned Type =
1217
1217
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 ()));
1219
1219
assert (ResType && " not sure what to do?" );
1220
1220
1221
1221
// 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,
1306
1306
llvm_unreachable (" BI__builtin_nondeterministic_value NYI" );
1307
1307
1308
1308
case Builtin::BI__builtin_elementwise_abs: {
1309
- mlir::Type cirTy = ConvertType (E->getArg (0 )->getType ());
1309
+ mlir::Type cirTy = convertType (E->getArg (0 )->getType ());
1310
1310
bool isIntTy = cir::isIntOrIntVectorTy (cirTy);
1311
1311
if (!isIntTy) {
1312
1312
mlir::Type eltTy = cirTy;
@@ -1851,7 +1851,7 @@ RValue CIRGenFunction::emitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID,
1851
1851
auto loc = getLoc (E->getBeginLoc ());
1852
1852
return RValue::get (builder.createZExtOrBitCast (
1853
1853
loc, emitSignBit (loc, *this , emitScalarExpr (E->getArg (0 ))),
1854
- ConvertType (E->getType ())));
1854
+ convertType (E->getType ())));
1855
1855
}
1856
1856
1857
1857
case Builtin::BI__warn_memset_zero_len:
@@ -1897,8 +1897,7 @@ RValue CIRGenFunction::emitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID,
1897
1897
1898
1898
auto EncompassingCIRTy = cir::IntType::get (
1899
1899
&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));
1902
1901
1903
1902
mlir::Value Left = emitScalarExpr (LeftArg);
1904
1903
mlir::Value Right = emitScalarExpr (RightArg);
@@ -2008,8 +2007,7 @@ RValue CIRGenFunction::emitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID,
2008
2007
2009
2008
clang::QualType ResultQTy =
2010
2009
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));
2013
2011
2014
2012
auto Loc = getLoc (E->getSourceRange ());
2015
2013
auto ArithResult =
@@ -2304,7 +2302,7 @@ RValue CIRGenFunction::emitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID,
2304
2302
// FIXME: We should use builder.createZExt once createZExt is available.
2305
2303
return RValue::get (builder.createZExtOrBitCast (
2306
2304
Loc, builder.createIsFPClass (Loc, V, FPClassTest::fcNan),
2307
- ConvertType (E->getType ())));
2305
+ convertType (E->getType ())));
2308
2306
}
2309
2307
2310
2308
case Builtin::BI__builtin_issignaling: {
@@ -2314,7 +2312,7 @@ RValue CIRGenFunction::emitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID,
2314
2312
// FIXME: We should use builder.createZExt once createZExt is available.
2315
2313
return RValue::get (builder.createZExtOrBitCast (
2316
2314
Loc, builder.createIsFPClass (Loc, V, FPClassTest::fcSNan),
2317
- ConvertType (E->getType ())));
2315
+ convertType (E->getType ())));
2318
2316
}
2319
2317
2320
2318
case Builtin::BI__builtin_isinf: {
@@ -2326,7 +2324,7 @@ RValue CIRGenFunction::emitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID,
2326
2324
// FIXME: We should use builder.createZExt once createZExt is available.
2327
2325
return RValue::get (builder.createZExtOrBitCast (
2328
2326
Loc, builder.createIsFPClass (Loc, V, FPClassTest::fcInf),
2329
- ConvertType (E->getType ())));
2327
+ convertType (E->getType ())));
2330
2328
}
2331
2329
2332
2330
case Builtin::BIfinite:
@@ -2344,7 +2342,7 @@ RValue CIRGenFunction::emitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID,
2344
2342
// FIXME: We should use builder.createZExt once createZExt is available.
2345
2343
return RValue::get (builder.createZExtOrBitCast (
2346
2344
Loc, builder.createIsFPClass (Loc, V, FPClassTest::fcFinite),
2347
- ConvertType (E->getType ())));
2345
+ convertType (E->getType ())));
2348
2346
}
2349
2347
2350
2348
case Builtin::BI__builtin_isnormal: {
@@ -2354,7 +2352,7 @@ RValue CIRGenFunction::emitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID,
2354
2352
// FIXME: We should use builder.createZExt once createZExt is available.
2355
2353
return RValue::get (builder.createZExtOrBitCast (
2356
2354
Loc, builder.createIsFPClass (Loc, V, FPClassTest::fcNormal),
2357
- ConvertType (E->getType ())));
2355
+ convertType (E->getType ())));
2358
2356
}
2359
2357
2360
2358
case Builtin::BI__builtin_issubnormal: {
@@ -2364,7 +2362,7 @@ RValue CIRGenFunction::emitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID,
2364
2362
// FIXME: We should use builder.createZExt once createZExt is available.
2365
2363
return RValue::get (builder.createZExtOrBitCast (
2366
2364
Loc, builder.createIsFPClass (Loc, V, FPClassTest::fcSubnormal),
2367
- ConvertType (E->getType ())));
2365
+ convertType (E->getType ())));
2368
2366
}
2369
2367
2370
2368
case Builtin::BI__builtin_iszero: {
@@ -2374,7 +2372,7 @@ RValue CIRGenFunction::emitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID,
2374
2372
// FIXME: We should use builder.createZExt once createZExt is available.
2375
2373
return RValue::get (builder.createZExtOrBitCast (
2376
2374
Loc, builder.createIsFPClass (Loc, V, FPClassTest::fcZero),
2377
- ConvertType (E->getType ())));
2375
+ convertType (E->getType ())));
2378
2376
}
2379
2377
2380
2378
case Builtin::BI__builtin_isfpclass: {
@@ -2389,7 +2387,7 @@ RValue CIRGenFunction::emitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID,
2389
2387
2390
2388
// FIXME: We should use builder.createZExt once createZExt is available.
2391
2389
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 ())));
2393
2391
}
2394
2392
}
2395
2393
@@ -2706,6 +2704,6 @@ cir::FuncOp CIRGenModule::getBuiltinLibFunction(const FunctionDecl *FD,
2706
2704
Name = astContext.BuiltinInfo .getName (BuiltinID).substr (10 );
2707
2705
}
2708
2706
2709
- auto Ty = getTypes (). ConvertType (FD->getType ());
2707
+ auto Ty = convertType (FD->getType ());
2710
2708
return GetOrCreateCIRFunction (Name, Ty, D, /* ForVTable=*/ false );
2711
2709
}
0 commit comments