[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/readability/RedundantStringCStrCheck.cpp b/clang-tools-extra/clang-tidy/readability/RedundantStringCStrCheck.cpp
index 5b0e4ca..8f086b8 100644
--- a/clang-tools-extra/clang-tidy/readability/RedundantStringCStrCheck.cpp
+++ b/clang-tools-extra/clang-tidy/readability/RedundantStringCStrCheck.cpp
@@ -77,17 +77,14 @@
     return;
 
   // Match expressions of type 'string' or 'string*'.
-  const auto StringDecl =
-      cxxRecordDecl(hasName("::std::basic_string"));
+  const auto StringDecl = cxxRecordDecl(hasName("::std::basic_string"));
   const auto StringExpr =
-      expr(anyOf(hasType(StringDecl),
-                 hasType(qualType(pointsTo(StringDecl)))));
+      expr(anyOf(hasType(StringDecl), hasType(qualType(pointsTo(StringDecl)))));
 
   // Match string constructor.
   const auto StringConstructorExpr = expr(anyOf(
-      cxxConstructExpr(
-          argumentCountIs(1),
-          hasDeclaration(cxxMethodDecl(hasName("basic_string")))),
+      cxxConstructExpr(argumentCountIs(1),
+                       hasDeclaration(cxxMethodDecl(hasName("basic_string")))),
       cxxConstructExpr(
           argumentCountIs(2),
           hasDeclaration(cxxMethodDecl(hasName("basic_string"))),
@@ -103,21 +100,18 @@
           .bind("call");
 
   // Detect redundant 'c_str()' calls through a string constructor.
-  Finder->addMatcher(
-      cxxConstructExpr(StringConstructorExpr,
-                       hasArgument(0, StringCStrCallExpr)),
-      this);
+  Finder->addMatcher(cxxConstructExpr(StringConstructorExpr,
+                                      hasArgument(0, StringCStrCallExpr)),
+                     this);
 
   // Detect: 's == str.c_str()'  ->  's == str'
   Finder->addMatcher(
       cxxOperatorCallExpr(
-          anyOf(hasOverloadedOperatorName("<"),
-                hasOverloadedOperatorName(">"),
-                hasOverloadedOperatorName(">="),
-                hasOverloadedOperatorName("<="),
-                hasOverloadedOperatorName("!="),
-                hasOverloadedOperatorName("=="),
-                hasOverloadedOperatorName("+")),
+          anyOf(
+              hasOverloadedOperatorName("<"), hasOverloadedOperatorName(">"),
+              hasOverloadedOperatorName(">="), hasOverloadedOperatorName("<="),
+              hasOverloadedOperatorName("!="), hasOverloadedOperatorName("=="),
+              hasOverloadedOperatorName("+")),
           anyOf(allOf(hasArgument(0, StringExpr),
                       hasArgument(1, StringCStrCallExpr)),
                 allOf(hasArgument(0, StringCStrCallExpr),
@@ -126,47 +120,41 @@
 
   // Detect: 'dst += str.c_str()'  ->  'dst += str'
   // Detect: 's = str.c_str()'  ->  's = str'
-  Finder->addMatcher(
-      cxxOperatorCallExpr(
-          anyOf(hasOverloadedOperatorName("="),
-                hasOverloadedOperatorName("+=")),
-          hasArgument(0, StringExpr),
-          hasArgument(1, StringCStrCallExpr)),
-      this);
+  Finder->addMatcher(cxxOperatorCallExpr(anyOf(hasOverloadedOperatorName("="),
+                                               hasOverloadedOperatorName("+=")),
+                                         hasArgument(0, StringExpr),
+                                         hasArgument(1, StringCStrCallExpr)),
+                     this);
 
   // Detect: 'dst.append(str.c_str())'  ->  'dst.append(str)'
   Finder->addMatcher(
-      cxxMemberCallExpr(on(StringExpr),
-          callee(decl(cxxMethodDecl(
-              hasAnyName("append", "assign", "compare")))),
-          argumentCountIs(1),
-          hasArgument(0, StringCStrCallExpr)),
+      cxxMemberCallExpr(on(StringExpr), callee(decl(cxxMethodDecl(hasAnyName(
+                                            "append", "assign", "compare")))),
+                        argumentCountIs(1), hasArgument(0, StringCStrCallExpr)),
       this);
 
   // Detect: 'dst.compare(p, n, str.c_str())'  ->  'dst.compare(p, n, str)'
   Finder->addMatcher(
       cxxMemberCallExpr(on(StringExpr),
-          callee(decl(cxxMethodDecl(hasName("compare")))),
-          argumentCountIs(3),
-          hasArgument(2, StringCStrCallExpr)),
+                        callee(decl(cxxMethodDecl(hasName("compare")))),
+                        argumentCountIs(3), hasArgument(2, StringCStrCallExpr)),
       this);
 
   // Detect: 'dst.find(str.c_str())'  ->  'dst.find(str)'
   Finder->addMatcher(
       cxxMemberCallExpr(on(StringExpr),
-          callee(decl(cxxMethodDecl(
-              hasAnyName("find", "find_first_not_of", "find_first_of",
-                         "find_last_not_of", "find_last_of", "rfind")))),
-          anyOf(argumentCountIs(1), argumentCountIs(2)),
-          hasArgument(0, StringCStrCallExpr)),
+                        callee(decl(cxxMethodDecl(hasAnyName(
+                            "find", "find_first_not_of", "find_first_of",
+                            "find_last_not_of", "find_last_of", "rfind")))),
+                        anyOf(argumentCountIs(1), argumentCountIs(2)),
+                        hasArgument(0, StringCStrCallExpr)),
       this);
 
   // Detect: 'dst.insert(pos, str.c_str())'  ->  'dst.insert(pos, str)'
   Finder->addMatcher(
       cxxMemberCallExpr(on(StringExpr),
-          callee(decl(cxxMethodDecl(hasName("insert")))),
-          argumentCountIs(2),
-          hasArgument(1, StringCStrCallExpr)),
+                        callee(decl(cxxMethodDecl(hasName("insert")))),
+                        argumentCountIs(2), hasArgument(1, StringCStrCallExpr)),
       this);
 
   // Detect redundant 'c_str()' calls through a StringRef constructor.
@@ -176,9 +164,8 @@
           // wrt. string types and they internally make a StringRef
           // referring to the argument.  Passing a string directly to
           // them is preferred to passing a char pointer.
-          hasDeclaration(
-              cxxMethodDecl(hasAnyName("::llvm::StringRef::StringRef",
-                                       "::llvm::Twine::Twine"))),
+          hasDeclaration(cxxMethodDecl(hasAnyName(
+              "::llvm::StringRef::StringRef", "::llvm::Twine::Twine"))),
           argumentCountIs(1),
           // The only argument must have the form x.c_str() or p->c_str()
           // where the method is string::c_str().  StringRef also has