[clang-format] Reformat. NFC.

This commit is contained in:
Marek Kurdej 2022-03-17 09:01:37 +01:00
parent 2f1d918c0b
commit 34ce42fe4d
6 changed files with 9 additions and 15 deletions

View 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);

View 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);
}

View 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()));

View 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) {

View File

@ -469,7 +469,8 @@ TEST_F(NamespaceEndCommentsFixerTest, WorksForObjCpp) {
fixNamespaceEndComments("namespace {\n"
"int i;\n"
"int j;\n"
"}", ObjCppStyle));
"}",
ObjCppStyle));
}
TEST_F(NamespaceEndCommentsFixerTest, AddsMacroEndComment) {

View 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;
}