diff --git a/clang/lib/CodeGen/CGBuiltin.cpp b/clang/lib/CodeGen/CGBuiltin.cpp index 0916e14f182dd..887e0f0e05469 100644 --- a/clang/lib/CodeGen/CGBuiltin.cpp +++ b/clang/lib/CodeGen/CGBuiltin.cpp @@ -19052,8 +19052,8 @@ Value *CodeGenFunction::EmitHLSLBuiltinExpr(unsigned BuiltinID, "cross operands must have a float representation"); // make sure each vector has exactly 3 elements assert( - E->getArg(0)->getType()->getAs()->getNumElements() == 3 && - E->getArg(1)->getType()->getAs()->getNumElements() == 3 && + E->getArg(0)->getType()->castAs()->getNumElements() == 3 && + E->getArg(1)->getType()->castAs()->getNumElements() == 3 && "input vectors must have 3 elements each"); return Builder.CreateIntrinsic( /*ReturnType=*/Op0->getType(), CGM.getHLSLRuntime().getCrossIntrinsic(), diff --git a/clang/lib/CodeGen/CGExpr.cpp b/clang/lib/CodeGen/CGExpr.cpp index 232cac22d1bfc..d3f470d401b3d 100644 --- a/clang/lib/CodeGen/CGExpr.cpp +++ b/clang/lib/CodeGen/CGExpr.cpp @@ -4370,7 +4370,7 @@ LValue CodeGenFunction::EmitArraySubscriptExpr(const ArraySubscriptExpr *E, ME && ME->isFlexibleArrayMemberLike(getContext(), StrictFlexArraysLevel) && ME->getMemberDecl()->getType()->isCountAttributedType()) { - const FieldDecl *FAMDecl = dyn_cast(ME->getMemberDecl()); + const FieldDecl *FAMDecl = cast(ME->getMemberDecl()); if (const FieldDecl *CountFD = FAMDecl->findCountedByField()) { if (std::optional Diff = getOffsetDifferenceInBits(*this, CountFD, FAMDecl)) { diff --git a/clang/lib/Sema/AnalysisBasedWarnings.cpp b/clang/lib/Sema/AnalysisBasedWarnings.cpp index 075c0df3f5496..37d966a5a0463 100644 --- a/clang/lib/Sema/AnalysisBasedWarnings.cpp +++ b/clang/lib/Sema/AnalysisBasedWarnings.cpp @@ -2257,7 +2257,7 @@ class UnsafeBufferUsageReporter : public UnsafeBufferUsageHandler { } else if (isa(Operation)) { // note_unsafe_buffer_operation doesn't have this mode yet. assert(!IsRelatedToDecl && "Not implemented yet!"); - auto ME = dyn_cast(Operation); + auto *ME = cast(Operation); D = ME->getMemberDecl(); MsgParam = 5; } else if (const auto *ECE = dyn_cast(Operation)) { diff --git a/clang/lib/Sema/SemaExprMember.cpp b/clang/lib/Sema/SemaExprMember.cpp index c32df60769281..434768b99d631 100644 --- a/clang/lib/Sema/SemaExprMember.cpp +++ b/clang/lib/Sema/SemaExprMember.cpp @@ -377,7 +377,7 @@ CheckExtVectorComponent(Sema &S, QualType baseType, ExprValueKind &VK, // // FIXME: This logic can be greatly simplified by splitting it along // halving/not halving and reworking the component checking. - const ExtVectorType *vecType = baseType->getAs(); + const ExtVectorType *vecType = baseType->castAs(); // The vector accessor can't exceed the number of elements. const char *compStr = CompName->getNameStart();