aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimm Bäder <tbaeder@redhat.com>2024-06-13 09:14:13 +0200
committerTimm Bäder <tbaeder@redhat.com>2024-06-13 12:34:11 +0200
commite439d22c7a981dfac3089cf8b6a83d2a51c0be78 (patch)
tree04b36721c89359f668e17df82216c027042f6b6f
parentc0ff36ea2357aa47bbf58cefbf579b08a08fb173 (diff)
downloadllvm-e439d22c7a981dfac3089cf8b6a83d2a51c0be78.zip
llvm-e439d22c7a981dfac3089cf8b6a83d2a51c0be78.tar.gz
llvm-e439d22c7a981dfac3089cf8b6a83d2a51c0be78.tar.bz2
[clang][ExprConst][NFC] Replace typecheck+castAs with getAs
-rw-r--r--clang/lib/AST/ExprConstant.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/AST/ExprConstant.cpp b/clang/lib/AST/ExprConstant.cpp
index d505745..7178f08 100644
--- a/clang/lib/AST/ExprConstant.cpp
+++ b/clang/lib/AST/ExprConstant.cpp
@@ -14014,8 +14014,8 @@ bool IntExprEvaluator::VisitUnaryExprOrTypeTraitExpr(
QualType Ty = E->getTypeOfArgument();
// If the vector has a fixed size, we can determine the number of elements
// at compile time.
- if (Ty->isVectorType())
- return Success(Ty->castAs<VectorType>()->getNumElements(), E);
+ if (const auto *VT = Ty->getAs<VectorType>())
+ return Success(VT->getNumElements(), E);
assert(Ty->isSizelessVectorType());
if (Info.InConstantContext)