Index: clang/lib/Format/Format.cpp =================================================================== --- clang/lib/Format/Format.cpp +++ clang/lib/Format/Format.cpp @@ -2988,9 +2988,8 @@ // JSON only needs the formatting passing. if (Style.isJson()) { std::vector Ranges(1, tooling::Range(0, Code.size())); - auto Env = - Environment::make(Code, FileName, Ranges, FirstStartColumn, - NextStartColumn, LastStartColumn); + auto Env = Environment::make(Code, FileName, Ranges, FirstStartColumn, + NextStartColumn, LastStartColumn); if (!Env) return {}; // Perform the actual formatting pass. @@ -3118,9 +3117,7 @@ auto Env = Environment::make(Code, FileName, Ranges); if (!Env) return {}; - return NamespaceEndCommentsFixer(*Env, Style) - .process() - .first; + return NamespaceEndCommentsFixer(*Env, Style).process().first; } tooling::Replacements sortUsingDeclarations(const FormatStyle &Style, @@ -3130,9 +3127,7 @@ auto Env = Environment::make(Code, FileName, Ranges); if (!Env) return {}; - return UsingDeclarationsSorter(*Env, Style) - .process() - .first; + return UsingDeclarationsSorter(*Env, Style).process().first; } LangOptions getFormattingLangOpts(const FormatStyle &Style) { Index: clang/lib/Format/SortJavaScriptImports.cpp =================================================================== --- clang/lib/Format/SortJavaScriptImports.cpp +++ clang/lib/Format/SortJavaScriptImports.cpp @@ -553,9 +553,7 @@ auto Env = Environment::make(Code, FileName, Ranges); if (!Env) return {}; - return JavaScriptImportSorter(*Env, Style) - .process() - .first; + return JavaScriptImportSorter(*Env, Style).process().first; } } // end namespace format Index: clang/lib/Format/TokenAnalyzer.cpp =================================================================== --- clang/lib/Format/TokenAnalyzer.cpp +++ clang/lib/Format/TokenAnalyzer.cpp @@ -37,7 +37,7 @@ // FIXME: Instead of printing the diagnostic we should store it and have a // better way to return errors through the format APIs. -class FatalDiagnosticConsumer: public DiagnosticConsumer { +class FatalDiagnosticConsumer : public DiagnosticConsumer { public: void HandleDiagnostic(DiagnosticsEngine::Level DiagLevel, const Diagnostic &Info) override { @@ -71,7 +71,8 @@ } // Validate that we can get the buffer data without a fatal error. Env->SM.getBufferData(Env->ID); - if (Diags.fatalError()) return nullptr; + if (Diags.fatalError()) + return nullptr; return Env; } @@ -80,8 +81,7 @@ unsigned LastStartColumn) : VirtualSM(new SourceManagerForFile(FileName, Code)), SM(VirtualSM->get()), ID(VirtualSM->get().getMainFileID()), FirstStartColumn(FirstStartColumn), - NextStartColumn(NextStartColumn), LastStartColumn(LastStartColumn) { -} + NextStartColumn(NextStartColumn), LastStartColumn(LastStartColumn) {} TokenAnalyzer::TokenAnalyzer(const Environment &Env, const FormatStyle &Style) : Style(Style), Env(Env), Index: clang/lib/Format/TokenAnnotator.cpp =================================================================== --- clang/lib/Format/TokenAnnotator.cpp +++ clang/lib/Format/TokenAnnotator.cpp @@ -2342,16 +2342,15 @@ if (NextNonCommentLine && CommentLine && NextNonCommentLine->First->NewlinesBefore <= 1 && NextNonCommentLine->First->OriginalColumn == - AL->First->OriginalColumn) { + AL->First->OriginalColumn) { // Align comments for preprocessor lines with the # in column 0 if // preprocessor lines are not indented. Otherwise, align with the next // line. - AL->Level = - (Style.IndentPPDirectives != FormatStyle::PPDIS_BeforeHash && - (NextNonCommentLine->Type == LT_PreprocessorDirective || - NextNonCommentLine->Type == LT_ImportStatement)) - ? 0 - : NextNonCommentLine->Level; + AL->Level = (Style.IndentPPDirectives != FormatStyle::PPDIS_BeforeHash && + (NextNonCommentLine->Type == LT_PreprocessorDirective || + NextNonCommentLine->Type == LT_ImportStatement)) + ? 0 + : NextNonCommentLine->Level; } else { NextNonCommentLine = AL->First->isNot(tok::r_brace) ? AL : nullptr; } Index: clang/lib/Format/WhitespaceManager.cpp =================================================================== --- clang/lib/Format/WhitespaceManager.cpp +++ clang/lib/Format/WhitespaceManager.cpp @@ -913,7 +913,8 @@ Changes[i].StartOfBlockComment->StartOfTokenColumn - Changes[i].StartOfTokenColumn; } - if (Shift < 0) continue; + if (Shift < 0) + continue; Changes[i].Spaces += Shift; if (i + 1 != Changes.size()) Changes[i + 1].PreviousEndOfTokenColumn += Shift; @@ -1269,7 +1270,7 @@ for (unsigned i = 0, e = Changes.size(); i != e; ++i) { const Change &C = Changes[i]; if (i > 0 && Changes[i - 1].OriginalWhitespaceRange.getBegin() == - C.OriginalWhitespaceRange.getBegin()) { + C.OriginalWhitespaceRange.getBegin()) { // Do not generate two replacements for the same location. continue; }