[PATCH] D113319: [clang-format] Improve require and concept handling

2022-02-24 Thread Björn Schäpers via Phabricator via cfe-commits
HazardyKnusperkeks added a comment. In D113319#3339801 , @curdeius wrote: > Yep, confirmed, but I don't know how to fix it. > Just removing `TT_BinaryOperator` from `resetTokenMetadata` provokes these > failures: > > [ FAILED ] FormatTest.Concepts >

[PATCH] D113319: [clang-format] Improve require and concept handling

2022-02-23 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added a comment. Yep, confirmed, but I don't know how to fix it. Just removing `TT_BinaryOperator` from `resetTokenMetadata` provokes these failures: [ FAILED ] FormatTest.Concepts [ FAILED ] FormatTest.RequiresClauses [ FAILED ] TokenAnnotatorTest.UnderstandsRequiresClauses

[PATCH] D113319: [clang-format] Improve require and concept handling

2022-02-23 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added a comment. @HazardyKnusperkeks, forget my previous comment, I think I found what changed. Before, the `*` was annotated twice, first as a BinaryOperator, then, on a second run, it was correctly annotated as a UnaryOperator. In this revision you whitelisted BinaryOperator in `resetT

[PATCH] D113319: [clang-format] Improve require and concept handling

2022-02-22 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added a comment. In D113319#3338290 , @HazardyKnusperkeks wrote: > > That means someone guesses this is a binary op and guesses wrong. I try to > take a look at it. Yeah, I just found out that it is set in `determineStarAmpUsage` here:

[PATCH] D113319: [clang-format] Improve require and concept handling

2022-02-22 Thread Björn Schäpers via Phabricator via cfe-commits
HazardyKnusperkeks added a comment. In D113319#3337680 , @curdeius wrote: > In D113319#3337612 , @krasimir > wrote: > >> It appears that this causes a regression by adding a space in-between >> pointer dereferen

[PATCH] D113319: [clang-format] Improve require and concept handling

2022-02-22 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added a comment. In D113319#3337612 , @krasimir wrote: > It appears that this causes a regression by adding a space in-between pointer > dereferences `*p` -> `* p` in some cases, e.g. formatting this with llvm > style: > > // before > void

[PATCH] D113319: [clang-format] Improve require and concept handling

2022-02-22 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added a comment. In D113319#3337485 , @krasimir wrote: > It appears that after this patch clang-format started breaking up `requires` > in javascript, e.g.: > > // before > function f() { > var requires = {}; > } > // after > funct

[PATCH] D113319: [clang-format] Improve require and concept handling

2022-02-22 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir added a comment. It appears that this causes a regression by adding a space in-between pointer dereferences `*p` -> `* p` in some cases, e.g. formatting this with llvm style: // before void f() { while (p < a && *p == 'a') p++; } // after void f() { while (p < a

[PATCH] D113319: [clang-format] Improve require and concept handling

2022-02-22 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir added a comment. It appears that after this patch clang-format started breaking up `requires` in javascript, e.g.: // before function f() { var requires = {}; } // after function f() { var requires = {}; } Could we restrict the requires logic only to (obj)

[PATCH] D113319: [clang-format] Improve require and concept handling

2022-02-11 Thread Björn Schäpers via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG9aab0db13fb6: [clang-format] Improve require and concept handling (authored by HazardyKnusperkeks). Changed prior to commit: https://reviews.llvm.org/D113319?vs=406444&id=408039#toc Repository: rG LL

[PATCH] D113319: [clang-format] Improve require and concept handling

2022-02-08 Thread Mark de Wever via Phabricator via cfe-commits
Mordante added inline comments. Comment at: clang/lib/Format/Format.cpp:1212 LLVMStyle.ReferenceAlignment = FormatStyle::RAS_Pointer; + // This is open for discussions! When will LLVM adapt C++20? + LLVMStyle.RequiresClausePositionForClasses = FormatStyle::RCPS_OwnLine;

[PATCH] D113319: [clang-format] Improve require and concept handling

2022-02-07 Thread Björn Schäpers via Phabricator via cfe-commits
HazardyKnusperkeks updated this revision to Diff 406444. HazardyKnusperkeks added a comment. Small fix in the test. For this change it is not relevant, but for the next one. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D113319/new/ https://reviews.llvm.org/D113319 Files: clang/docs/C

[PATCH] D113319: [clang-format] Improve require and concept handling

2022-02-05 Thread Björn Schäpers via Phabricator via cfe-commits
HazardyKnusperkeks updated this revision to Diff 406186. HazardyKnusperkeks marked 7 inline comments as done. HazardyKnusperkeks added a comment. - Fixed use of a variable which slipped in from another change. - Rebased. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D113319/new/ https://

[PATCH] D113319: [clang-format] Improve require and concept handling

2022-02-05 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius accepted this revision. curdeius added a comment. I can just say: ship it! Thanks for all the work! Comment at: clang/lib/Format/ContinuationIndenter.cpp:1499-1500 + if (State.NextToken->ClosesRequiresClause && Style.IndentRequiresClause) { +// Remove the indenta

[PATCH] D113319: [clang-format] Improve require and concept handling

2022-02-05 Thread MyDeveloperDay via Phabricator via cfe-commits
MyDeveloperDay accepted this revision. MyDeveloperDay added a comment. This revision is now accepted and ready to land. @HazardyKnusperkeks I think this is tremendous, I think this looks and feels like a much more thorough approach to formatting concepts. Thank you so much for taking this on and

[PATCH] D113319: [clang-format] Improve require and concept handling

2022-02-05 Thread Björn Schäpers via Phabricator via cfe-commits
HazardyKnusperkeks updated this revision to Diff 406167. HazardyKnusperkeks marked 2 inline comments as done. HazardyKnusperkeks added a comment. - Incorporated review notes - Rebased CHANGES SINCE LAST ACTION https://reviews.llvm.org/D113319/new/ https://reviews.llvm.org/D113319 Files: cl

[PATCH] D113319: [clang-format] Improve require and concept handling

2022-02-05 Thread Björn Schäpers via Phabricator via cfe-commits
HazardyKnusperkeks marked 22 inline comments as done. HazardyKnusperkeks added inline comments. Comment at: clang/docs/ClangFormatStyleOptions.rst:3516-3518 +The clause tries to stick to the template declaration in case of class +templates or between template and function

[PATCH] D113319: [clang-format] Improve require and concept handling

2022-02-04 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added a comment. Woow, that's a mountain of work! All my comments are non-blocking. Comment at: clang/docs/ClangFormatStyleOptions.rst:1992 +**BreakBeforeConceptDeclarations** (``BreakBeforeConceptDeclarationsStyle``) :versionbadge:`clang-format 13` + The style wethe

[PATCH] D113319: [clang-format] Improve require and concept handling

2022-02-04 Thread Björn Schäpers via Phabricator via cfe-commits
HazardyKnusperkeks marked 3 inline comments as done. HazardyKnusperkeks added a comment. Format notes updated on local commit. Comment at: clang/docs/ClangFormatStyleOptions.rst:3399 +**RequiresClausePositionForClasses** (``RequiresClausePositionStyle``) :versionbadge:`clang

[PATCH] D113319: [clang-format] Improve require and concept handling

2022-02-04 Thread Björn Schäpers via Phabricator via cfe-commits
HazardyKnusperkeks updated this revision to Diff 406048. HazardyKnusperkeks marked an inline comment as done. HazardyKnusperkeks edited the summary of this revision. HazardyKnusperkeks added a comment. This took a lot of work and debugging. I tried to minimize the refactoring on related code (I've

[PATCH] D113319: [clang-format] Improve require and concept handling

2022-02-04 Thread Mark de Wever via Phabricator via cfe-commits
Mordante added a comment. Thanks for working on this! I love to see better `requires` support in clang-format. I didn't do a real review, just some drive-by comments. Comment at: clang/docs/ClangFormatStyleOptions.rst:3399 +**RequiresClausePositionForClasses** (``RequiresCla

[PATCH] D113319: [clang-format] Improve require and concept handling

2022-02-04 Thread Björn Schäpers via Phabricator via cfe-commits
HazardyKnusperkeks marked 15 inline comments as done. HazardyKnusperkeks added inline comments. Comment at: clang/include/clang/Format/Format.h:3130-3136 + /// \brief The position of the ``requires`` clause for class templates. + /// \version 14 + RequiresClausePositionStyle R

[PATCH] D113319: [clang-format] Improve require and concept handling

2021-12-04 Thread Arthur O'Dwyer via Phabricator via cfe-commits
Quuxplusone added inline comments. Comment at: clang/docs/ClangFormatStyleOptions.rst:3464-3483 + * ``RCPS_TwoLines`` (in configuration: ``TwoLines``) +The clause always gets its own line, and the content of the clause go +into the next line with some indentation. + +

[PATCH] D113319: [clang-format] Improve require and concept handling

2021-12-03 Thread Björn Schäpers via Phabricator via cfe-commits
HazardyKnusperkeks marked 4 inline comments as done. HazardyKnusperkeks added inline comments. Comment at: clang/docs/ClangFormatStyleOptions.rst:3464-3483 + * ``RCPS_TwoLines`` (in configuration: ``TwoLines``) +The clause always gets its own line, and the content of the cla

[PATCH] D113319: [clang-format] Improve require and concept handling

2021-12-03 Thread Arthur O'Dwyer via Phabricator via cfe-commits
Quuxplusone added inline comments. Comment at: clang/docs/ClangFormatStyleOptions.rst:3424 +templates or between template and function delcarations. In case of +after the function delcaration it tries to stick to this. + `s/delca/decla/g` `s/Preceeding/Pr

[PATCH] D113319: [clang-format] Improve require and concept handling

2021-12-03 Thread Björn Schäpers via Phabricator via cfe-commits
HazardyKnusperkeks added a comment. Still WIP, not marking as changes planned, so that it pops up on your list and you can give me feedback. :) Comment at: clang/lib/Format/Format.cpp:1213 + // This is open for discussions! When will LLVM adapt C++20? + LLVMStyle.RequiresCla

[PATCH] D113319: [clang-format] Improve require and concept handling

2021-12-03 Thread Björn Schäpers via Phabricator via cfe-commits
HazardyKnusperkeks updated this revision to Diff 391708. HazardyKnusperkeks retitled this revision from "[clang-format] Improve require handling" to "[clang-format] Improve require and concept handling". HazardyKnusperkeks edited the summary of this revision. HazardyKnusperkeks added reviewers: go