Merge isVectorType() and getAs<VectorType> calls to silence clang static analyzer...
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Mon, 13 Jan 2020 14:54:02 +0000 (14:54 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Mon, 13 Jan 2020 15:07:56 +0000 (15:07 +0000)
clang/lib/AST/ASTDiagnostic.cpp

index 8ff3ceb..c241041 100644 (file)
@@ -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";