Author: Simon Pilgrim
Date: 2024-12-31T14:34:14Z
New Revision: 6279d2e0f33ed1aa686aace48da6ccf912ab4b28

URL: 
https://github.com/llvm/llvm-project/commit/6279d2e0f33ed1aa686aace48da6ccf912ab4b28
DIFF: 
https://github.com/llvm/llvm-project/commit/6279d2e0f33ed1aa686aace48da6ccf912ab4b28.diff

LOG: AArch64ABIInfo::passAsAggregateType - don't directly dereference getAs<> 
result. NFC.

Reported by coverity static analyzer - we know the type is a BuiltinType so use 
castAs<>

Added: 
    

Modified: 
    clang/lib/CodeGen/Targets/AArch64.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/CodeGen/Targets/AArch64.cpp 
b/clang/lib/CodeGen/Targets/AArch64.cpp
index ad7f405cc72550..0680b4828b6daf 100644
--- a/clang/lib/CodeGen/Targets/AArch64.cpp
+++ b/clang/lib/CodeGen/Targets/AArch64.cpp
@@ -662,7 +662,7 @@ bool 
AArch64ABIInfo::isZeroLengthBitfieldPermittedInHomogeneousAggregate()
 
 bool AArch64ABIInfo::passAsAggregateType(QualType Ty) const {
   if (Kind == AArch64ABIKind::AAPCS && Ty->isSVESizelessBuiltinType()) {
-    const auto *BT = Ty->getAs<BuiltinType>();
+    const auto *BT = Ty->castAs<BuiltinType>();
     return !BT->isSVECount() &&
            getContext().getBuiltinVectorTypeInfo(BT).NumVectors > 1;
   }


        
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to