From: Marek Kurdej Date: Thu, 17 Mar 2022 08:01:37 +0000 (+0100) Subject: [clang-format] Reformat. NFC. X-Git-Tag: upstream/15.0.7~13328 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=34ce42fe4de5318176e13e4cb758dfa7a0d8176b;p=platform%2Fupstream%2Fllvm.git [clang-format] Reformat. NFC. --- diff --git a/clang/lib/Format/WhitespaceManager.cpp b/clang/lib/Format/WhitespaceManager.cpp index de6cdf4..2dcc4fd 100644 --- a/clang/lib/Format/WhitespaceManager.cpp +++ b/clang/lib/Format/WhitespaceManager.cpp @@ -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); diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp index 8ee6040..469252a 100644 --- a/clang/unittests/Format/FormatTest.cpp +++ b/clang/unittests/Format/FormatTest.cpp @@ -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); } diff --git a/clang/unittests/Format/FormatTestJson.cpp b/clang/unittests/Format/FormatTestJson.cpp index 14a4818..e213f6b 100644 --- a/clang/unittests/Format/FormatTestJson.cpp +++ b/clang/unittests/Format/FormatTestJson.cpp @@ -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 Ranges(1, tooling::Range(0, NewCode.size())); diff --git a/clang/unittests/Format/MacroExpanderTest.cpp b/clang/unittests/Format/MacroExpanderTest.cpp index 7ec98a5..37fa8d1 100644 --- a/clang/unittests/Format/MacroExpanderTest.cpp +++ b/clang/unittests/Format/MacroExpanderTest.cpp @@ -28,9 +28,8 @@ public: llvm::SmallVector lexArgs(const std::vector &Args) { llvm::SmallVector 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) { diff --git a/clang/unittests/Format/NamespaceEndCommentsFixerTest.cpp b/clang/unittests/Format/NamespaceEndCommentsFixerTest.cpp index 50b861f..342fdd3 100644 --- a/clang/unittests/Format/NamespaceEndCommentsFixerTest.cpp +++ b/clang/unittests/Format/NamespaceEndCommentsFixerTest.cpp @@ -469,7 +469,8 @@ TEST_F(NamespaceEndCommentsFixerTest, WorksForObjCpp) { fixNamespaceEndComments("namespace {\n" "int i;\n" "int j;\n" - "}", ObjCppStyle)); + "}", + ObjCppStyle)); } TEST_F(NamespaceEndCommentsFixerTest, AddsMacroEndComment) { diff --git a/clang/unittests/Format/TestLexer.h b/clang/unittests/Format/TestLexer.h index ae9818d..a1585fc 100644 --- a/clang/unittests/Format/TestLexer.h +++ b/clang/unittests/Format/TestLexer.h @@ -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; }