[PATCH] D124215: [clang-format][NFC] Use isComment() in setCommentLineLevels()

2022-04-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. Thanks for the clean up! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124215/new/ https://reviews.llvm.org/D124215

[PATCH] D123896: [clang-format] fix nested angle brackets parse inside concept definition

2022-04-21 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius accepted this revision. curdeius added a comment. LGTM. Thank you! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D123896/new/ https://reviews.llvm.org/D123896 ___ cfe-commits mailing list

[PATCH] D124036: [clang-format] Don't skip PP lines if original line was a PP line when trying to merge lines

2022-04-19 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:13397 + + verifyFormat("//\n" + "#define a \\\n" aeubanks wrote: > not sure if

[PATCH] D123896: [clang-format] fix nested angle brackets parse inside concept definition

2022-04-16 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added a comment. Could you please add an annotator test as well? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D123896/new/ https://reviews.llvm.org/D123896 ___ cfe-commits mailing list

[PATCH] D123896: [clang-format] fix nested angle brackets parse inside concept definition

2022-04-16 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added a comment. Is there an issue report for this bug already? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D123896/new/ https://reviews.llvm.org/D123896 ___ cfe-commits mailing list

[PATCH] D123676: [clang-format] Fix WhitespaceSensitiveMacros not being honoured when macro closing parenthesis is followed by a newline.

2022-04-13 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added inline comments. Comment at: clang/lib/Format/UnwrappedLineParser.cpp:1791 +tokenCanStartNewLine(*FormatTok) && Text == Text.upper() && +!PreviousToken->isTypeFinalized()) {

[PATCH] D123737: [clang-format] Skip preprocessor lines when finding the record lbrace

2022-04-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. Thanks! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D123737/new/ https://reviews.llvm.org/D123737

[PATCH] D122468: [clang-format] Fix SeparateDefinitionBlocks breaking up function-try-block.

2022-04-13 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 rGb58616c2cdf7: [clang-format] Fix SeparateDefinitionBlocks breaking up function-try-block. (authored by curdeius). Repository: rG LLVM Github

[PATCH] D123676: [clang-format] Fix WhitespaceSensitiveMacros not being honoured when macro closing parenthesis is followed by a newline.

2022-04-13 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added inline comments. Comment at: clang/lib/Format/FormatTokenLexer.h:117-120 + struct MacroTokenInfo { +TokenType Type; +bool Finalized; + }; ksyx wrote: > Would making constructor of `struct MacroTokenInfo` having default parameter > or

[PATCH] D123676: [clang-format] Fix WhitespaceSensitiveMacros not being honoured when macro closing parenthesis is followed by a newline.

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

[PATCH] D122468: [clang-format] Fix SeparateDefinitionBlocks breaking up function-try-block.

2022-04-13 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius updated this revision to Diff 422479. curdeius marked 5 inline comments as done. curdeius added a comment. Address review comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D122468/new/ https://reviews.llvm.org/D122468 Files:

[PATCH] D123535: [clang-format] Allow empty .clang-format file

2022-04-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. I have stumbled on it myself several times but never really needed a fix. Out of curiosity, what motivates you to do this change? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST

[PATCH] D122468: [clang-format] Fix SeparateDefinitionBlocks breaking up function-try-block.

2022-03-25 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] D121584: [clang-format] Correctly recognize arrays in template parameter list.

2022-03-24 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added a comment. Yes, let's revert this. I should have a fix soon though. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D121584/new/ https://reviews.llvm.org/D121584 ___ cfe-commits mailing list

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

2022-03-23 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added a comment. Relanded in https://github.com/llvm/llvm-project/commit/4e88cb6825eefca3c0eb66b5ae40ab123fcc7073 with a fix and a regression test. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D121450/new/

[PATCH] D121916: [clang-format] [doc] Add script to automatically update help output in ClangFormat.rst.

2022-03-23 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 rGa45ad3ca8ce7: [clang-format] [doc] Add script to automatically update help output in… (authored by curdeius). Changed prior to commit:

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

2022-03-23 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added a comment. In D121451#3401947 , @MyDeveloperDay wrote: > I'm a little uncomfortable with > > //# > > becoming > > // # > > At least without an option for it to not make changes Don't you think that `//#PPdirective` should be indented

[PATCH] D122301: [clang-format] Fix invalid code generation with comments in lambda

2022-03-23 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! LGTM. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D122301/new/ https://reviews.llvm.org/D122301

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

2022-03-22 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added inline comments. Comment at: clang/lib/Format/UnwrappedLineParser.cpp:1826 + if (Style.isJavaScript() && Line->MustBeDeclaration) +// 'case: string' field declaration. +break; HazardyKnusperkeks wrote: > Here's the loop. In

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

2022-03-22 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added a comment. In D121450#3397861 , @jgorbe wrote: > Hi, > > We've observed that this patch introduces infinite loops in some cases. > Here's a reduced test case: > > export class Foo extends Bar { > get case(): Case { > return (

[PATCH] D121916: [clang-format] [doc] Add script to automatically update help output in ClangFormat.rst.

2022-03-22 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added a comment. If nobody is against this patch. I'll land it soon, probably tomorrow. Comment at: clang/docs/tools/dump_format_help.py:29 +def get_help_output(): +args = ["clang-format", "--help"] +cmd = subprocess.Popen(args, stdout=subprocess.PIPE,

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

2022-03-22 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added a comment. In D121451#3395801 , @krasimir wrote: > This makes me think that we should really consider not adding indent if the > first character is punctuation WAI, with rationale: That was the case before this patch. > - comments

[PATCH] D121584: [clang-format] Correctly recognize arrays in template parameter list.

2022-03-21 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added a comment. In D121584#3395937 , @krasimir wrote: > It appears that this regressed some ObjC patterns: > > % cat test.m # before: good > void f() { > // > BOOL a = [b.c count] > 1; > int b = a; > } > % clang-format

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

2022-03-21 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added a comment. In D121451#3395578 , @krasimir wrote: > This appears to have broken a relatively common pattern we see in text proto > comments where sections use a style like this: > > >

[PATCH] D121907: [clang-format] Use an enum for context types. NFC

2022-03-18 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius accepted this revision. curdeius added a comment. I really like this change. Thanks! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D121907/new/ https://reviews.llvm.org/D121907 ___ cfe-commits

[PATCH] D121916: [clang-format] [doc] Add script to automatically update help output in ClangFormat.rst.

2022-03-18 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added inline comments. Comment at: clang/tools/clang-format/ClangFormat.cpp:105 +SortIncludes("sort-includes", + cl::desc("If set, overrides the include sorting behavior\n" + "determined by the SortIncludes style flag"),

[PATCH] D121916: [clang-format] [doc] Add script to automatically update help output in ClangFormat.rst.

2022-03-17 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius updated this revision to Diff 416185. curdeius added a comment. Update file comment. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D121916/new/ https://reviews.llvm.org/D121916 Files: clang/docs/ClangFormat.rst

[PATCH] D121916: [clang-format] [doc] Add script to automatically update help output in ClangFormat.rst.

2022-03-17 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added a comment. This is an alternative to D121890 . This patch goes a step further and adds a script to update the .rst file. It isn't invoked during the build, one needs to run it manually (just as `dump_format_style.py`). There's also a validation

[PATCH] D121916: [clang-format] [doc] Add script to automatically update help output in ClangFormat.rst.

2022-03-17 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. Repository: rG LLVM Github Monorepo

[PATCH] D121749: [clang-format][docs] Regenerate ClangFormatStyleOptions.rst

2022-03-17 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added inline comments. Comment at: clang/docs/ClangFormatStyleOptions.rst:361 - * ``bool AlignCompound`` Only for ``AlignConsecutiveAssignments``. Whether compound -assignments like ``+=`` are aligned along with ``=``. + * ``bool AlignCompound`` Only for

[PATCH] D121749: [clang-format][docs] Regenerate ClangFormatStyleOptions.rst

2022-03-17 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added inline comments. Comment at: clang/docs/ClangFormatStyleOptions.rst:361 - * ``bool AlignCompound`` Only for ``AlignConsecutiveAssignments``. Whether compound -assignments like ``+=`` are aligned along with ``=``. + * ``bool AlignCompound`` Only for

[PATCH] D121890: [clang-format] Copy help options to the doc directory.

2022-03-17 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added inline comments. Comment at: clang/docs/ClangFormat.rst:76 +--output-replacements-xml - Output replacements as XML. +--qualifier-alignment= - If set, overrides the qualifier alignment style determined by the QualifierAlignment style flag +

[PATCH] D121749: [clang-format][docs] Regenerate ClangFormatStyleOptions.rst

2022-03-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 rG45cb2df6788c: [clang-format][docs] Regenerate ClangFormatStyleOptions.rst (authored by kuzkry, committed by curdeius). Repository: rG LLVM Github

[PATCH] D121846: [clang-format] Correctly recognize binary operators in template arguments with parenthesized literals.

2022-03-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. curdeius marked an inline comment as done. Closed by commit rGdc142ea184a5: [clang-format] Correctly recognize binary operators in template arguments with… (authored

[PATCH] D121846: [clang-format] Correctly recognize binary operators in template arguments with parenthesized literals.

2022-03-16 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] D121755: [clang-format] Join spaceRequiredBefore and spaceRequiredBetween

2022-03-16 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added a comment. No objections here, but I need to see other patches to understand where it takes us before accepting. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D121755/new/ https://reviews.llvm.org/D121755

[PATCH] D121754: [clang-format] Refactor determineStarAmpUsage

2022-03-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/lib/Format/TokenAnnotator.cpp:2161 -if (PrevToken->isOneOf(tok::l_paren, tok::l_square, tok::l_brace, -

[PATCH] D121576: [clang-format] Don't unwrap lines preceded by line comments

2022-03-15 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added a comment. In D121576#3381295 , @owenpan wrote: > Right. I think we should have a specification (including when not to align > the cells) and re-design the entire thing. It's not maintainable as is. I > have some ideas but need to

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

2022-03-15 Thread Marek Kurdej via Phabricator via cfe-commits
This revision was not accepted when it landed; it landed in state "Changes Planned". This revision was automatically updated to reflect the committed changes. Closed by commit rG3227aa3aa834: [clang-format] Correctly format variable templates. (authored by curdeius). Changed prior to commit:

[PATCH] D121584: [clang-format] Correctly recognize arrays in template parameter list.

2022-03-15 Thread Marek Kurdej via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG126b37a713dc: [clang-format] Correctly recognize arrays in template parameter list. (authored by curdeius). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

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

2022-03-14 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius reopened this revision. curdeius added a comment. This revision is now accepted and ready to land. Reverting as it provoked bug https://github.com/llvm/llvm-project/issues/54374. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D121456/new/

[PATCH] D121584: [clang-format] Correctly recognize arrays in template parameter list.

2022-03-14 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] D121576: [clang-format] Don't unwrap lines preceded by line comments

2022-03-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/D121576/new/ https://reviews.llvm.org/D121576 ___ cfe-commits mailing list

[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] D121557: [clang-format][NFC] Rename Left to OpeningParen...

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. Thanks! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D121557/new/ https://reviews.llvm.org/D121557

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

2022-03-13 Thread Marek Kurdej via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGa140b7104fda: [clang-format] Correctly format variable templates. (authored by curdeius). Changed prior to commit: https://reviews.llvm.org/D121456?vs=414634=414954#toc Repository: rG LLVM Github

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

2022-03-13 Thread Marek Kurdej via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG36d13d3f8adb: [clang-format] Add space to comments starting with #. (authored by curdeius). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D121451/new/

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

[PATCH] D112019: [clang-format] [PR51412] AlignConsecutiveMacros fights with Visual Studio and resource.h

2022-03-13 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/D112019/new/ https://reviews.llvm.org/D112019 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

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

2022-03-13 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius accepted this revision. curdeius added inline comments. This revision is now accepted and ready to land. Comment at: clang/lib/Format/TokenAnnotator.cpp:215 +assert(CurrentToken->Previous && "Unknown previous token"); +FormatToken = *CurrentToken->Previous; +

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

2022-03-12 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added inline comments. Comment at: clang/lib/Format/UnwrappedLineParser.cpp:578 +break; + LLVM_FALLTHROUGH; owenpan wrote: > Can we remove this empty line? Will do. Comment at:

[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. In D121451#3375229 , @MyDeveloperDay wrote: > Is this conforming to `SpacesInLineCommentPrefix` Yes it is, nothing changed in this regard, I added tests anyway. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST

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

2022-03-11 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius updated this revision to Diff 414669. curdeius added a comment. Add tests for SpacesInLineCommentPrefix. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D121451/new/ https://reviews.llvm.org/D121451 Files:

[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] 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] 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] D121370: [clang-format] SortIncludes should support "@import" lines in Objective-C

2022-03-10 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added inline comments. Comment at: clang/lib/Format/Format.cpp:2685 const char CppIncludeRegexPattern[] = -R"(^[\t\ ]*#[\t\ ]*(import|include)[^"<]*(["<][^">]*[">]))"; +R"(^[\t\ ]*[@#]?[\t\ ]*(import|include)[^"<]*[\t\n\ \\]*("[^"]+"|<[^>]+>|[^"<>;]+;))";

[PATCH] D121370: [clang-format] SortIncludes should support "@import" lines in Objective-C

2022-03-10 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added inline comments. Comment at: clang/lib/Format/Format.cpp:2685 const char CppIncludeRegexPattern[] = -R"(^[\t\ ]*#[\t\ ]*(import|include)[^"<]*(["<][^">]*[">]))"; +R"(^[\t\ ]*[@#]?[\t\ ]*(import|include)[^"<]*[\t\n\ \\]*("[^"]+"|<[^>]+>|[^"<>;]+;))";

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

2022-03-10 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius accepted this revision. curdeius added a comment. LGTM. Thanks a lot! Comment at: clang/lib/Format/Format.cpp:1181-1184 + LLVMStyle.AlignConsecutiveAssignments = { + /*Enabled=*/false, /*AcrossEmptyLines=*/false, + /*AcrossComments=*/false,

[PATCH] D121269: [clang-format] Fix namespace format when the name is followed by a macro

2022-03-10 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius accepted this revision. curdeius added a comment. LGTM % nits. Thanks for working on this! Comment at: clang/lib/Format/NamespaceEndCommentsFixer.cpp:54-55 +Tok = processTokens(Tok, tok::l_paren, tok::r_paren, nullptr); + } else if (Tok->is(tok::l_square)) +

[PATCH] D121269: [clang-format] Fix namespace format when the name is followed by a macro

2022-03-09 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added inline comments. Comment at: clang/unittests/Format/NamespaceEndCommentsFixerTest.cpp:192 "}")); + EXPECT_EQ("#define M(x) x##x\n" +"namespace A M(x) {\n" curdeius wrote: > zequanwu wrote: > > zequanwu wrote: > > >

[PATCH] D121269: [clang-format] Fix namespace format when the name is followed by a macro

2022-03-09 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added inline comments. Comment at: clang/lib/Format/NamespaceEndCommentsFixer.cpp:72 -Tok = FirstNSTok; -while (Tok && !Tok->is(tok::l_brace)) { +bool IsPrevColoncolon = false; +bool HasColoncolon = false; Nit: Personally, I'd put

[PATCH] D121269: [clang-format] Fix namespace format when the name is followed by a macro

2022-03-09 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added inline comments. Comment at: clang/unittests/Format/NamespaceEndCommentsFixerTest.cpp:192-211 + EXPECT_EQ("#define M(x) x##x\n" +"namespace A M(x) {\n" +"int i;\n" +"int j;\n" +"}// namespace A M(x)", +

[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] 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] 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] 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 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 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 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] 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] 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] D121069: [clang-format] Minimize the damage caused by AlignArrayOfStructures when working on non square arrays

2022-03-06 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added inline comments. Comment at: clang/lib/Format/WhitespaceManager.h:318 Next = Next->NextColumnElement) { + if (RowCount > MaxRowCount) { +break; You can elide braces. Personally I use RemoveBraces locally. CHANGES SINCE

[PATCH] D121069: [clang-format] Minimize the damage caused by AlignArrayOfStructures when working on non square arrays

2022-03-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. Nits only. +1 for adding a note in the option documentation. Comment at: clang/lib/Format/WhitespaceManager.h:203 +// Determine if every row in the the array +//

[PATCH] D121069: [clang-format] Minimize the damage caused by AlignArrayOfStructures when working on non square arrays

2022-03-06 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added inline comments. Comment at: clang/lib/Format/WhitespaceManager.h:204 +// of columns as the first row +bool IsSquare() { + if (CellCounts.empty()) Don't really like the name... Some suggestions: - HasEqualRows - HasEqualRowLengths -

[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] 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-03 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added inline comments. Comment at: clang/lib/Format/UnwrappedLineFormatter.cpp:313 break; + if ((*J)->Level == TheLine->Level) +return false; owenpan wrote: > To be safe? Good idea. Will do. Any idea how to provoke

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

2022-03-03 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] D120774: [clang-format] Handle builtins in constraint expression

2022-03-03 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. Thanks for handling other traits! LGTM % alias test. Comment at: clang/unittests/Format/FormatTest.cpp:23747 + verifyFormat("template \n" + "concept

[PATCH] D120873: [clang-format] Handle wrapped else for RemoveBracesLLVM

2022-03-03 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/D120873/new/ https://reviews.llvm.org/D120873 ___ cfe-commits mailing list

[PATCH] D120710: [clang-format] QualifierOrder does not reorder template arguments

2022-03-02 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added inline comments. Herald added a project: All. Comment at: clang/unittests/Format/QualifierFixerTest.cpp:910 + Style); + verifyFormat("TemplateType t;", "TemplateType t;", Style); +} HazardyKnusperkeks wrote: > As far as I understand

[PATCH] D120806: [clang-format] Recognize "if consteval".

2022-03-02 Thread Marek Kurdej via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG13351fdf8cb4: [clang-format] Recognize if consteval. (authored by curdeius). Changed prior to commit: https://reviews.llvm.org/D120806?vs=412366=412444#toc Repository: rG LLVM Github Monorepo

[PATCH] D120806: [clang-format] Recognize "if consteval".

2022-03-02 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added a comment. Great, I'll add a few test cases when landing. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D120806/new/ https://reviews.llvm.org/D120806 ___ cfe-commits mailing list

[PATCH] D120806: [clang-format] Recognize "if consteval".

2022-03-02 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added a comment. I'll handle `AllowShortIfStatements` and update this review. Should be pretty straightforward. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D120806/new/ https://reviews.llvm.org/D120806

[PATCH] D120806: [clang-format] Recognize "if consteval".

2022-03-02 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] D120774: [clang-format] Handle builtins in constraint expression

2022-03-01 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added a comment. More failing cases: `__alignof`, `alignof` (two different categories) Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D120774/new/ https://reviews.llvm.org/D120774 ___ cfe-commits

[PATCH] D120774: [clang-format] Handle builtins in constraint expression

2022-03-01 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:23747 + verifyFormat("template \n" + "concept integral = __is_integral(T);"); +

[PATCH] D120710: [clang-format] QualifierOrder does not reorder template arguments

2022-03-01 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 for fixing this! Comment at: clang/lib/Format/QualifierAlignmentFixer.cpp:344-346 + // If the template closer is closing the requires clause + //

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

2022-02-28 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 rG24d4f601aa6d: [clang-format] Treat followed by noexcept operator as a binary operator… (authored by penagos, committed by curdeius). Changed

[PATCH] D120398: [format] follow up: Use unsigned char as the base of all enums in FormatStyle

2022-02-27 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added a comment. Looks innocent but I have a few questions. What's the size difference that you observe? Any runtime penalty? (Usually compilers choose a faster underlying type for enums, not smaller) Also, is this change very relevant to clang-format? We should not copy FormatStyle a

[PATCH] D120511: [clang-format] Allow to set token types final

2022-02-26 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added inline comments. Comment at: clang/lib/Format/FormatToken.h:394 + } + bool typeIsFinalized() const { return TypeIsFinalized; } Nit, to make everyone happy, the function could be called `isTypeFinalized`. CHANGES SINCE LAST ACTION

[PATCH] D120621: [clang-format] Fix BreakBeforeBinaryOperators with TemplateCloser on the lhs

2022-02-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. Great! Please fix formatting before landing. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D120621/new/ https://reviews.llvm.org/D120621

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

2022-02-25 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added a comment. In D120445#3344594 , @penagos wrote: > I went ahead and did a git rebase but CI still appears to be failing (though > tests pass in my local clone). Also, I’ll need someone to commit this on my > behalf: > > - Luis Penagos > -

[PATCH] D120511: [clang-format] Allow to set token types final

2022-02-24 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius accepted this revision. curdeius added a subscriber: krasimir. curdeius added a comment. This revision is now accepted and ready to land. Great! @krasimir, FYI, that should fix the issue you reported. Comment at: clang/lib/Format/FormatToken.h:379 + void

[PATCH] D120512: [clang-format] Fix requires related crash

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 your test case is far from the reproduce in the issue report, so please confirm with @owenpan. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[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

<    1   2   3   4   5   6   7   8   9   >