[PATCH] D115625: [clang-format] add support for cppm files

2021-12-13 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius accepted this revision. curdeius added a comment. LGTM. Comment at: clang/tools/clang-format/clang-format-diff.py:51 r'.*\.(cpp|cc|c\+\+|cxx|c|cl|h|hh|hpp|hxx|m|mm|inc|js|ts' - r'|proto|protodevel|java|cs|json)', +

[PATCH] D115168: [clang-format] [PR49298] Sort includes pass will sort inside raw strings

2021-12-10 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius accepted this revision. curdeius added a comment. This revision is now accepted and ready to land. LGTM. Great! CHANGES SINCE LAST ACTION https://reviews.llvm.org/D115168/new/ https://reviews.llvm.org/D115168 ___ cfe-commits mailing list

[PATCH] D115647: [clang-format] FixNamespaceComments does not understand namespace aliases

2021-12-13 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added inline comments. Comment at: clang/lib/Format/NamespaceEndCommentsFixer.cpp:27 // Returns "" for anonymous namespace. -std::string computeName(const FormatToken *NamespaceTok) { +bool computeName(const FormatToken *NamespaceTok, std::string ) {

[PATCH] D115673: [clang-format] C# switch expression formatting differs from normal switch formatting

2021-12-13 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius accepted this revision. curdeius added a comment. This revision is now accepted and ready to land. LGTM. AFAIK (which is very limited when it comes to C#), the cases can have also other expressions, not only ints and _. But that can be left for a different patch. Example from

[PATCH] D115715: [clang-tidy] Fix llvm-header-guard for Windows paths containing drive letter (e.g. C:).

2021-12-14 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius created this revision. curdeius added reviewers: aaron.ballman, hokein, bkramer, salman-javed-nz, alexfh. Herald added subscribers: carlosgalvezp, xazax.hun. curdeius requested review of this revision. Herald added a project: clang-tools-extra. Herald added a subscriber: cfe-commits.

[PATCH] D115715: [clang-tidy] Fix llvm-header-guard for Windows paths containing drive letter (e.g. C:).

2021-12-14 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added a comment. In D115715#3191742 , @sberg wrote: >> So the check, for a file called e.g. "C:\test\test.h" would suggest the >> guard C:_TEST_TEST_H being an invalid name due to the presence of the colon. > > ...though the new suggestion

[PATCH] D115803: [clang-format] Fix tabs when using BreakBeforeTernaryOperators=false.

2021-12-16 Thread Marek Kurdej via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG27818f01fec2: [clang-format] Fix tabs when using BreakBeforeTernaryOperators=false. (authored by curdeius). Repository: rG LLVM Github Monorepo

[PATCH] D115865: [clang-format] add support for branch attribute macros

2021-12-16 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius accepted this revision. curdeius added a comment. This revision is now accepted and ready to land. LGTM! Tested locally. Has Bolt landed? It seems that the CI adds bolt as the project but it isn't recognized... Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D115903: [clang-format] Extra spaces surrounding arrow in templated member call in variable decl

2021-12-16 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added inline comments. Comment at: clang/lib/Format/TokenAnnotator.cpp:1682 Current.NestingLevel == 0 && - !Current.Previous->is(tok::kw_operator)) { + !Current.Previous->isOneOf(tok::kw_operator, tok::identifier)) { //

[PATCH] D115879: [clang-format] extern with new line brace without indentation

2021-12-16 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius requested changes to this revision. curdeius added inline comments. This revision now requires changes to proceed. Comment at: clang/unittests/Format/FormatTest.cpp:3815 + + Style.IndentExternBlock = FormatStyle::IEBS_AfterExternBlock; + Style.BreakBeforeBraces =

[PATCH] D115794: [clang-format] put non-empty catch block on one line with AllowShortBlocksOnASingleLine: Empty

2021-12-15 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius accepted this revision. curdeius added a comment. LGTM. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D115794/new/ https://reviews.llvm.org/D115794 ___ cfe-commits mailing list

[PATCH] D115803: [clang-format] Fix tabs when using BreakBeforeTernaryOperators=false.

2021-12-15 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius created this revision. curdeius added reviewers: MyDeveloperDay, HazardyKnusperkeks, owenpan. curdeius requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Fixes https://github.com/llvm/llvm-project/issues/52724. This is rather a

[PATCH] D115803: [clang-format] Fix tabs when using BreakBeforeTernaryOperators=false.

2021-12-15 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added a comment. In D115803#3195115 , @MyDeveloperDay wrote: > So am I right in thinking the got replaced out because C.Spaces was > > C.StartOfTokenColumn? (i.e. appendIndentText was given a negative number as > the 4th argument) Yes,

[PATCH] D115168: [clang-format] [PR49298] Sort includes pass will sort inside raw strings

2021-12-06 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added inline comments. Comment at: clang/lib/Format/Format.cpp:2597 +// or we will sort the contents of the string. +// Skip past until we think we we the rawstring literal close. +if (Trimmed.contains("R\"(")) { "we we"?

[PATCH] D115050: [clang-format] PR48916 PointerAlignment not working when using C++20 init-statement in for loop

2021-12-09 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius accepted this revision. curdeius added a comment. This revision is now accepted and ready to land. LGTM! Thanks. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D115050/new/ https://reviews.llvm.org/D115050 ___ cfe-commits mailing list

[PATCH] D115647: [clang-format] FixNamespaceComments does not understand namespace aliases

2021-12-13 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius accepted this revision. curdeius added a comment. This revision is now accepted and ready to land. LGTM! CHANGES SINCE LAST ACTION https://reviews.llvm.org/D115647/new/ https://reviews.llvm.org/D115647 ___ cfe-commits mailing list

[PATCH] D106112: [clang-format] Break an unwrapped line at a K C parameter decl

2021-07-19 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius accepted this revision. curdeius added a comment. In D106112#2885604 , @owenpan wrote: > I just reviewed the differences between K C (circa 1978) and ANSI/ISO C > again and didn't see anything else that would impact clang-format, so a new >

[PATCH] D106112: [clang-format] Break an unwrapped line at a K C parameter decl

2021-07-16 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added a comment. Looks okay, but I was wondering if we don't want to guard all K changes behind e.g. ```Standard: Cpp78``, so as not to possibly introduce strange bugs in newer modes. It may be an overkill if there are 2 patches like this, but if there are more, that might become

[PATCH] D106773: [clang-format] Fix aligning with linebreaks #2

2021-07-26 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius accepted this revision. curdeius added a comment. This revision is now accepted and ready to land. LGTM! That was quick! Thanks. Please wait for @baramin to validate the fix before landing. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D69764: [clang-format] Add East/West Const fixer capability

2021-07-14 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added a comment. I've been trying to make my opinion on this patch for the last few weeks... I was pretty much opposed to introducing non-whitespace chances previously, but I'm reviewing my standpoint. As mentioned already, there are precedents (include sorting, namespace comments,

[PATCH] D105964: [clang-format] Make AlwaysBreakAfterReturnType work with K C function definitions

2021-07-14 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius accepted this revision. curdeius added a comment. LGTM. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D105964/new/ https://reviews.llvm.org/D105964 ___ cfe-commits mailing list

[PATCH] D99840: [clang-format] Correctly attach enum braces with ShortEnums disabled

2021-07-28 Thread Marek Kurdej via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG71616722d409: [clang-format] Correctly attach enum braces with ShortEnums disabled (authored by lunasorcery, committed by curdeius). Changed prior to commit:

[PATCH] D116527: [clang-format] Fix indentation for array variables with alignment of consecutive assignments and declarations.

2022-01-04 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius updated this revision to Diff 397265. curdeius added a comment. Reverted test changes. Checking for identifier before brace. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D116527/new/ https://reviews.llvm.org/D116527 Files:

[PATCH] D116592: [clang-format] Missing space after cast in a macro

2022-01-04 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius accepted this revision. curdeius added a comment. This revision is now accepted and ready to land. LGTM. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D116592/new/ https://reviews.llvm.org/D116592

[PATCH] D116806: [clang-format] Ensure we can correctly parse lambda in the template argument list

2022-01-07 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius accepted this revision. curdeius added a comment. This revision is now accepted and ready to land. LGTM. Comment at: clang/unittests/Format/FormatTest.cpp:23171 + verifyFormat("struct Z : X {};", Style); + verifyFormat("template struct X {};", Style); +}

[PATCH] D116726: [clang-format] Fix a crash (assertion) in qualifier alignment when matching template closer is null

2022-01-06 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added inline comments. Comment at: clang/unittests/Format/QualifierFixerTest.cpp:830 + verifyFormat("template using A = quantity, 1>;", Style); + verifyFormat("template using A = quantity /**/, 1>;", + Style); Could you test with a

[PATCH] D116726: [clang-format] Fix a crash (assertion) in qualifier alignment when matching template closer is null

2022-01-06 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added inline comments. Comment at: clang/unittests/Format/QualifierFixerTest.cpp:830 + verifyFormat("template using A = quantity, 1>;", Style); + verifyFormat("template using A = quantity /**/, 1>;", + Style); curdeius wrote: >

[PATCH] D116920: [clang-format] clang-format eats space in front of attributes for operator delete

2022-01-10 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added inline comments. Comment at: clang/lib/Format/TokenAnnotator.cpp:1729 } else if (Current.is(tok::r_paren)) { if (rParenEndsCast(Current)) Current.setType(TT_CastRParen); The current solution looks a bit like a hack to me.

[PATCH] D99031: [clang-format] Fix CompactNamespaces corner case when AllowShortLambdasOnASingleLine/BraceWrapping.BeforeLambdaBody are set

2022-01-10 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added a comment. @aybassiouny, still interested in working on this? CHANGES SINCE LAST ACTION https://reviews.llvm.org/D99031/new/ https://reviews.llvm.org/D99031 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D94955: [clang-format] Treat ForEachMacros as loops

2022-01-10 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added a comment. @GoBigorGoHome, are you still interested in this review? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D94955/new/ https://reviews.llvm.org/D94955 ___ cfe-commits mailing list

[PATCH] D116859: Fix for: clang-format: break added to macro define with ColumnLimit: 0

2022-01-10 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added inline comments. Comment at: clang/unittests/Format/FormatTest.cpp:4810-4811 + + verifyFormat("#define STRINGIFY(t) #t\n" + "#define MAKEVERSIONSTRING(x, y, z, build) STRINGIFY(x) \".\" STRINGIFY(y) \".\" STRINGIFY(z) \".\" STRINGIFY(build)\n", +

[PATCH] D116859: Fix for: clang-format: break added to macro define with ColumnLimit: 0

2022-01-10 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added inline comments. Comment at: clang/unittests/Format/FormatTest.cpp:4810-4811 + + verifyFormat("#define STRINGIFY(t) #t\n" + "#define MAKEVERSIONSTRING(x, y, z, build) STRINGIFY(x) \".\" STRINGIFY(y) \".\" STRINGIFY(z) \".\" STRINGIFY(build)\n", +

[PATCH] D116920: [clang-format] clang-format eats space in front of attributes for operator delete

2022-01-10 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added inline comments. Comment at: clang/unittests/Format/FormatTest.cpp:9463 + + verifyFormat("void operator delete(void *foo) ATTRIB;"); + verifyFormat("void operator new(void *foo) ATTRIB;"); Please add a test for `operator delete[]`. Repository:

[PATCH] D116859: [clang-format] Fix break being added to macro define with ColumnLimit: 0

2022-01-13 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added a comment. @MyDeveloperDay, do you have any more objections? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D116859/new/ https://reviews.llvm.org/D116859 ___ cfe-commits mailing list

[PATCH] D117142: [clang-format] Fix short functions being considered as inline inside an indented namespace.

2022-01-14 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius updated this revision to Diff 399946. curdeius added a comment. Rebase to fix Windows CI. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D117142/new/ https://reviews.llvm.org/D117142 Files: clang/lib/Format/UnwrappedLineFormatter.cpp

[PATCH] D116316: [clang-format] Add an experimental option to remove optional control statement braces in LLVM C++ code

2022-01-14 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius accepted this revision. curdeius added a comment. This revision is now accepted and ready to land. LGTM. Comment at: clang/docs/ClangFormatStyleOptions.rst:3398 +**RemoveBracesLLVM** (``Boolean``) :versionbadge:`clang-format 14` + Remove optional braces of control

[PATCH] D117289: [clang-format] Fix namespace end comments fixer with anonymous namespaces.

2022-01-14 Thread Marek Kurdej via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG717cd16e85fa: [clang-format] Fix namespace end comments fixer with anonymous namespaces. (authored by curdeius). Repository: rG LLVM Github

[PATCH] D117142: [clang-format] Fix short functions being considered as inline inside an indented namespace.

2022-01-14 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius updated this revision to Diff 399945. curdeius added a comment. Minor clean up. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D117142/new/ https://reviews.llvm.org/D117142 Files: clang/lib/Format/UnwrappedLineFormatter.cpp

[PATCH] D99031: [clang-format] Fix CompactNamespaces corner case when AllowShortLambdasOnASingleLine/BraceWrapping.BeforeLambdaBody are set

2022-01-14 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius commandeered this revision. curdeius edited reviewers, added: aybassiouny; removed: curdeius. curdeius added a comment. This bug is not present in clang-format 13 (nor master), but was there in v12. I'll commandeer this revision to keep the regression tests. CHANGES SINCE LAST ACTION

[PATCH] D116859: [clang-format] Fix break being added to macro define with ColumnLimit: 0

2022-01-13 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added inline comments. Comment at: clang/unittests/Format/FormatTest.cpp:19610 getLLVMStyleWithColumns(35)); - verifyFormat("\"一 二 三 四 五 六 七 八 九 十\"", - getLLVMStyleWithColumns(31)); + verifyFormat("\"一 二 三 四 五 六 七 八 九 十\"",

[PATCH] D117289: [clang-format] Fix namespace end comments fixer with anonymous namespaces.

2022-01-14 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius created this revision. curdeius added reviewers: MyDeveloperDay, HazardyKnusperkeks, owenpan. curdeius requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Previously, a strange trailing comment was produced: namespace out {

[PATCH] D99031: [clang-format] Fix CompactNamespaces corner case when AllowShortLambdasOnASingleLine/BraceWrapping.BeforeLambdaBody are set

2022-01-14 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius updated this revision to Diff 399926. curdeius added a comment. Keep tests only. Clean up. Rebase. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D99031/new/ https://reviews.llvm.org/D99031 Files: clang/unittests/Format/FormatTest.cpp

[PATCH] D116859: [clang-format] Fix break being added to macro define with ColumnLimit: 0

2022-01-13 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added inline comments. Comment at: clang/unittests/Format/FormatTest.cpp:4810 + + verifyFormat("#define A LOOONG() LOOONG()\n", + ZeroColumn); futuarmo wrote: > owenpan wrote: > > Please remove the newline

[PATCH] D116859: [clang-format] Fix break being added to macro define with ColumnLimit: 0

2022-01-13 Thread Marek Kurdej via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG47a9eb2117aa: [clang-format] Fix break being added to macro define with ColumnLimit: 0 (authored by futuarmo, committed by curdeius). Changed prior to commit:

[PATCH] D116920: [clang-format] clang-format eats space in front of attributes for operator delete

2022-01-11 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius accepted this revision. curdeius added a comment. This revision is now accepted and ready to land. LGTM. Don't forget to reformat. It's a pity though that we cannot use `MightBeFunctionDecl`. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D116920/new/

[PATCH] D117142: [clang-format] Fix short functions being considered as inline inside an indented namespace.

2022-01-12 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added a comment. Still WIP but I'd like to have some feedback. Comment at: clang/lib/Format/UnwrappedLineFormatter.cpp:283 + + // FIXME: Use IndentTracker to avoid loop? + // Find the last line with lower level. Because of

[PATCH] D116859: [clang-format] Fix break being added to macro define with ColumnLimit: 0

2022-01-12 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius accepted this revision. curdeius added a comment. LGTM. Thanks for working on this! But before landing, please retest the original misformatted code from the bug report with a freshly built clang-format. Also, do you have commit rights? If not, do you want someone to land it on your

[PATCH] D117142: [clang-format] Fix short functions being considered as inline inside an indented namespace.

2022-01-12 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius created this revision. curdeius added reviewers: MyDeveloperDay, HazardyKnusperkeks, owenpan. curdeius requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Fixes https://github.com/llvm/llvm-project/issues/24784. With config:

[PATCH] D117142: [clang-format] Fix short functions being considered as inline inside an indented namespace.

2022-01-12 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added inline comments. Comment at: clang/lib/Format/UnwrappedLineFormatter.cpp:278 +// Just checking TheLine->Level != 0 is not enough, because it +// provokes treating functions inside intended namespaces as short. +if ((*I)->Level

[PATCH] D115060: [clang-format][NFC] Code Tidies in UnwrappedLineFormatter

2022-01-17 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius accepted this revision. curdeius added a comment. LGTM. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D115060/new/ https://reviews.llvm.org/D115060 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D117421: [clang-format] Fix incorrect alignment of operator= overloads.

2022-01-17 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added inline comments. Comment at: clang/lib/Format/WhitespaceManager.cpp:735 +// Do not align operator= overloads. +if (C.Tok->Previous && C.Tok->Previous->is(tok::kw_operator)) { + FormatToken *Next = C.Tok->Next; This should

[PATCH] D117421: [clang-format] Fix incorrect alignment of operator= overloads.

2022-01-17 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added a comment. Could you check if your patch fixes https://github.com/llvm/llvm-project/issues/33044 as well? If so, please add tests. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D117421/new/ https://reviews.llvm.org/D117421

[PATCH] D117421: [clang-format] Fix incorrect alignment of operator= overloads.

2022-01-17 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added a comment. With your patch I still see the bug in this case: struct S { constexpr S(const S &) = default; void f() = default; S /**/=(S) {} }; Mind the `operator =`. It happens every time that `operator=` has only declaration (no definition

[PATCH] D117421: [clang-format] Fix incorrect alignment of operator= overloads.

2022-01-17 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added inline comments. Comment at: clang/lib/Format/WhitespaceManager.cpp:735-742 +if (C.Tok->Previous && C.Tok->Previous->is(tok::kw_operator)) { + FormatToken *Next = C.Tok->Next; + while (Next && Next->NewlinesBefore == 0) { +if

[PATCH] D117414: [clang-format] Add return code to git-clang-format

2022-01-16 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius accepted this revision. curdeius added a comment. This revision is now accepted and ready to land. LGTM! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D117414/new/ https://reviews.llvm.org/D117414

[PATCH] D117416: [clang-format] Handle C variables with name that matches c++ access specifier

2022-01-16 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added a comment. Does it fix https://github.com/llvm/llvm-project/issues/46915? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D117416/new/ https://reviews.llvm.org/D117416 ___ cfe-commits

[PATCH] D94955: [clang-format] Treat ForEachMacros as loops

2022-01-17 Thread Marek Kurdej via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG1e512f022ad5: [clang-format] Treat ForEachMacros as loops (authored by curdeius). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D117416: [clang-format] Handle C variables with name that matches c++ access specifier

2022-01-16 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius requested changes to this revision. curdeius added a comment. Thanks for having a try on this. However, I don't like this approach too much. You add many changes and a single test. That's not sufficient. Also, handling C++ keywords in all cases (e.g. `delete` as a function name) *may*

[PATCH] D117398: [clang-format] Fix bug in parsing `operator<` with template

2022-01-17 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added inline comments. Comment at: clang/lib/Format/FormatTokenLexer.cpp:432 + auto Forth = (Tokens.end() - 4)[0]; bool FourthTokenIsLess = false; MyDeveloperDay wrote: > isn't this going to crash if Tokens.size() is 3? It probably will. Anyway,

[PATCH] D117421: [clang-format] Fix incorrect alignment of operator= overloads.

2022-01-17 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added a comment. In D117421#3249126 , @glotchimo wrote: > I was tinkering with the use of `getPreviousNonComment` last night before > signing off and the problem that I noticed was that, though it stops the > `operator=` from being split and

[PATCH] D116795: [clang-format] Use range-for loops. NFC.

2022-01-07 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius created this revision. curdeius added reviewers: MyDeveloperDay, HazardyKnusperkeks, owenpan. curdeius requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D116795 Files:

[PATCH] D116767: [clang-format] Fix `BraceWrapping: AfterFunction` affecting synchronized blocks in Java.

2022-01-07 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added a comment. Thanks for the reviews! Comment at: clang/lib/Format/UnwrappedLineParser.cpp:1528 // for them (the one we know is missing are lambdas). -if (Style.BraceWrapping.AfterFunction) +if ((Style.Language == FormatStyle::LK_Java) && +

[PATCH] D116767: [clang-format] Fix `BraceWrapping: AfterFunction` affecting synchronized blocks in Java.

2022-01-07 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added inline comments. Comment at: clang/lib/Format/UnwrappedLineParser.cpp:1528 // for them (the one we know is missing are lambdas). -if (Style.BraceWrapping.AfterFunction) +if ((Style.Language == FormatStyle::LK_Java) && +

[PATCH] D116795: [clang-format] Use range-for loops. NFC.

2022-01-07 Thread Marek Kurdej via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG01f355fe95f6: [clang-format] Use range-for loops. NFC. (authored by curdeius). Changed prior to commit: https://reviews.llvm.org/D116795?vs=398060=398071#toc Repository: rG LLVM Github Monorepo

[PATCH] D116767: [clang-format] Fix `BraceWrapping: AfterFunction` affecting synchronized blocks in Java.

2022-01-07 Thread Marek Kurdej via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG91b9e6729c11: [clang-format] Fix `BraceWrapping: AfterFunction` affecting synchronized blocks… (authored by curdeius). Changed prior to commit: https://reviews.llvm.org/D116767?vs=397987=398074#toc

[PATCH] D119648: [clang-format] Fix PointerAlignment within lambdas in a multi-variable declaration statement.

2022-02-13 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added inline comments. Comment at: clang/unittests/Format/FormatTest.cpp:8415-8417 + verifyFormat("if (int *p, *q; p != q) {\n p = p->next;\n}", Style); + verifyFormat("/*comment*/ if (int *p, *q; p != q) {\n p = p->next;\n}", + Style);

[PATCH] D119814: [clang-format] Honour PointerAlignment in statements with initializers.

2022-02-15 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius created this revision. curdeius added reviewers: MyDeveloperDay, HazardyKnusperkeks, owenpan. curdeius requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Fixes https://github.com/llvm/llvm-project/issues/53843. Repository: rG

[PATCH] D119785: [clang-format] Fix formatting of struct-like records followed by variable declaration.

2022-02-15 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added inline comments. Comment at: clang/lib/Format/UnwrappedLineFormatter.cpp:470 +ShouldMerge = Style.AllowShortEnumsOnASingleLine; + } else if (TheLine->Last->isOneOf(TT_ClassLBrace, TT_StructLBrace)) { +// NOTE: We use AfterClass (whereas

[PATCH] D119785: [clang-format] Fix formatting of struct-like records followed by variable declaration.

2022-02-15 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added inline comments. Comment at: clang/lib/Format/UnwrappedLineFormatter.cpp:718 if (Line.Last->is(tok::l_brace)) { FormatToken *Tok = I[1]->First; @MyDeveloperDay, probably we'll need to check `LastNonComment` similarly to what I did

[PATCH] D119785: [clang-format] Fix formatting of struct-like records followed by variable declaration.

2022-02-14 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius created this revision. curdeius added reviewers: MyDeveloperDay, HazardyKnusperkeks, owenpan. curdeius requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Fixes https://github.com/llvm/llvm-project/issues/24781. Fixes

[PATCH] D119785: [clang-format] Fix formatting of struct-like records followed by variable declaration.

2022-02-14 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius updated this revision to Diff 408629. curdeius added a comment. Remove unused. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D119785/new/ https://reviews.llvm.org/D119785 Files: clang/lib/Format/FormatToken.h

[PATCH] D119814: [clang-format] Honour PointerAlignment in statements with initializers.

2022-02-15 Thread Marek Kurdej via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGe21db15be812: [clang-format] Honour PointerAlignment in statements with initializers. (authored by curdeius). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D119785: [clang-format] Fix formatting of struct-like records followed by variable declaration.

2022-02-15 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added inline comments. Comment at: clang/lib/Format/UnwrappedLineFormatter.cpp:735 // We don't merge short records. -FormatToken *RecordTok = Line.First; -// Skip record modifiers. -while (RecordTok->Next && -

[PATCH] D119419: [clang-format] Do not remove required spaces when aligning tokens.

2022-02-10 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius created this revision. curdeius added reviewers: MyDeveloperDay, HazardyKnusperkeks, owenpan. curdeius requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Fixes https://github.com/llvm/llvm-project/issues/44292. Fixes

[PATCH] D119419: [clang-format] Do not remove required spaces when aligning tokens.

2022-02-10 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius updated this revision to Diff 407442. curdeius marked 3 inline comments as done. curdeius added a comment. Address review comments. Add a fixme note. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D119419/new/

[PATCH] D119419: [clang-format] Do not remove required spaces when aligning tokens.

2022-02-10 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added inline comments. Comment at: clang/lib/Format/WhitespaceManager.cpp:334-337 + if (Changes[i].NewlinesBefore == 0) +Changes[i].Spaces = +std::max(Changes[i].Spaces, + static_cast(Changes[i].Tok->SpacesRequiredBefore));

[PATCH] D119649: [clang-format] Correctly format loops and `if` statements even if preceded with comments.

2022-02-13 Thread Marek Kurdej via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG9cb944597907: [clang-format] Correctly format loops and `if` statements even if preceded with… (authored by curdeius). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D119648: [clang-format] Fix PointerAlignment within lambdas in a multi-variable declaration statement.

2022-02-13 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius updated this revision to Diff 408289. curdeius marked an inline comment as done. curdeius added a comment. Rebased. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D119648/new/ https://reviews.llvm.org/D119648 Files:

[PATCH] D119680: [clang-format] Fix SpacesInLineCommentPrefix deleting tokens.

2022-02-13 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius created this revision. curdeius added reviewers: MyDeveloperDay, HazardyKnusperkeks, owenpan. curdeius requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Fixes https://github.com/llvm/llvm-project/issues/53799. Repository: rG

[PATCH] D119680: [clang-format] Fix SpacesInLineCommentPrefix deleting tokens.

2022-02-13 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added a comment. I thought about using signed ints for Minimum and Maximum in the style, but then, we won't be able to use `-1` for Maximum the same way as now and signed int makes no sense for Minimum... Comment at: clang/lib/Format/BreakableToken.cpp:799-800 +

[PATCH] D119650: [clang-format] Handle PointerAlignment in `if` and `switch` statements with initializers (C++17) the same way as in `for` loops.

2022-02-13 Thread Marek Kurdej via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. curdeius marked 2 inline comments as done. Closed by commit rG25282bd6c4bf: [clang-format] Handle PointerAlignment in `if` and `switch` statements with… (authored by curdeius). Changed prior to commit:

[PATCH] D120902: [clang-format] Fix assertion failure/crash with `AllowShortFunctionsOnASingleLine: Inline/InlineOnly`.

2022-03-07 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius updated this revision to Diff 413380. curdeius added a comment. Safer condition. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D120902/new/ https://reviews.llvm.org/D120902 Files: clang/lib/Format/UnwrappedLineFormatter.cpp

[PATCH] D120931: [clang-format] fix namepsace format when the name is macro expansion

2022-03-04 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added a comment. Please update the summary, the name is no longer empty. Also, if you can add some info in the summary about how it looked before (copying a part of the Chromium bug report seems enough), it would be awesome. Otherwise, some small comments only.

[PATCH] D120902: [clang-format] Fix assertion failure/crash with `AllowShortFunctionsOnASingleLine: Inline/InlineOnly`.

2022-03-07 Thread Marek Kurdej via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGd03e342803df: [clang-format] Fix assertion failure/crash with… (authored by curdeius). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D120902/new/

[PATCH] D121042: [clang-format] Handle goto labels for RemoveBracesLLVM

2022-03-05 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius accepted this revision. curdeius added a comment. This revision is now accepted and ready to land. Looks good. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D121042/new/ https://reviews.llvm.org/D121042

[PATCH] D121136: [clang-format] Correctly detect `!` as TT_NonNullAssertion after `default`.

2022-03-07 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius updated this revision to Diff 413543. curdeius added a comment. Add test from the bug report. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D121136/new/ https://reviews.llvm.org/D121136 Files: clang/lib/Format/TokenAnnotator.cpp

[PATCH] D121132: [clang-format] Handle C# 9 `init` accessor specifier.

2022-03-07 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius updated this revision to Diff 413539. curdeius added a comment. Handle init in same places as get and set. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D121132/new/ https://reviews.llvm.org/D121132 Files: clang/lib/Format/FormatToken.h

[PATCH] D121132: [clang-format] Handle C# 9 `init` accessor specifier.

2022-03-07 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius created this revision. curdeius added reviewers: MyDeveloperDay, HazardyKnusperkeks, owenpan. Herald added a project: All. curdeius requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Before, the code: int Value { get; } = 0; int

[PATCH] D121136: [clang-format] Correctly detect `!` as TT_NonNullAssertion after `default`.

2022-03-07 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius created this revision. curdeius added reviewers: MyDeveloperDay, HazardyKnusperkeks, owenpan. Herald added a project: All. curdeius requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Fixes

[PATCH] D121132: [clang-format] Handle C# 9 `init` accessor specifier.

2022-03-07 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius updated this revision to Diff 413525. curdeius added a comment. Rename. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D121132/new/ https://reviews.llvm.org/D121132 Files: clang/lib/Format/FormatToken.h

[PATCH] D121132: [clang-format] Handle C# 9 `init` accessor specifier.

2022-03-07 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added inline comments. Comment at: clang/lib/Format/TokenAnnotator.cpp:4244 Keywords.kw_readonly, Keywords.kw_override, Keywords.kw_abstract, -Keywords.kw_get, Keywords.kw_set, Keywords.kw_async, -Keywords.kw_await)) +

[PATCH] D121451: [clang-format] Add space to comments starting with '#'.

2022-03-11 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius created this revision. curdeius added reviewers: MyDeveloperDay, HazardyKnusperkeks, owenpan. Herald added a project: All. curdeius requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Fixes

[PATCH] D121450: [clang-format] Handle attributes before case label.

2022-03-11 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius created this revision. curdeius added reviewers: MyDeveloperDay, HazardyKnusperkeks, owenpan. Herald added a project: All. curdeius requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Fixes

[PATCH] D121451: [clang-format] Add space to comments starting with '#'.

2022-03-11 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added a comment. I'm not sure whether we should consider this a breaking change, there were no tests at all verifying this behaviour. I think that not adding a space in comments starting with a punctuation is a mistake unless for some special comments like `///`, `//!` etc. (which are

[PATCH] D121456: [clang-format] Correctly format variable templates.

2022-03-11 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius created this revision. curdeius added reviewers: MyDeveloperDay, HazardyKnusperkeks, owenpan, cjdb. Herald added a project: All. curdeius requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Fixes

[PATCH] D121136: [clang-format] Correctly detect `!` as TT_NonNullAssertion after `default`.

2022-03-08 Thread Marek Kurdej via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGf537a409160d: [clang-format] Correctly detect `!` as TT_NonNullAssertion after `default`. (authored by curdeius). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D121132: [clang-format] Handle C# 9 `init` accessor specifier.

2022-03-08 Thread Marek Kurdej via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG7a54fceb2562: [clang-format] Handle C# 9 `init` accessor specifier. (authored by curdeius). Changed prior to commit: https://reviews.llvm.org/D121132?vs=413539=413763#toc Repository: rG LLVM Github

[PATCH] D121558: [clang-format][NFC] Left renamed to OpeningBrace...

2022-03-13 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius accepted this revision. curdeius added a comment. This revision is now accepted and ready to land. LGTM! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D121558/new/ https://reviews.llvm.org/D121558

[PATCH] D121550: [clang-format] Fix crash on invalid requires expression

2022-03-13 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added a comment. LGTM. And thanks for splitting the patch. Comment at: clang/unittests/Format/TokenAnnotatorTest.cpp:335 + + // Invalid Code, but we don't want to crash. See http://llvm.org/PR54350. + Tokens = annotate("bool r10 = requires (struct new_struct { int

[PATCH] D121450: [clang-format] Handle attributes before case label.

2022-03-13 Thread Marek Kurdej via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. curdeius marked 2 inline comments as done. Closed by commit rG596fa2d90044: [clang-format] Handle attributes before case label. (authored by curdeius). Changed prior to commit:

<    1   2   3   4   5   6   7   8   9   >