[PATCH] D93846: [clang-format] PR16518 Add flag to suppress empty line insertion before access modifier

2021-01-25 Thread Albertas Vyšniauskas via Phabricator via cfe-commits
thezbyg updated this revision to Diff 319057. thezbyg added a comment. Remove redundant line. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D93846/new/ https://reviews.llvm.org/D93846 Files: clang/docs/ClangFormatStyleOptions.rst clang/include/

[PATCH] D93846: [clang-format] PR16518 Add flag to suppress empty line insertion before access modifier

2021-01-25 Thread Albertas Vyšniauskas via Phabricator via cfe-commits
thezbyg marked an inline comment as done. thezbyg added a comment. Yes, I do not have commit access and would like for someone to commit/push this change. My name and email is `Albertas Vyšniauskas `. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D9

[PATCH] D93846: Add flag to suppress empty line insertion before access modifier

2020-12-27 Thread Albertas Vyšniauskas via Phabricator via cfe-commits
thezbyg created this revision. thezbyg added a reviewer: MyDeveloperDay. thezbyg requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Add new option called InsertEmptyLineBeforeAccessModifier. Empty line before access modifier is inserted if th

[PATCH] D93846: [clang-format] PR16518 Add flag to suppress empty line insertion before access modifier

2020-12-28 Thread Albertas Vyšniauskas via Phabricator via cfe-commits
thezbyg updated this revision to Diff 313863. thezbyg added a comment. Option renamed to EmptyLineBeforeAccessModifier. Placed new configuration member in correct place alphabetically. Last token in previous line is no longer checked when EmptyLineBeforeAccessModifier is false. Executed clang/doc

[PATCH] D93846: [clang-format] PR16518 Add flag to suppress empty line insertion before access modifier

2020-12-28 Thread Albertas Vyšniauskas via Phabricator via cfe-commits
thezbyg marked 10 inline comments as done. thezbyg added inline comments. Comment at: clang/lib/Format/UnwrappedLineFormatter.cpp:1220 + if (Style.InsertEmptyLineBeforeAccessModifier && PreviousLine && + PreviousLine->Last->isOneOf(tok::semi, tok::r_brace) && RootTok

[PATCH] D93846: [clang-format] PR16518 Add flag to suppress empty line insertion before access modifier

2020-12-28 Thread Albertas Vyšniauskas via Phabricator via cfe-commits
thezbyg added inline comments. Comment at: clang/unittests/Format/FormatTest.cpp:8544-8556 + EXPECT_EQ("struct foo {\n" +" int i;\n" +"\n" +"private:\n" +" int j;\n" +"}\n", +format("struct foo {\n" --

[PATCH] D93846: [clang-format] PR16518 Add flag to suppress empty line insertion before access modifier

2020-12-29 Thread Albertas Vyšniauskas via Phabricator via cfe-commits
thezbyg updated this revision to Diff 313973. thezbyg added a comment. Switched to verifyFormat in most of the tests. Rerun clang-format. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D93846/new/ https://reviews.llvm.org/D93846 Files: clang/docs/ClangFormatStyleOptions.rst clang/inc

[PATCH] D93846: [clang-format] PR16518 Add flag to suppress empty line insertion before access modifier

2020-12-30 Thread Albertas Vyšniauskas via Phabricator via cfe-commits
thezbyg updated this revision to Diff 314129. thezbyg marked 3 inline comments as done. thezbyg added a comment. Added missing full stop. Executed clang/doc/tools/dump_style.py to update ClangFormatStyleOptions.rst. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D93846/new/ https://review

[PATCH] D93846: [clang-format] PR16518 Add flag to suppress empty line insertion before access modifier

2020-12-31 Thread Albertas Vyšniauskas via Phabricator via cfe-commits
thezbyg marked 2 inline comments as done. thezbyg added a comment. After some updating, rebuilding and searching for differences in Objective-C++ formatting, I managed to find where the problem with these failing tests is. In **_verifyFormat** function C++ code formatting is tested for stability

[PATCH] D93846: [clang-format] PR16518 Add flag to suppress empty line insertion before access modifier

2021-01-01 Thread Albertas Vyšniauskas via Phabricator via cfe-commits
thezbyg added a comment. When access modifier is in the same line with previous tokens, **UnwrappedLineFormatter::formatFirstToken** is called with **RootToken.NewlinesBefore** == 0, but empty line is only inserted if **RootToken.NewlinesBefore** == 1. The following change fixes this and passes

[PATCH] D93846: [clang-format] PR16518 Add flag to suppress empty line insertion before access modifier

2021-01-04 Thread Albertas Vyšniauskas via Phabricator via cfe-commits
thezbyg marked an inline comment as done. thezbyg added inline comments. Comment at: clang/lib/Format/UnwrappedLineFormatter.cpp:1221 +if (Style.EmptyLineBeforeAccessModifier && +PreviousLine->Last->isOneOf(tok::semi, tok::r_brace) && +RootToken.NewlinesBefore

[PATCH] D93846: [clang-format] PR16518 Add flag to suppress empty line insertion before access modifier

2021-01-05 Thread Albertas Vyšniauskas via Phabricator via cfe-commits
thezbyg marked an inline comment as done. thezbyg added inline comments. Comment at: clang/lib/Format/UnwrappedLineFormatter.cpp:1221 +if (Style.EmptyLineBeforeAccessModifier && +PreviousLine->Last->isOneOf(tok::semi, tok::r_brace) && +RootToken.NewlinesBefore

[PATCH] D93846: [clang-format] PR16518 Add flag to suppress empty line insertion before access modifier

2021-01-06 Thread Albertas Vyšniauskas via Phabricator via cfe-commits
thezbyg updated this revision to Diff 314962. thezbyg added a comment. Switched `EmptyLineBeforeAccessModifierStyle` option from bool to enum. `EmptyLineBeforeAccessModifierStyle` option can now have one of four values: `Never`, `DontModify`, `LogicalBlock`, `Always`. `Never` removes all empty li

[PATCH] D93846: [clang-format] PR16518 Add flag to suppress empty line insertion before access modifier

2021-01-09 Thread Albertas Vyšniauskas via Phabricator via cfe-commits
thezbyg updated this revision to Diff 315578. thezbyg added a comment. Diff updated. Previous diff was generated after rebase, and Phabricator change preview did not show any unrelated changes, so I thought that everything is fine. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D93846/ne

[PATCH] D93846: [clang-format] PR16518 Add flag to suppress empty line insertion before access modifier

2021-01-13 Thread Albertas Vyšniauskas via Phabricator via cfe-commits
thezbyg updated this revision to Diff 316446. thezbyg added a comment. Rebased changes on master. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D93846/new/ https://reviews.llvm.org/D93846 Files: clang/docs/ClangFormatStyleOptions.rst clang/incl

[PATCH] D93846: [clang-format] PR16518 Add flag to suppress empty line insertion before access modifier

2021-01-13 Thread Albertas Vyšniauskas via Phabricator via cfe-commits
thezbyg updated this revision to Diff 316511. thezbyg added a comment. Renamed DontModify enum to Leave. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D93846/new/ https://reviews.llvm.org/D93846 Files: clang/docs/ClangFormatStyleOptions.rst cla

[PATCH] D93846: [clang-format] PR16518 Add flag to suppress empty line insertion before access modifier

2021-01-14 Thread Albertas Vyšniauskas via Phabricator via cfe-commits
thezbyg updated this revision to Diff 316660. thezbyg added a comment. Improved default style tests. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D93846/new/ https://reviews.llvm.org/D93846 Files: clang/docs/ClangFormatStyleOptions.rst clang/i