[clang-format] Reformat. NFC.
authorMarek Kurdej <marek.kurdej+llvm.org@gmail.com>
Thu, 17 Mar 2022 08:01:37 +0000 (09:01 +0100)
committerMarek Kurdej <marek.kurdej+llvm.org@gmail.com>
Thu, 17 Mar 2022 08:27:31 +0000 (09:27 +0100)
clang/lib/Format/WhitespaceManager.cpp
clang/unittests/Format/FormatTest.cpp
clang/unittests/Format/FormatTestJson.cpp
clang/unittests/Format/MacroExpanderTest.cpp
clang/unittests/Format/NamespaceEndCommentsFixerTest.cpp
clang/unittests/Format/TestLexer.h

index de6cdf4..2dcc4fd 100644 (file)
@@ -1163,9 +1163,8 @@ void WhitespaceManager::alignArrayInitializersLeftJustified(
     auto Offset = std::distance(Cells.begin(), CellIter);
     for (const auto *Next = CellIter->NextColumnElement; Next != nullptr;
          Next = Next->NextColumnElement) {
-      if (RowCount > CellDescs.CellCounts.size()) {
+      if (RowCount > CellDescs.CellCounts.size())
         break;
-      }
       auto *Start = (Cells.begin() + RowCount * CellDescs.CellCounts[0]);
       auto *End = Start + Offset;
       auto ThisNetWidth = getNetWidth(Start, End, CellDescs.InitialSpaces);
index 8ee6040..469252a 100644 (file)
@@ -7217,9 +7217,8 @@ TEST_F(FormatTest, MemoizationTests) {
   OnePerLine.BinPackParameters = false;
   std::string input = "Constructor()\n"
                       "    : aaaa(a,\n";
-  for (unsigned i = 0, e = 80; i != e; ++i) {
+  for (unsigned i = 0, e = 80; i != e; ++i)
     input += "           a,\n";
-  }
   input += "           a) {}";
   verifyFormat(input, OnePerLine);
 }
index 14a4818..e213f6b 100644 (file)
@@ -30,14 +30,12 @@ protected:
     if (Style.isJson() && !Style.DisableFormat) {
       auto Err = Replaces.add(
           tooling::Replacement(tooling::Replacement("", 0, 0, "x = ")));
-      if (Err) {
+      if (Err)
         llvm::errs() << "Bad Json variable insertion\n";
-      }
     }
     auto ChangedCode = applyAllReplacements(Code, Replaces);
-    if (!ChangedCode) {
+    if (!ChangedCode)
       llvm::errs() << "Bad Json varibale replacement\n";
-    }
     StringRef NewCode = *ChangedCode;
 
     std::vector<tooling::Range> Ranges(1, tooling::Range(0, NewCode.size()));
index 7ec98a5..37fa8d1 100644 (file)
@@ -28,9 +28,8 @@ public:
   llvm::SmallVector<TokenList, 1>
   lexArgs(const std::vector<std::string> &Args) {
     llvm::SmallVector<TokenList, 1> Result;
-    for (const auto &Arg : Args) {
+    for (const auto &Arg : Args)
       Result.push_back(uneof(Lex.lex(Arg)));
-    }
     return Result;
   }
 
@@ -78,9 +77,8 @@ protected:
 TEST_F(MacroExpanderTest, SkipsDefinitionOnError) {
   auto Macros =
       create({"A(", "B(,", "C(a,", "D(a a", "E(a, a", "F(,)", "G(a;"});
-  for (const auto *Name : {"A", "B", "C", "D", "E", "F", "G"}) {
+  for (const auto *Name : {"A", "B", "C", "D", "E", "F", "G"})
     EXPECT_FALSE(Macros->defined(Name)) << "for Name " << Name;
-  }
 }
 
 TEST_F(MacroExpanderTest, ExpandsWithoutArguments) {
index 50b861f..342fdd3 100644 (file)
@@ -469,7 +469,8 @@ TEST_F(NamespaceEndCommentsFixerTest, WorksForObjCpp) {
             fixNamespaceEndComments("namespace {\n"
                                     "int i;\n"
                                     "int j;\n"
-                                    "}", ObjCppStyle));
+                                    "}",
+                                    ObjCppStyle));
 }
 
 TEST_F(NamespaceEndCommentsFixerTest, AddsMacroEndComment) {
index ae9818d..a1585fc 100644 (file)
@@ -37,9 +37,8 @@ inline std::ostream &operator<<(std::ostream &Stream, const FormatToken &Tok) {
 }
 inline std::ostream &operator<<(std::ostream &Stream, const TokenList &Tokens) {
   Stream << "{";
-  for (size_t I = 0, E = Tokens.size(); I != E; ++I) {
+  for (size_t I = 0, E = Tokens.size(); I != E; ++I)
     Stream << (I > 0 ? ", " : "") << *Tokens[I];
-  }
   Stream << "} (" << Tokens.size() << " tokens)";
   return Stream;
 }