[clang-tools-extra] Format sources with clang-format. NFC.

Summary:
Ran clang-format on all .c/.cpp/.h files in clang-tools-extra.
Excluded the test, unittests, clang-reorder-fields, include-fixer, modularize and pptrace directories.

Reviewers: klimek, alexfh

Subscribers: nemanjai

Tags: #clang-tools-extra

Differential Revision: https://reviews.llvm.org/D26329

llvm-svn: 286221
diff --git a/clang-tools-extra/clang-tidy/cppcoreguidelines/CppCoreGuidelinesTidyModule.cpp b/clang-tools-extra/clang-tidy/cppcoreguidelines/CppCoreGuidelinesTidyModule.cpp
index dc9a7f3..b34314c 100644
--- a/clang-tools-extra/clang-tidy/cppcoreguidelines/CppCoreGuidelinesTidyModule.cpp
+++ b/clang-tools-extra/clang-tidy/cppcoreguidelines/CppCoreGuidelinesTidyModule.cpp
@@ -22,8 +22,8 @@
 #include "ProTypeStaticCastDowncastCheck.h"
 #include "ProTypeUnionAccessCheck.h"
 #include "ProTypeVarargCheck.h"
-#include "SpecialMemberFunctionsCheck.h"
 #include "SlicingCheck.h"
+#include "SpecialMemberFunctionsCheck.h"
 
 namespace clang {
 namespace tidy {
@@ -57,8 +57,7 @@
         "cppcoreguidelines-pro-type-vararg");
     CheckFactories.registerCheck<SpecialMemberFunctionsCheck>(
         "cppcoreguidelines-special-member-functions");
-    CheckFactories.registerCheck<SlicingCheck>(
-        "cppcoreguidelines-slicing");
+    CheckFactories.registerCheck<SlicingCheck>("cppcoreguidelines-slicing");
     CheckFactories.registerCheck<misc::UnconventionalAssignOperatorCheck>(
         "cppcoreguidelines-c-copy-assignment-signature");
   }
diff --git a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsConstantArrayIndexCheck.cpp b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsConstantArrayIndexCheck.cpp
index 56fbf74..3844f68 100644
--- a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsConstantArrayIndexCheck.cpp
+++ b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsConstantArrayIndexCheck.cpp
@@ -47,12 +47,12 @@
 
   // Note: if a struct contains an array member, the compiler-generated
   // constructor has an arraySubscriptExpr.
-  Finder->addMatcher(arraySubscriptExpr(hasBase(ignoringImpCasts(hasType(
-                                            constantArrayType().bind("type")))),
-                                        hasIndex(expr().bind("index")),
-                                        unless(hasAncestor(isImplicit())))
-                         .bind("expr"),
-                     this);
+  Finder->addMatcher(
+      arraySubscriptExpr(
+          hasBase(ignoringImpCasts(hasType(constantArrayType().bind("type")))),
+          hasIndex(expr().bind("index")), unless(hasAncestor(isImplicit())))
+          .bind("expr"),
+      this);
 
   Finder->addMatcher(
       cxxOperatorCallExpr(
@@ -112,8 +112,7 @@
     return;
 
   if (Index.isSigned() && Index.isNegative()) {
-    diag(Matched->getExprLoc(),
-         "std::array<> index %0 is negative")
+    diag(Matched->getExprLoc(), "std::array<> index %0 is negative")
         << Index.toString(10);
     return;
   }
@@ -130,8 +129,9 @@
   // Get uint64_t values, because different bitwidths would lead to an assertion
   // in APInt::uge.
   if (Index.getZExtValue() >= ArraySize.getZExtValue()) {
-    diag(Matched->getExprLoc(), "std::array<> index %0 is past the end of the array "
-                                "(which contains %1 elements)")
+    diag(Matched->getExprLoc(),
+         "std::array<> index %0 is past the end of the array "
+         "(which contains %1 elements)")
         << Index.toString(10) << ArraySize.toString(10, false);
   }
 }
diff --git a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsPointerArithmeticCheck.cpp b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsPointerArithmeticCheck.cpp
index da85093..d664b64 100644
--- a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsPointerArithmeticCheck.cpp
+++ b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsPointerArithmeticCheck.cpp
@@ -47,8 +47,8 @@
       this);
 }
 
-void
-ProBoundsPointerArithmeticCheck::check(const MatchFinder::MatchResult &Result) {
+void ProBoundsPointerArithmeticCheck::check(
+    const MatchFinder::MatchResult &Result) {
   const auto *MatchedExpr = Result.Nodes.getNodeAs<Expr>("expr");
 
   diag(MatchedExpr->getExprLoc(), "do not use pointer arithmetic");
diff --git a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsPointerArithmeticCheck.h b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsPointerArithmeticCheck.h
index 6f330cf..5ecf93c 100644
--- a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsPointerArithmeticCheck.h
+++ b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsPointerArithmeticCheck.h
@@ -17,7 +17,8 @@
 namespace cppcoreguidelines {
 
 /// Flags all kinds of pointer arithmetic that have result of pointer type, i.e.
-/// +, -, +=, -=, ++, --. In addition, the [] operator on pointers (not on arrays) is flagged.
+/// +, -, +=, -=, ++, --. In addition, the [] operator on pointers (not on
+/// arrays) is flagged.
 ///
 /// For the user-facing documentation see:
 /// http://clang.llvm.org/extra/clang-tidy/checks/cppcoreguidelines-pro-bounds-pointer-arithmetic.html
diff --git a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeMemberInitCheck.cpp b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeMemberInitCheck.cpp
index a5c2648..e64d36a 100644
--- a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeMemberInitCheck.cpp
+++ b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeMemberInitCheck.cpp
@@ -278,8 +278,7 @@
   // AST.
   Finder->addMatcher(
       cxxRecordDecl(
-          isDefinition(), unless(isInstantiated()),
-          hasDefaultConstructor(),
+          isDefinition(), unless(isInstantiated()), hasDefaultConstructor(),
           anyOf(has(cxxConstructorDecl(isDefaultConstructor(), isDefaulted(),
                                        unless(isImplicit()))),
                 unless(has(cxxConstructorDecl()))),
@@ -465,7 +464,7 @@
       << toCommaSeparatedString(AllBases, BasesToInit);
 
   if (Ctor)
-      fixInitializerList(Context, Diag, Ctor, BasesToInit);
+    fixInitializerList(Context, Diag, Ctor, BasesToInit);
 }
 
 void ProTypeMemberInitCheck::checkUninitializedTrivialType(
diff --git a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeStaticCastDowncastCheck.cpp b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeStaticCastDowncastCheck.cpp
index 153e1ca..f43e4fa 100644
--- a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeStaticCastDowncastCheck.cpp
+++ b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeStaticCastDowncastCheck.cpp
@@ -26,7 +26,8 @@
       this);
 }
 
-void ProTypeStaticCastDowncastCheck::check(const MatchFinder::MatchResult &Result) {
+void ProTypeStaticCastDowncastCheck::check(
+    const MatchFinder::MatchResult &Result) {
   const auto *MatchedCast = Result.Nodes.getNodeAs<CXXStaticCastExpr>("cast");
   if (MatchedCast->getCastKind() != CK_BaseToDerived)
     return;
diff --git a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeStaticCastDowncastCheck.h b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeStaticCastDowncastCheck.h
index 7722423..b6d76a6 100644
--- a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeStaticCastDowncastCheck.h
+++ b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeStaticCastDowncastCheck.h
@@ -16,7 +16,8 @@
 namespace tidy {
 namespace cppcoreguidelines {
 
-/// Checks for usages of static_cast, where a base class is downcasted to a derived class.
+/// Checks for usages of static_cast, where a base class is downcasted to a
+/// derived class.
 ///
 /// For the user-facing documentation see:
 /// http://clang.llvm.org/extra/clang-tidy/checks/cppcoreguidelines-pro-type-static-cast-downcast.html
diff --git a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeUnionAccessCheck.cpp b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeUnionAccessCheck.cpp
index 5233ad8..09752f6 100644
--- a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeUnionAccessCheck.cpp
+++ b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeUnionAccessCheck.cpp
@@ -21,15 +21,18 @@
   if (!getLangOpts().CPlusPlus)
     return;
 
-  Finder->addMatcher(memberExpr(hasObjectExpression(hasType(recordDecl(isUnion())))).bind("expr"), this);
+  Finder->addMatcher(
+      memberExpr(hasObjectExpression(hasType(recordDecl(isUnion()))))
+          .bind("expr"),
+      this);
 }
 
 void ProTypeUnionAccessCheck::check(const MatchFinder::MatchResult &Result) {
   const auto *Matched = Result.Nodes.getNodeAs<MemberExpr>("expr");
-  diag(Matched->getMemberLoc(), "do not access members of unions; use (boost::)variant instead");
+  diag(Matched->getMemberLoc(),
+       "do not access members of unions; use (boost::)variant instead");
 }
 
 } // namespace cppcoreguidelines
 } // namespace tidy
 } // namespace clang
-
diff --git a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeUnionAccessCheck.h b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeUnionAccessCheck.h
index 28097fa..fc7dd67 100644
--- a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeUnionAccessCheck.h
+++ b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeUnionAccessCheck.h
@@ -34,4 +34,3 @@
 } // namespace clang
 
 #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CPPCOREGUIDELINES_PRO_TYPE_UNION_ACCESS_H
-
diff --git a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeVarargCheck.cpp b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeVarargCheck.cpp
index 680037f..56227b2 100644
--- a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeVarargCheck.cpp
+++ b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeVarargCheck.cpp
@@ -26,9 +26,7 @@
   Finder->addMatcher(vAArgExpr().bind("va_use"), this);
 
   Finder->addMatcher(
-      callExpr(callee(functionDecl(isVariadic())))
-          .bind("callvararg"),
-      this);
+      callExpr(callee(functionDecl(isVariadic()))).bind("callvararg"), this);
 }
 
 static bool hasSingleVariadicArgumentWithValue(const CallExpr *C, uint64_t I) {