diff options
author | Simon Pilgrim <llvm-dev@redking.me.uk> | 2020-01-13 14:54:02 +0000 |
---|---|---|
committer | Simon Pilgrim <llvm-dev@redking.me.uk> | 2020-01-13 15:07:56 +0000 |
commit | 4647aae72f33b8742eb42c1fb869ebd4fdbb3038 (patch) | |
tree | f78c018bc06fe135a1bf06a4676908a0adde8d17 /clang/lib/AST | |
parent | 025941785faf25a3d9ba2c1e7682ca6c2ad063af (diff) | |
download | bcm5719-llvm-4647aae72f33b8742eb42c1fb869ebd4fdbb3038.tar.gz bcm5719-llvm-4647aae72f33b8742eb42c1fb869ebd4fdbb3038.zip |
Merge isVectorType() and getAs<VectorType> calls to silence clang static analyzer warning. NFCI.
Diffstat (limited to 'clang/lib/AST')
-rw-r--r-- | clang/lib/AST/ASTDiagnostic.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/clang/lib/AST/ASTDiagnostic.cpp b/clang/lib/AST/ASTDiagnostic.cpp index 8ff3cebb1d8..c241041ccb3 100644 --- a/clang/lib/AST/ASTDiagnostic.cpp +++ b/clang/lib/AST/ASTDiagnostic.cpp @@ -300,8 +300,7 @@ ConvertTypeToDiagnosticString(ASTContext &Context, QualType Ty, // Give some additional info on vector types. These are either not desugared // or displaying complex __attribute__ expressions so add details of the // type and element count. - if (Ty->isVectorType()) { - const VectorType *VTy = Ty->getAs<VectorType>(); + if (const auto *VTy = Ty->getAs<VectorType>()) { std::string DecoratedString; llvm::raw_string_ostream OS(DecoratedString); const char *Values = VTy->getNumElements() > 1 ? "values" : "value"; |