[PATCH] D120503: [clang-format] Handle trailing comment for InsertBraces

2022-02-24 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/D120503/new/ https://reviews.llvm.org/D120503 __

[PATCH] D120361: [clang-format] Extract doc for entire configuration structs

2022-02-24 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/D120361/new/ https://reviews.llvm.org/D120361 __

[PATCH] D120140: [clang-format] Avoid inserting space after C++ casts.

2022-02-24 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 rGbfb4afee74c8: [clang-format] Avoid inserting space after C++ casts. (authored by curdeius). Repository: rG LLVM Github Monorepo CHANGES SINCE LAS

[PATCH] D120309: [clang-format] Fix QualifierOrder breaking the code with requires clause.

2022-02-24 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 rG46f6c834d9f9: [clang-format] Fix QualifierOrder breaking the code with requires clause. (authored by curdeius). Repository: rG LLVM Github Monorep

[PATCH] D120374: [clang-format] Do not insert space after new/delete keywords in C function declarations

2022-02-24 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 rGdbc4d281bd69: [clang-format] Do not insert space after new/delete keywords in C function… (authored by penagos, committed by curdeius). Repository:

[PATCH] D120445: [clang-format] Treat && followed by noexcept operator as a binary operator inside template arguments

2022-02-24 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, but please rebase so that CI runs. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D120445/new/ https://reviews.llvm.org/D120445 ___

[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] D120359: [clang-format][NFC] Remove redundant semi

2022-02-23 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added a comment. I don't really understand this change. You say in the description that you remove the semicolon, but you actually add it. Also, it's a common pattern not to add a semicolon and make all macro calls look like a normal statement (with a semi at the call place). I'm not op

[PATCH] D120374: [clang-format] Do not insert space after new/delete keywords in C function declarations

2022-02-22 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. In D120374#3339337 , @penagos wrote: > Though it's still unclear to me whether or not it'd make more sense to > continue to pursue a change to int

[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] D120140: [clang-format] Avoid inserting space after C++ casts.

2022-02-22 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius requested review of this revision. curdeius added a comment. I took another approach to fix the problem found in polly tests. I added CppCastLParen kind so as not to interfere with C-style casts. I also added a test case taken from lib/Format that got misformatted by the previous version

[PATCH] D120140: [clang-format] Avoid inserting space after C++ casts.

2022-02-22 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius updated this revision to Diff 410638. curdeius added a comment. This revision is now accepted and ready to land. - Fix. Add tests from inspired by polly and lib/Format that had misformats. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D12014

[PATCH] D120309: [clang-format] Fix QualifierOrder breaking the code with requires clause.

2022-02-22 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius updated this revision to Diff 410618. curdeius added a comment. Add a test. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D120309/new/ https://reviews.llvm.org/D120309 Files: clang/lib/Format/QualifierAlignmentFixer.cpp clang/unittests

[PATCH] D120309: [clang-format] Fix QualifierOrder breaking the code with requires clause.

2022-02-22 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added a comment. In D120309#3338265 , @HazardyKnusperkeks wrote: > Does it work with a more complex requires clause? Or were they unaffected > before? Like `Foo && Bar`? They were unaffected but I'll add a test. Repository: rG LLVM Github

[PATCH] D120324: [clang-format] Avoid parsing "requires" as a keyword in non-C++-like languages.

2022-02-22 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 rG071f870e7ff0: [clang-format] Avoid parsing "requires" as a keyword in non-C++-like languages. (authored by curdeius). Repository: rG LLVM Github

[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] D120324: [clang-format] Avoid parsing "requires" as a keyword in non-C++-like languages.

2022-02-22 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius created this revision. curdeius added reviewers: MyDeveloperDay, HazardyKnusperkeks, owenpan, krasimir. curdeius requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Fixes the issue raised post-review in D113319

[PATCH] D119599: [clang-format] Add option to align compound assignments like `+=`

2022-02-22 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added inline comments. Comment at: clang/docs/ClangFormatStyleOptions.rst:406 + + Options for aligning stuff. Stuff? Comment at: clang/docs/ClangFormatStyleOptions.rst:482-483 + + * ``bool AlignCompound`` Only for ``AlignConsecutiv

[PATCH] D120315: [clang-format] Fix preprocessor nesting after commit 529aa4b011c4ae808d658022ef643c44dd9b2c9c

2022-02-22 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius accepted this revision. curdeius added a comment. LGTM with other comments addressed. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D120315/new/ https://reviews.llvm.org/D120315 ___ cfe-commits m

[PATCH] D120309: [clang-format] Fix QualifierOrder breaking the code with requires clause.

2022-02-22 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/53962. Given the config: B

[PATCH] D119599: [clang-format] Add option to align compound assignments like `+=`

2022-02-21 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added a comment. Nice job! Please let us a bit of time to review that. Also, I think it would be good to get a reviewer that knows well the yaml parts. Or even split it to a separate revision. And this part needs tests too. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTI

[PATCH] D120217: [clang-format] Add an option to insert braces after control statements

2022-02-21 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius accepted this revision. curdeius added a comment. LGTM! Comment at: clang/lib/Format/Format.cpp:1850 + for (FormatToken *Token = Line->First; Token; Token = Token->Next) { +if (Token->Finalized || Token->BraceCount == 0) + continue; --

[PATCH] D120217: [clang-format] Add an option to insert braces after control statements

2022-02-20 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added a comment. Nice! A few minor comments though. Comment at: clang/include/clang/Format/Format.h:2572-2573 + /// Insert braces after control statements (``if``, ``else``, ``for``, ``do``, + /// and ``while``) in C++. + /// \warning Please add

[PATCH] D120140: [clang-format] Avoid inserting space after C++ casts.

2022-02-20 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius planned changes to this revision. curdeius added a comment. This commit provokes failures in formatting tests of polly. Cf. https://lab.llvm.org/buildbot/#/builders/205/builds/3320. That's probably because of ) being annotated as CastRParen instead of Unknown before, hence being kept on

[PATCH] D120140: [clang-format] Avoid inserting space after C++ casts.

2022-02-20 Thread Marek Kurdej via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. curdeius marked an inline comment as done. Closed by commit rGe021987273be: [clang-format] Avoid inserting space after C++ casts. (authored by curdeius). Changed prior to commit: https://reviews.llvm.org/D120140?vs=409959

[PATCH] D120188: Fix extraneous whitespace addition in line comments on clang-format directives

2022-02-20 Thread Marek Kurdej via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGd9567babef30: Fix extraneous whitespace addition in line comments on clang-format directives (authored by penagos, committed by curdeius). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D120188: Fix extraneous whitespace addition in line comments on clang-format directives

2022-02-20 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. Great! Thanks a lot! Do you have commit rights or you want someone to land it for you? For the latter, we'll need your name and email for the commit attribution. Repository: rG LLVM Gith

[PATCH] D120188: Fix extraneous whitespace addition in line comments on clang-format directives

2022-02-19 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added inline comments. Comment at: clang/lib/Format/BreakableToken.cpp:818 const auto FirstNonSpace = Lines[i][IndentPrefix.size()]; const auto AllowsSpaceChange = +(!LineTok || !switchesFormatting(*LineTok)) && curdeius wro

[PATCH] D120140: [clang-format] Avoid inserting space after C++ casts.

2022-02-18 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius marked an inline comment as done. curdeius added inline comments. Comment at: clang/lib/Format/TokenAnnotator.cpp:1951 +// FIXME: Maybe we should handle identifiers ending with "_cast", +// e.g. bit_cast? +return true;

[PATCH] D120140: [clang-format] Avoid inserting space after C++ casts.

2022-02-18 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added inline comments. Comment at: clang/lib/Format/TokenAnnotator.cpp:1740 +assert(Current.MatchingParen); +Current.MatchingParen->setType(TT_Unknown); + } To add some context, in the failing cases, the opening parenthesis was set t

[PATCH] D120140: [clang-format] Avoid inserting space after C++ casts.

2022-02-18 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/53876. This is a solution for

[PATCH] D120028: [clang-format] Do not add space after return-like keywords in macros.

2022-02-17 Thread Marek Kurdej via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG331e8e4e27be: [clang-format] Do not add space after return-like keywords in macros. (authored by curdeius). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D120

[PATCH] D120034: [clang-format] PROPOSAL - WIP: Added ability to parse template arguments

2022-02-17 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added a comment. That would be a nice improvement... and a big undertaking at the same time. You have my blessing! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D120034/new/ https://reviews.llvm.org/D120034 ___

[PATCH] D119599: Add option to align compound assignments like `+=`

2022-02-17 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added inline comments. Comment at: clang/include/clang/Format/Format.h:163 + /// \endcode + bool AlignCompoundAssignments; + sstwcw wrote: > curdeius wrote: > > HazardyKnusperkeks wrote: > > > MyDeveloperDay wrote: > > > > This option is not independen

[PATCH] D120028: [clang-format] Do not add space after return-like keywords in macros.

2022-02-17 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/6. Repository: rG LLVM

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

2022-02-16 Thread Marek Kurdej via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. curdeius marked an inline comment as done. Closed by commit rGd81f003ce141: [clang-format] Fix formatting of struct-like records followed by variable… (authored by curdeius). Changed prior to commit: https://reviews.llvm.

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

2022-02-16 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius marked 3 inline comments as done. 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 (Record

[PATCH] D119893: [clang-format] Fixed handling of requires clauses followed by attributes

2022-02-16 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius accepted this revision. curdeius added a comment. In D119893#3326247 , @HazardyKnusperkeks wrote: > Formatting Test added. Thanks! CHANGES SINCE LAST ACTION https://reviews.llvm.org/D119893/new/ https://reviews.llvm.org/D119893 __

[PATCH] D119893: [clang-format] Fixed handling of requires clauses followed by attributes

2022-02-16 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius accepted this revision. curdeius added a comment. LGTM. Maybe you can add a minimal test in `FormatTest.cpp` though. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D119893/new/ https://reviews.llvm.org/D119893 ___ cfe-commits mailing l

[PATCH] D119923: [clang-format][NFC] Return early in ContinuationIndenter::mustBreak

2022-02-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. CI is happy, I'm happy :). LGTM! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D119923/new/ https://reviews.llvm.org/D119923 ___

[PATCH] D119893: [clang-format] Fixed handling of requires clauses followed by attributes

2022-02-16 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added a comment. In D119893#3325432 , @HazardyKnusperkeks wrote: > In D119893#3325375 , @curdeius > wrote: > >> +1 to Arthur's comments. >> Does it fix any of the recently created issues? > > Yeah, I sh

[PATCH] D119893: [clang-format] Fixed handling of requires clauses followed by attributes

2022-02-15 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added a comment. +1 to Arthur's comments. Does it fix any of the recently created issues? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D119893/new/ https://reviews.llvm.org/D119893 ___ cfe-commi

[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 && - RecordTok->isO

[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 https://reviews.llvm.org/D1

[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 wi

[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 AfterSt

[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 LLVM

[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 clang/lib/Format/TokenAnno

[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 https://github.co

[PATCH] D119599: Add option to align compound assignments like `+=`

2022-02-14 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added a comment. @sstwcw, would it help if I created a parent revision that only splits the current enum-based option into a struct, so that you only add compound ops and padding? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D119599/new/

[PATCH] D119599: Add option to align compound assignments like `+=`

2022-02-14 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added a comment. I'd really want to see simpler tests and everything put into a single `AlignConsecutiveAssignment` option. Comment at: clang/include/clang/Format/Format.h:163 + /// \endcode + bool AlignCompoundAssignments; + HazardyKnusperkeks wrot

[PATCH] D113369: [clang-format] Extend SpaceBeforeParens for requires

2022-02-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. My naming suggestion is not binding. I have no strong opinion on this, but a shorter name would get my 👍 :). So please sync with other reviewers. Comment at: clang

[PATCH] D119138: [clang-format] Further improve support for requires expressions

2022-02-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! CHANGES SINCE LAST ACTION https://reviews.llvm.org/D119138/new/ https://reviews.llvm.org/D119138 ___ cfe-commits mailing list cfe-comm

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

2022-02-14 Thread Marek Kurdej via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGe967d97a35a9: [clang-format] Fix SpacesInLineCommentPrefix deleting tokens. (authored by curdeius). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D119680/new/

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

2022-02-14 Thread Marek Kurdej via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGe01f624adb0e: [clang-format] Fix PointerAlignment within lambdas in a multi-variable… (authored by curdeius). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D1

[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] 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 LLVM

[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: clang/lib/Format/Token

[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: https://reviews.llv

[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 https://reviews.ll

[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] D119649: [clang-format] Correctly format loops and `if` statements even if preceded with comments.

2022-02-12 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added inline comments. Comment at: clang/lib/Format/UnwrappedLineFormatter.cpp:379 if (NextLine.First->is(tok::l_brace)) { if ((TheLine->First->isOneOf(tok::kw_if, tok::kw_else, tok::kw_while, tok::kw_for, tok::kw_switch, t

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

2022-02-12 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius updated this revision to Diff 408217. curdeius added a comment. This revision is now accepted and ready to land. Split from and rebase on top of D119650 . Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D11964

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

2022-02-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. Depends on D119649 Repository: rG LLVM Gi

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

2022-02-12 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius planned changes to this revision. curdeius added a comment. In D119648#3317212 , @owenpan wrote: > Does any C++ standard support init statements in `while` loops? Argh, I initially thought about `if` statements and then somehow my brain turned

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

2022-02-12 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius updated this revision to Diff 408215. curdeius added a comment. Test ifs and FOREACH loops. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D119649/new/ https://reviews.llvm.org/D119649 Files: clang/lib/Format/UnwrappedLineFormatter.cpp

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

2022-02-12 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added a comment. In D119648#3317188 , @HazardyKnusperkeks wrote: > What about if? True, I need to fix them in D119649 too. And I think that I'll split the fix for while loops from this revision. Repository:

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

2022-02-12 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius updated this revision to Diff 408213. curdeius added a comment. Rebase on top of D119649 , add a similar case with a leading comment. Without it, there would be a different spacing of multi-variable initializers in loops, e.g. (-expected, +incorrect):

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

2022-02-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/53758. Braces in loops with l

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

2022-02-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/43115. Also, handle while loo

[PATCH] D119599: Add option to align compound assignments like `+=`

2022-02-12 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius requested changes to this revision. curdeius added a comment. This revision now requires changes to proceed. Thanks for working on this! Looks pretty good already. Comment at: clang/include/clang/Format/Format.h:151 + /// When aligning assignments, whether compound

[PATCH] D119597: [clang-format][NFC] Give State.Stack.back() a meaningful name

2022-02-12 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 whether you keep it as is or use a pointer. It looks like it would be cool if we had some sort of expression aliases in the language... `using CurrentState = State.Stack.back()`... One

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

2022-02-10 Thread Marek Kurdej via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG6c7e6fc7b665: [clang-format] Do not remove required spaces when aligning tokens. (authored by curdeius). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D119419

[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/ https://reviews.llvm.org/D11941

[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] 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 https://github.co

[PATCH] D118924: [clang-format] Fix formatting of macro definitions with a leading comment.

2022-02-09 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 rGa7b5e5b413bd: [clang-format] Fix formatting of macro definitions with a leading comment. (authored by curdeius). Repository: rG LLVM Github Monore

[PATCH] D119117: [clang-format] Fix formatting of the array form of delete.

2022-02-09 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. curdeius marked an inline comment as done. Closed by commit rGa77c67f93917: [clang-format] Fix formatting of the array form of delete. (authored by curdeius). Changed

[PATCH] D119218: [clang-format] Honour "// clang-format off" when using QualifierOrder.

2022-02-09 Thread Marek Kurdej via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGe329b5866f17: [clang-format] Honour "// clang-format off" when using QualifierOrder. (authored by curdeius). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D11

[PATCH] D119218: [clang-format] Honour "// clang-format off" when using QualifierOrder.

2022-02-08 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius marked an inline comment as done. curdeius added inline comments. Comment at: clang/unittests/Format/QualifierFixerTest.cpp:875 + "// clang-format on\n" + "inline static const int a = 0;\n", + "// clang-format off\n"

[PATCH] D119218: [clang-format] Honour "// clang-format off" when using QualifierOrder.

2022-02-08 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/53643. Repository: rG LLVM

[PATCH] D119138: [clang-format] Further improve support for requires expressions

2022-02-07 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added a comment. Some nits. Comment at: clang/lib/Format/UnwrappedLineParser.cpp:1541-1542 +case tok::kw_requires: { + bool Return = parseRequires(); + if (Return) +return; Comment at: clang/lib/Format/Unwrappe

[PATCH] D118924: [clang-format] Fix formatting of macro definitions with a leading comment.

2022-02-07 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added a comment. @HazardyKnusperkeks, sorry for that. Should be better now. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D118924/new/ https://reviews.llvm.org/D118924 ___ cfe-commits mailing lis

[PATCH] D118924: [clang-format] Fix formatting of macro definitions with a leading comment.

2022-02-07 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius updated this revision to Diff 406437. curdeius marked an inline comment as done. curdeius added a comment. Clean up. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D118924/new/ https://reviews.llvm.org/D118924 Files: clang/lib/Format/Unwr

[PATCH] D118924: [clang-format] Fix formatting of macro definitions with a leading comment.

2022-02-07 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius updated this revision to Diff 406415. curdeius marked 2 inline comments as done. curdeius added a comment. Don't use `|=`. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D118924/new/ https://reviews.llvm.org/D118924 Files: clang/lib/Forma

[PATCH] D118924: [clang-format] Fix formatting of macro definitions with a leading comment.

2022-02-07 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius updated this revision to Diff 406413. curdeius added a comment. Add tests, update in loop. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D118924/new/ https://reviews.llvm.org/D118924 Files: clang/lib/Format/UnwrappedLineParser.cpp clan

[PATCH] D119117: [clang-format] Fix formatting of the array form of delete.

2022-02-07 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius updated this revision to Diff 406363. curdeius added a comment. Revert unrelated changes. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D119117/new/ https://reviews.llvm.org/D119117 Files: clang/lib/Format/TokenAnnotator.cpp clang/unit

[PATCH] D119117: [clang-format] Fix formatting of the array form of delete.

2022-02-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. Fixes https://github.com/llvm/llvm-project/issues/53576. There was an inconsist

[PATCH] D119067: [clang-format] Fix DefinitionBlockSeparator extra empty lines

2022-02-06 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/DefinitionBlockSeparatorTest.cpp:305 " int r = j / k;\n" + " if (struct S = getS())

[PATCH] D119067: [clang-format] Fix DefinitionBlockSeparator extra empty lines

2022-02-06 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius requested changes to this revision. curdeius added a comment. This revision now requires changes to proceed. Looks ok but please rework the tests to keep previous cases untouched. Comment at: clang/unittests/Format/DefinitionBlockSeparatorTest.cpp:305

[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-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] D118924: [clang-format] Fix formatting of macro definitions with a leading comment.

2022-02-04 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added a comment. Indeed, I get the hash on the 2nd line merged into the first one in this test case: verifyFormat("/* comment */ #define A (parentheses)\n" "#"); But! It's unrelated to whether `PreviousWasComment` is updated inside the loop or not. Actually it should n

[PATCH] D118969: [clang-format][NFC] Fix a bug in setting type FunctionLBrace

2022-02-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! CHANGES SINCE LAST ACTION https://reviews.llvm.org/D118969/new/ https://reviews.llvm.org/D118969 ___ cfe-commits mailing list cfe-comm

[PATCH] D118969: [clang-format][NFC] Fix a bug in setting type FunctionLBrace

2022-02-03 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added a comment. Well, I thought about this approach but actually a macro line should never be merged together with a preceding line, so I went for a generic approach. That's because one never knows what's in a macro, it can well be a function brace after all depending on what goes befo

[PATCH] D118924: [clang-format] Fix formatting of macro definitions with a leading comment.

2022-02-03 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius planned changes to this revision. curdeius added a comment. I'll test it tomorrow but probably a define with a hash as the last character may do the job and show the faulty behaviour. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D118924/ne

[PATCH] D118924: [clang-format] Fix formatting of macro definitions with a leading comment.

2022-02-03 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added inline comments. Comment at: clang/lib/Format/UnwrappedLineParser.cpp:3574 + // line. + FirstNonCommentOnLine |= FirstOnLine; +} else { HazardyKnusperkeks wrote: > I really don't like bitwise operations on bool. Hit some nasty bugs at

[PATCH] D118924: [clang-format] Fix formatting of macro definitions with a leading comment.

2022-02-03 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius updated this revision to Diff 405702. curdeius added a comment. Add a test case. Use bool instead of Previous token. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D118924/new/ https://reviews.llvm.org/D118924 Files: clang/lib/Format/Unwr

<    1   2   3   4   5   6   7   8   9   >