================
@@ -3232,10 +3232,13 @@ static bool CheckFloatRepresentation(Sema *S,
SourceLocation Loc,
static bool CheckFloatOrHalfRepresentation(Sema *S, SourceLocation Loc,
int ArgOrdinal,
clang::QualType PassedType) {
- clang::QualType BaseType =
- PassedType->isVectorType()
- ? PassedType->castAs<clang::VectorType>()->getElementType()
- : PassedType;
+ clang::QualType BaseType = PassedType;
+ if (const auto *VT = PassedType->getAs<clang::VectorType>()) {
+ BaseType = VT->getElementType();
+ } else if (const auto *MT = PassedType->getAs<clang::MatrixType>()) {
+ BaseType = MT->getElementType();
+ }
----------------
farzonl wrote:
llvm style guide is to not do brackets when we have one line in scope
```suggestion
if (const auto *VT = PassedType->getAs<clang::VectorType>())
BaseType = VT->getElementType();
else if (const auto *MT = PassedType->getAs<clang::MatrixType>())
BaseType = MT->getElementType();
```
https://github.com/llvm/llvm-project/pull/194984
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits