@@ -1137,10 +1137,10 @@ LValue CIRGenFunction::emitDeclRefLValue(const DeclRefExpr *E) {
1137
1137
1138
1138
// We can form DeclRefExprs naming GUID declarations when reconstituting
1139
1139
// non-type template parameters into expressions.
1140
- if (const auto *GD = dyn_cast <MSGuidDecl>(ND))
1140
+ if (isa <MSGuidDecl>(ND))
1141
1141
llvm_unreachable (" NYI" );
1142
1142
1143
- if (const auto *TPO = dyn_cast <TemplateParamObjectDecl>(ND))
1143
+ if (isa <TemplateParamObjectDecl>(ND))
1144
1144
llvm_unreachable (" NYI" );
1145
1145
1146
1146
llvm_unreachable (" Unhandled DeclRefExpr" );
@@ -1294,7 +1294,7 @@ Address CIRGenFunction::emitPointerWithAlignment(
1294
1294
// / expression and compare the result against zero, returning an Int1Ty value.
1295
1295
mlir::Value CIRGenFunction::evaluateExprAsBool (const Expr *E) {
1296
1296
// TODO(cir): PGO
1297
- if (const MemberPointerType *MPT = E->getType ()->getAs <MemberPointerType>()) {
1297
+ if (E->getType ()->getAs <MemberPointerType>()) {
1298
1298
assert (0 && " not implemented" );
1299
1299
}
1300
1300
@@ -1831,8 +1831,7 @@ LValue CIRGenFunction::emitArraySubscriptExpr(const ArraySubscriptExpr *E,
1831
1831
{Idx}, E->getType (), !getLangOpts ().isSignedOverflowDefined (),
1832
1832
SignedIndices, CGM.getLoc (E->getExprLoc ()), /* shouldDecay=*/ false ,
1833
1833
&ptrType, E->getBase ());
1834
- } else if (const ObjCObjectType *OIT =
1835
- E->getType ()->getAs <ObjCObjectType>()) {
1834
+ } else if (E->getType ()->getAs <ObjCObjectType>()) {
1836
1835
llvm_unreachable (" ObjC object type subscript is NYI" );
1837
1836
} else if (const Expr *Array = isSimpleArrayDecayOperand (E->getBase ())) {
1838
1837
// If this is A[i] where A is an array, the frontend will have decayed
@@ -1908,6 +1907,8 @@ LValue CIRGenFunction::emitCastLValue(const CastExpr *E) {
1908
1907
switch (E->getCastKind ()) {
1909
1908
case CK_HLSLArrayRValue:
1910
1909
case CK_HLSLVectorTruncation:
1910
+ case CK_HLSLElementwiseCast:
1911
+ case CK_HLSLAggregateSplatCast:
1911
1912
case CK_ToVoid:
1912
1913
case CK_BitCast:
1913
1914
case CK_LValueToRValueBitCast:
@@ -2147,7 +2148,7 @@ LValue CIRGenFunction::emitMemberExpr(const MemberExpr *E) {
2147
2148
return LV;
2148
2149
}
2149
2150
2150
- if (const auto *FD = dyn_cast <FunctionDecl>(ND))
2151
+ if (isa <FunctionDecl>(ND))
2151
2152
assert (0 && " not implemented" );
2152
2153
2153
2154
llvm_unreachable (" Unhandled member declaration!" );
@@ -2254,7 +2255,7 @@ static void pushTemporaryCleanup(CIRGenFunction &CGF,
2254
2255
// need to perform retain/release operations on the temporary.
2255
2256
//
2256
2257
// FIXME: This should be looking at E, not M.
2257
- if (auto Lifetime = M->getType ().getObjCLifetime ()) {
2258
+ if ([[maybe_unused]] auto Lifetime = M->getType ().getObjCLifetime ()) {
2258
2259
assert (0 && " NYI" );
2259
2260
}
2260
2261
@@ -2330,7 +2331,7 @@ LValue CIRGenFunction::emitMaterializeTemporaryExpr(
2330
2331
for (const auto &Ignored : CommaLHSs)
2331
2332
emitIgnoredExpr (Ignored);
2332
2333
2333
- if (const auto *opaque = dyn_cast <OpaqueValueExpr>(E))
2334
+ if (isa <OpaqueValueExpr>(E))
2334
2335
assert (0 && " NYI" );
2335
2336
2336
2337
// Create and initialize the reference temporary.
@@ -2424,7 +2425,7 @@ std::optional<LValue> HandleConditionalOperatorLValueSimpleCase(
2424
2425
}
2425
2426
// If a throw expression we emit it and return an undefined lvalue
2426
2427
// because it can't be used.
2427
- if (auto *ThrowExpr = dyn_cast <CXXThrowExpr>(Live->IgnoreParens ())) {
2428
+ if (isa <CXXThrowExpr>(Live->IgnoreParens ())) {
2428
2429
llvm_unreachable (" NYI" );
2429
2430
}
2430
2431
return CGF.emitLValue (Live);
@@ -2439,7 +2440,7 @@ std::optional<LValue> HandleConditionalOperatorLValueSimpleCase(
2439
2440
// / LValue is returned and the current block has been terminated.
2440
2441
static std::optional<LValue> emitLValueOrThrowExpression (CIRGenFunction &CGF,
2441
2442
const Expr *Operand) {
2442
- if (auto *ThrowExpr = dyn_cast <CXXThrowExpr>(Operand->IgnoreParens ())) {
2443
+ if (isa <CXXThrowExpr>(Operand->IgnoreParens ())) {
2443
2444
llvm_unreachable (" NYI" );
2444
2445
}
2445
2446
@@ -2599,7 +2600,7 @@ LValue CIRGenFunction::emitLValue(const Expr *E) {
2599
2600
return emitBinaryOperatorLValue (cast<BinaryOperator>(E));
2600
2601
case Expr::CompoundAssignOperatorClass: {
2601
2602
QualType Ty = E->getType ();
2602
- if (const AtomicType *AT = Ty->getAs <AtomicType>())
2603
+ if (Ty->getAs <AtomicType>())
2603
2604
assert (0 && " not yet implemented" );
2604
2605
if (!Ty->isAnyComplexType ())
2605
2606
return emitCompoundAssignmentLValue (cast<CompoundAssignOperator>(E));
@@ -2780,7 +2781,7 @@ mlir::Value CIRGenFunction::emitOpOnBoolExpr(mlir::Location loc,
2780
2781
// llvm_unreachable("binaryoperator ifstmt NYI");
2781
2782
// }
2782
2783
2783
- if (const UnaryOperator *CondUOp = dyn_cast <UnaryOperator>(cond)) {
2784
+ if (isa <UnaryOperator>(cond)) {
2784
2785
// In LLVM the condition is reversed here for efficient codegen.
2785
2786
// This should be done in CIR prior to LLVM lowering, if we do now
2786
2787
// we can make CIR based diagnostics misleading.
@@ -2812,7 +2813,7 @@ mlir::Value CIRGenFunction::emitOpOnBoolExpr(mlir::Location loc,
2812
2813
getContext ().BoolTy , CondOp->getExprLoc ());
2813
2814
}
2814
2815
2815
- if (const CXXThrowExpr *Throw = dyn_cast <CXXThrowExpr>(cond)) {
2816
+ if (isa <CXXThrowExpr>(cond)) {
2816
2817
llvm_unreachable (" NYI" );
2817
2818
}
2818
2819
@@ -3300,7 +3301,7 @@ LValue CIRGenFunction::emitPredefinedLValue(const PredefinedExpr *E) {
3300
3301
StringRef NameItems[] = {PredefinedExpr::getIdentKindName (E->getIdentKind ()),
3301
3302
FnName};
3302
3303
std::string GVName = llvm::join (NameItems, NameItems + 2 , " ." );
3303
- if (auto *BD = dyn_cast_or_null <BlockDecl>(CurCodeDecl)) {
3304
+ if (isa_and_nonnull <BlockDecl>(CurCodeDecl)) {
3304
3305
llvm_unreachable (" NYI" );
3305
3306
}
3306
3307
0 commit comments