[PATCH] D154755: [clang-format] Fix formatting of if statements with BlockIndent

2023-11-09 Thread Gedare Bloom via Phabricator via cfe-commits
gedare updated this revision to Diff 558069. gedare added a comment. Use cameLCAse in test Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D154755/new/ https://reviews.llvm.org/D154755 Files: clang/lib/Format/ContinuationIndenter.cpp

[PATCH] D154755: [clang-format] Fix formatting of if statements with BlockIndent

2023-11-09 Thread Gedare Bloom via Phabricator via cfe-commits
gedare marked an inline comment as done. gedare added inline comments. Comment at: clang/lib/Format/ContinuationIndenter.cpp:773-792 if ((Style.AlignAfterOpenBracket == FormatStyle::BAS_AlwaysBreak || Style.AlignAfterOpenBracket == FormatStyle::BAS_BlockIndent) &&

[PATCH] D156360: [clang-format] Support function and overloaded operator SpacesInParensOption

2023-11-09 Thread Gedare Bloom via Phabricator via cfe-commits
gedare updated this revision to Diff 558066. gedare added a comment. Rebase to D155529 . Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D156360/new/ https://reviews.llvm.org/D156360 Files:

[PATCH] D156360: [clang-format] Support function and overloaded operator SpacesInParensOption

2023-11-09 Thread Gedare Bloom via Phabricator via cfe-commits
gedare added a comment. ping Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D156360/new/ https://reviews.llvm.org/D156360 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D137762: [clang-format] avoid breaking )( with BlockIndent

2022-12-05 Thread Gedare Bloom via Phabricator via cfe-commits
gedare added a comment. In D137762#3969770 , @owenpan wrote: > @gedare do you need us to commit this patch on your behalf (using "Gedare > Bloom ")? Yes, please. I don't have any llvm permissions, this is my first patch set for llvm actually. Anything

[PATCH] D137762: [clang-format] avoid breaking )( with BlockIndent

2022-11-11 Thread Gedare Bloom via Phabricator via cfe-commits
gedare updated this revision to Diff 474814. gedare added a comment. Address review comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D137762/new/ https://reviews.llvm.org/D137762 Files: clang/lib/Format/ContinuationIndenter.cpp

[PATCH] D137762: [clang-format] avoid breaking )( with BlockIndent

2022-11-11 Thread Gedare Bloom via Phabricator via cfe-commits
gedare updated this revision to Diff 474812. gedare added a comment. Run tests and fix bad breaks. Fix comment style. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D137762/new/ https://reviews.llvm.org/D137762 Files:

[PATCH] D137762: [clang-format] avoid breaking )( with BlockIndent

2022-11-11 Thread Gedare Bloom via Phabricator via cfe-commits
gedare updated this revision to Diff 474901. gedare added a comment. - fixup typo in unit test Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D137762/new/ https://reviews.llvm.org/D137762 Files: clang/lib/Format/ContinuationIndenter.cpp

[PATCH] D137762: [clang-format] avoid breaking )( with BlockIndent

2022-11-11 Thread Gedare Bloom via Phabricator via cfe-commits
gedare marked an inline comment as done. gedare added a comment. I've added unit tests and confirmed (1) the new tests fail on current `main` and (2) all unit tests pass with this revision applied. [100%] Running lit suite /llvm-project/clang/test/Unit Testing Time: 250.49s Skipped:

[PATCH] D137762: [clang-format] avoid breaking )( with BlockIndent

2022-11-11 Thread Gedare Bloom via Phabricator via cfe-commits
gedare updated this revision to Diff 474876. gedare added a comment. add unit tests for BlockIndent Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D137762/new/ https://reviews.llvm.org/D137762 Files: clang/lib/Format/ContinuationIndenter.cpp

[PATCH] D137762: [clang-format] avoid breaking )( with BlockIndent

2022-11-11 Thread Gedare Bloom via Phabricator via cfe-commits
gedare updated this revision to Diff 474881. gedare added a comment. Refactor horrible to read logic Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D137762/new/ https://reviews.llvm.org/D137762 Files: clang/lib/Format/ContinuationIndenter.cpp

[PATCH] D137762: [clang-format] avoid breaking )( with BlockIndent

2022-11-11 Thread Gedare Bloom via Phabricator via cfe-commits
gedare marked 2 inline comments as done. gedare added inline comments. Comment at: clang/lib/Format/TokenAnnotator.cpp:5006-5010 +return !((Previous && (Previous->is(tok::kw_for) || Previous->isIf())) || + (Right.Next && +

[PATCH] D137762: [clang-format] avoid breaking )( with BlockIndent

2022-11-17 Thread Gedare Bloom via Phabricator via cfe-commits
gedare added inline comments. Comment at: clang/lib/Format/TokenAnnotator.cpp:5007 return false; } const FormatToken *Previous = Right.MatchingParen->Previous; owenpan wrote: > Can we simply add the above and leave the original `return`

[PATCH] D137762: [clang-format] avoid breaking )( with BlockIndent

2022-11-17 Thread Gedare Bloom via Phabricator via cfe-commits
gedare updated this revision to Diff 476196. gedare added a comment. - fixup: use simpler logic for handling rparens - Revert "fixup: port other EXPECT_EQ to verifyFormat" Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D137762/new/

[PATCH] D137762: [clang-format] avoid breaking )( with BlockIndent

2022-11-17 Thread Gedare Bloom via Phabricator via cfe-commits
gedare added a comment. I have changed the code as recommended by @owenpan with new unit tests passing, and reverting the modifications to existing unit tests. Someone else may janitor the EXPECT_EQ blocks separately. I will not be able to look at this again for ~2 weeks. with luck it is ready

[PATCH] D137762: [clang-format] avoid breaking )( with BlockIndent

2022-11-10 Thread Gedare Bloom via Phabricator via cfe-commits
gedare added inline comments. Comment at: clang/lib/Format/ContinuationIndenter.cpp:720 (!Previous.Previous || !Previous.Previous->isOneOf( - tok::kw_for, tok::kw_while, tok::kw_switch)) && + tok::r_paren, tok::kw_for,

[PATCH] D137762: [clang-format] avoid breaking )( with BlockIndent

2022-11-09 Thread Gedare Bloom via Phabricator via cfe-commits
gedare updated this revision to Diff 474430. gedare added a comment. Add a fix to enable breaking for continuation after a )( Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D137762/new/ https://reviews.llvm.org/D137762 Files:

[PATCH] D137762: [clang-format] avoid breaking )( with BlockIndent

2022-11-09 Thread Gedare Bloom via Phabricator via cfe-commits
gedare added a comment. Another test case for function pointers is here: F25259090: tmp.c Before applying these changes, it is: clang-format -style="{BasedOnStyle: LLVM, AlignAfterOpenBracket: BlockIndent}" tmp.c int foo(long l) { return l; } int

[PATCH] D137762: [clang-format] avoid breaking )( with BlockIndent

2022-11-09 Thread Gedare Bloom via Phabricator via cfe-commits
gedare created this revision. Herald added a project: All. gedare requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. The BracketAlignmentStyle BAS_BlockIndent was forcing breaks before a closing right parenthesis yielding strange-looking

[PATCH] D137762: [clang-format] avoid breaking )( with BlockIndent

2022-11-09 Thread Gedare Bloom via Phabricator via cfe-commits
gedare added a comment. Something about this is still a bit off though. This change seems to prevent any more breaking on the line. For example, the test example given in GitHub Issue https://github.com/llvm/llvm-project/issues/57250 when formatted with this change becomes: `clang-format

[PATCH] D137762: [clang-format] avoid breaking )( with BlockIndent

2022-11-09 Thread Gedare Bloom via Phabricator via cfe-commits
gedare updated this revision to Diff 474429. gedare added a comment. Allow line breaks in a continuation with BlockIndent after )( Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D137762/new/ https://reviews.llvm.org/D137762 Files:

[PATCH] D137762: [clang-format] avoid breaking )( with BlockIndent

2022-11-09 Thread Gedare Bloom via Phabricator via cfe-commits
gedare added a comment. A test case from the GitHub Issue https://github.com/llvm/llvm-project/issues/57250 is attached here: F25258989: test.c When run without these changes, it yields: clang-format -style="{BasedOnStyle: LLVM, AlignAfterOpenBracket:

[PATCH] D137762: [clang-format] avoid breaking )( with BlockIndent

2022-11-14 Thread Gedare Bloom via Phabricator via cfe-commits
gedare updated this revision to Diff 475164. gedare added a comment. - fixup: replace EXPECT_EQ with verifyFormat - fixup: port other EXPECT_EQ to verifyFormat Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D137762/new/

[PATCH] D137762: [clang-format] avoid breaking )( with BlockIndent

2022-11-14 Thread Gedare Bloom via Phabricator via cfe-commits
gedare updated this revision to Diff 475165. gedare added a comment. - fixup: unit test formatting Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D137762/new/ https://reviews.llvm.org/D137762 Files: clang/lib/Format/ContinuationIndenter.cpp

[PATCH] D137762: [clang-format] avoid breaking )( with BlockIndent

2022-11-14 Thread Gedare Bloom via Phabricator via cfe-commits
gedare updated this revision to Diff 475313. gedare added a comment. - FormatTest: restore Input variable to one test Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D137762/new/ https://reviews.llvm.org/D137762 Files:

[PATCH] D137762: [clang-format] avoid breaking )( with BlockIndent

2022-11-14 Thread Gedare Bloom via Phabricator via cfe-commits
gedare added inline comments. Comment at: clang/unittests/Format/FormatTest.cpp:7215 Style.AlignAfterOpenBracket = FormatStyle::BAS_DontAlign; - EXPECT_EQ(StringRef("functionCall(paramA, paramB,\n" - "paramC);\n" - "void

[PATCH] D152976: Regenerate ClangFormatStyleOptions.rst

2023-06-14 Thread Gedare Bloom via Phabricator via cfe-commits
gedare created this revision. Herald added a project: All. Herald added a comment. gedare requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. NOTE: Clang-Format Team Automated Review Comment Your review contains a change to

[PATCH] D152975: [clang-format] Allow break after return keyword

2023-06-14 Thread Gedare Bloom via Phabricator via cfe-commits
gedare updated this revision to Diff 531557. gedare added a comment. Regenerate docs Herald added a comment. NOTE: Clang-Format Team Automated Review Comment Your review contains a change to ClangFormatStyleOptions.rst but not a change to clang/include/clang/Format/Format.h

[PATCH] D152975: [clang-format] Allow break after return keyword

2023-06-14 Thread Gedare Bloom via Phabricator via cfe-commits
gedare updated this revision to Diff 531561. gedare added a comment. - Regenerate ClangFormatStyleOptions.rst Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D152975/new/ https://reviews.llvm.org/D152975 Files:

[PATCH] D152975: [clang-format] Allow break after return keyword

2023-06-14 Thread Gedare Bloom via Phabricator via cfe-commits
gedare created this revision. Herald added projects: All, clang, clang-format. Herald added a subscriber: cfe-commits. Herald added reviewers: rymiel, HazardyKnusperkeks, owenpan, MyDeveloperDay. gedare requested review of this revision. Herald added a comment. NOTE: Clang-Format Team Automated

[PATCH] D153205: [clang-format] Support block indenting array/struct list initializers

2023-07-06 Thread Gedare Bloom via Phabricator via cfe-commits
gedare updated this revision to Diff 537761. gedare added a comment. Update and refresh diff Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D153205/new/ https://reviews.llvm.org/D153205 Files: clang/docs/ClangFormatStyleOptions.rst

[PATCH] D153205: [clang-format] Support block indenting array/struct list initializers

2023-07-06 Thread Gedare Bloom via Phabricator via cfe-commits
gedare marked an inline comment as done. gedare added a comment. In D153205#4475836 , @owenpan wrote: > Do you need to update the current diff to show the net change? For example, > the unit tests you added don't show up as a diff right now. Done. Not

[PATCH] D154550: [clang-format] Allow empty loops on a single line.

2023-07-06 Thread Gedare Bloom via Phabricator via cfe-commits
gedare updated this revision to Diff 537857. gedare added a comment. Reorder traits and add comment about backward compatibility. Herald added a comment. NOTE: Clang-Format Team Automated Review Comment It looks like your clang-format review does not contain any unit tests, please try to

[PATCH] D154550: [clang-format] Allow empty loops on a single line.

2023-07-06 Thread Gedare Bloom via Phabricator via cfe-commits
gedare updated this revision to Diff 537859. gedare added a comment. Regenerate complete diff Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D154550/new/ https://reviews.llvm.org/D154550 Files: clang/docs/ClangFormatStyleOptions.rst

[PATCH] D154552: [clang-format] Add note directive generation for docs

2023-07-06 Thread Gedare Bloom via Phabricator via cfe-commits
gedare updated this revision to Diff 537872. gedare added a comment. Update from D153205 Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D154552/new/ https://reviews.llvm.org/D154552 Files:

[PATCH] D155239: [clang-format] Add SpacesInParens with SpacesInParensOptions

2023-07-13 Thread Gedare Bloom via Phabricator via cfe-commits
gedare added a comment. After doing this, I'm not too sure about the value of keeping the higher-level `CStyleCasts`, `ConditionalStatements`, and `EmptyParentheses` as options to `SpacesInParens`. However, the behavior of `Always` is actually "Always except for `CStyleCasts` and

[PATCH] D155239: [clang-format] Add SpacesInParens with SpacesInParensOptions

2023-07-13 Thread Gedare Bloom via Phabricator via cfe-commits
gedare created this revision. Herald added projects: All, clang, clang-format. Herald added a subscriber: cfe-commits. Herald added reviewers: rymiel, HazardyKnusperkeks, owenpan, MyDeveloperDay. gedare requested review of this revision. This is a refactoring of: - SpacesInConditionalStatement -

[PATCH] D155239: [clang-format] Add SpacesInParens with SpacesInParensOptions

2023-07-17 Thread Gedare Bloom via Phabricator via cfe-commits
gedare added a comment. I addressed the comments, and I have redesigned this option to simplify it further. Now there are only two options at the top for `SpacesInParens` to be either `Never` or `Custom`. Then within `Custom` the individual behavior of the spaces can be controlled. This

[PATCH] D155239: [clang-format] Add SpacesInParens with SpacesInParensOptions

2023-07-17 Thread Gedare Bloom via Phabricator via cfe-commits
gedare updated this revision to Diff 541219. gedare marked 3 inline comments as done. gedare added a comment. Properly deprecate old options, and simplify top-level to Never and Custom Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D155239/new/

[PATCH] D154755: [clang-format] Fix formatting of if statements with BlockIndent

2023-07-17 Thread Gedare Bloom via Phabricator via cfe-commits
gedare added a comment. Ping. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D154755/new/ https://reviews.llvm.org/D154755 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D155529: [clang-format] Add SpaceInParensOption for __attribute__ keyword

2023-07-17 Thread Gedare Bloom via Phabricator via cfe-commits
gedare created this revision. Herald added projects: All, clang, clang-format. Herald added a subscriber: cfe-commits. Herald added reviewers: rymiel, HazardyKnusperkeks, owenpan, MyDeveloperDay. gedare requested review of this revision. The __attribute((specifier-list)) currently is formatted

[PATCH] D155529: [clang-format] Add SpaceInParensOption for __attribute__ keyword

2023-07-17 Thread Gedare Bloom via Phabricator via cfe-commits
gedare marked an inline comment as done. gedare added a comment. I simplified this to treat the double parens identically, so that it will either inject spaces inside both parens, or not. Note: This option is necessary to disable ``SpacesInParens.Other`` from adding spaces inside of

[PATCH] D155529: [clang-format] Add SpaceInParensOption for __attribute__ keyword

2023-07-17 Thread Gedare Bloom via Phabricator via cfe-commits
gedare planned changes to this revision. gedare added inline comments. Comment at: clang/include/clang/Format/Format.h:4208-4213 +/// Put a space in parentheses inside attribute specifier lists. +/// \code +///true: false: +

[PATCH] D155529: [clang-format] Add SpaceInParensOption for __attribute__ keyword

2023-07-17 Thread Gedare Bloom via Phabricator via cfe-commits
gedare updated this revision to Diff 541322. gedare added a comment. Merge the two options to just one for attribute parens. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D155529/new/ https://reviews.llvm.org/D155529 Files:

[PATCH] D155239: [clang-format] Add SpacesInParens with SpacesInParensOptions

2023-07-18 Thread Gedare Bloom via Phabricator via cfe-commits
gedare updated this revision to Diff 541770. gedare added a comment. Parse deprecated options and map to new ones. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D155239/new/ https://reviews.llvm.org/D155239 Files:

[PATCH] D155239: [clang-format] Add SpacesInParens with SpacesInParensOptions

2023-07-18 Thread Gedare Bloom via Phabricator via cfe-commits
gedare added a comment. In D155239#4509921 , @HazardyKnusperkeks wrote: > If you limit it to `Never` I don't see any value in the differentiation. You > could just always use `Custom` (by dropping the custom and only having the > nested options). > >

[PATCH] D155529: [clang-format] Add SpaceInParensOption for __attribute__ keyword

2023-07-18 Thread Gedare Bloom via Phabricator via cfe-commits
gedare planned changes to this revision. gedare added a comment. I need to fix this to reflect the changes in the parent rev. Comment at: clang/include/clang/Format/Format.h:4208-4213 +/// Put a space in parentheses inside attribute specifier lists. +/// \code +///

[PATCH] D154755: [clang-format] Fix formatting of if statements with BlockIndent

2023-07-18 Thread Gedare Bloom via Phabricator via cfe-commits
gedare added inline comments. Comment at: clang/unittests/Format/FormatTest.cpp:25486 "comment\n" - " return;\n" "}", MyDeveloperDay wrote: > Why remove? oops. that's a spurious change. I have reverted it.

[PATCH] D154755: [clang-format] Fix formatting of if statements with BlockIndent

2023-07-18 Thread Gedare Bloom via Phabricator via cfe-commits
gedare updated this revision to Diff 541813. gedare marked an inline comment as done. gedare added a comment. Revert deleted line in test. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D154755/new/ https://reviews.llvm.org/D154755 Files:

[PATCH] D154755: [clang-format] Fix formatting of if statements with BlockIndent

2023-07-19 Thread Gedare Bloom via Phabricator via cfe-commits
gedare added a comment. I guess since the current behavior does not treat `if` with block indentation, this bug fix should instead prefer to maintain the current behavior, and if someone wants to have block indentation of `if` it would need to be added as a new style option. Otherwise, this

[PATCH] D154755: [clang-format] Fix formatting of if statements with BlockIndent

2023-07-19 Thread Gedare Bloom via Phabricator via cfe-commits
gedare added inline comments. Comment at: clang/unittests/Format/FormatTest.cpp:25504 + +#if 0 verifyFormat("if (quitelongarg !=\n" MyDeveloperDay wrote: > we don't do this. OK, I'll move that other bug up my priority list, as the behavior of this test case

[PATCH] D155529: [clang-format] Add SpaceInParensOption for __attribute__ keyword

2023-07-19 Thread Gedare Bloom via Phabricator via cfe-commits
gedare updated this revision to Diff 542090. gedare added a comment. Rebase onto D155239 and correctly handle deprecated SpacesInParentheses option. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D155529/new/

[PATCH] D155239: [clang-format] Add SpacesInParens with SpacesInParensOptions

2023-07-19 Thread Gedare Bloom via Phabricator via cfe-commits
gedare updated this revision to Diff 542249. gedare added a comment. Add config parse tests for deprecated options, and add tests for __attribute__ Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D155239/new/ https://reviews.llvm.org/D155239 Files:

[PATCH] D155529: [clang-format] Add SpaceInParensOption for __attribute__ keyword

2023-07-19 Thread Gedare Bloom via Phabricator via cfe-commits
gedare updated this revision to Diff 542254. gedare added a comment. remove blank line Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D155529/new/ https://reviews.llvm.org/D155529 Files: clang/docs/ClangFormatStyleOptions.rst

[PATCH] D155529: [clang-format] Add SpaceInParensOption for __attribute__ keyword

2023-07-19 Thread Gedare Bloom via Phabricator via cfe-commits
gedare updated this revision to Diff 542253. gedare added a comment. Rebase onto D155239 . Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D155529/new/ https://reviews.llvm.org/D155529 Files:

[PATCH] D155239: [clang-format] Add SpacesInParens with SpacesInParensOptions

2023-07-20 Thread Gedare Bloom via Phabricator via cfe-commits
gedare added inline comments. Comment at: clang/unittests/Format/FormatTest.cpp:16791 + verifyFormat("SomeType *__attribute__((attr)) *a = NULL;", Spaces); + verifyFormat("void __attribute__((naked)) foo(int bar)", Spaces); @HazardyKnusperkeks here.

[PATCH] D154755: [clang-format] Fix formatting of if statements with BlockIndent

2023-07-20 Thread Gedare Bloom via Phabricator via cfe-commits
gedare updated this revision to Diff 542625. gedare added a comment. Do not apply BlockIndent to if conditionals. Address other comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D154755/new/ https://reviews.llvm.org/D154755 Files:

[PATCH] D155239: [clang-format] Add SpacesInParens with SpacesInParensOptions

2023-07-20 Thread Gedare Bloom via Phabricator via cfe-commits
gedare added inline comments. Comment at: clang/unittests/Format/FormatTest.cpp:16748 + verifyFormat("SomeType *__attribute__( ( attr ) ) *a = NULL;", Spaces); + verifyFormat("void __attribute__( ( naked ) ) foo( int bar )", Spaces); and here Repository:

[PATCH] D155239: [clang-format] Add SpacesInParens with SpacesInParensOptions

2023-07-20 Thread Gedare Bloom via Phabricator via cfe-commits
gedare updated this revision to Diff 542632. gedare added a comment. fix typo Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D155239/new/ https://reviews.llvm.org/D155239 Files: clang/docs/ClangFormatStyleOptions.rst

[PATCH] D154755: [clang-format] Fix formatting of if statements with BlockIndent

2023-07-20 Thread Gedare Bloom via Phabricator via cfe-commits
gedare marked 3 inline comments as done. gedare added a comment. I have fixed the bug in a different way that avoids using `BlockIndent` on `if` conditionals. `AlwaysBreak` will continue to apply to `if` conditionals by default. I may propose a style option to control that behavior later.

[PATCH] D155239: [clang-format] Add SpacesInParens with SpacesInParensOptions

2023-07-20 Thread Gedare Bloom via Phabricator via cfe-commits
gedare added a comment. In D155239#4520067 , @HazardyKnusperkeks wrote: > Everything is fine, I just need to know how the attribute stuff is formatted > with plain LLVM style. oh, sorry. plain llvm style. I will look for a good place to add that.

[PATCH] D155529: [clang-format] Add SpaceInParensOption for __attribute__ keyword

2023-07-20 Thread Gedare Bloom via Phabricator via cfe-commits
gedare updated this revision to Diff 542651. gedare added a comment. Add one more attribute test. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D155529/new/ https://reviews.llvm.org/D155529 Files: clang/docs/ClangFormatStyleOptions.rst

[PATCH] D155529: [clang-format] Add SpaceInParensOption for __attribute__ keyword

2023-07-20 Thread Gedare Bloom via Phabricator via cfe-commits
gedare updated this revision to Diff 542650. gedare added a comment. Rebase onto D155239 . Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D155529/new/ https://reviews.llvm.org/D155529 Files:

[PATCH] D155239: [clang-format] Add SpacesInParens with SpacesInParensOptions

2023-07-20 Thread Gedare Bloom via Phabricator via cfe-commits
gedare updated this revision to Diff 542649. gedare added a comment. Add more __attribute__ test cases. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D155239/new/ https://reviews.llvm.org/D155239 Files: clang/docs/ClangFormatStyleOptions.rst

[PATCH] D155239: [clang-format] Add SpacesInParens with SpacesInParensOptions

2023-07-20 Thread Gedare Bloom via Phabricator via cfe-commits
gedare added a comment. In D155239#4520067 , @HazardyKnusperkeks wrote: > Everything is fine, I just need to know how the attribute stuff is formatted > with plain LLVM style. `__attribute__` is formatted with plain LLVM style in 5-10 other test

[PATCH] D155529: [clang-format] Add SpaceInParensOption for __attribute__ keyword

2023-07-20 Thread Gedare Bloom via Phabricator via cfe-commits
gedare updated this revision to Diff 542655. gedare added a comment. Add missing parser check. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D155529/new/ https://reviews.llvm.org/D155529 Files: clang/docs/ClangFormatStyleOptions.rst

[PATCH] D153585: [clang-format] Fix align consecutive declarations over function pointers

2023-07-05 Thread Gedare Bloom via Phabricator via cfe-commits
gedare updated this revision to Diff 537359. gedare added a comment. Merge the two if statements. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D153585/new/ https://reviews.llvm.org/D153585 Files: clang/lib/Format/WhitespaceManager.cpp

[PATCH] D153579: [clang-format] Fix RAS reference alignment when PAS is left or middle

2023-07-05 Thread Gedare Bloom via Phabricator via cfe-commits
gedare updated this revision to Diff 537363. gedare edited the summary of this revision. gedare added a comment. Use suggested shorter logic Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D153579/new/ https://reviews.llvm.org/D153579 Files:

[PATCH] D153205: [clang-format] Support block indenting array/struct list initializers

2023-07-05 Thread Gedare Bloom via Phabricator via cfe-commits
gedare added inline comments. Comment at: clang/include/clang/Format/Format.h:95-98 /// \warning -/// Note: This currently only applies to parentheses. +/// Note: This currently only applies to parentheses and braced list +/// initializers when

[PATCH] D153205: [clang-format] Support block indenting array/struct list initializers

2023-07-05 Thread Gedare Bloom via Phabricator via cfe-commits
gedare updated this revision to Diff 537531. gedare added a comment. Address comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D153205/new/ https://reviews.llvm.org/D153205 Files: clang/docs/ClangFormatStyleOptions.rst

[PATCH] D154552: [clang-format] Add note directive generation for docs

2023-07-05 Thread Gedare Bloom via Phabricator via cfe-commits
gedare created this revision. Herald added projects: All, clang, clang-format. Herald added a subscriber: cfe-commits. Herald added reviewers: rymiel, HazardyKnusperkeks, owenpan, MyDeveloperDay. gedare requested review of this revision. Herald added a comment. NOTE: Clang-Format Team Automated

[PATCH] D154550: [clang-format] Allow empty loops on a single line.

2023-07-05 Thread Gedare Bloom via Phabricator via cfe-commits
gedare created this revision. Herald added projects: All, clang, clang-format. Herald added a subscriber: cfe-commits. Herald added reviewers: rymiel, HazardyKnusperkeks, owenpan, MyDeveloperDay. gedare requested review of this revision. Changes the AllowShortLoopsOnASingleLine from a boolean to

[PATCH] D153205: [clang-format] Support block indenting array/struct list initializers

2023-07-05 Thread Gedare Bloom via Phabricator via cfe-commits
gedare updated this revision to Diff 537402. gedare added a comment. Regenerate docs Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D153205/new/ https://reviews.llvm.org/D153205 Files: clang/docs/ClangFormatStyleOptions.rst

[PATCH] D153205: [clang-format] Add new block type ListInit

2023-07-05 Thread Gedare Bloom via Phabricator via cfe-commits
gedare updated this revision to Diff 537399. gedare added a comment. Address comments from owenpan. Do not add the new block type, and instead check explicitly for the equal sign before an opening right brace. Herald added a comment. NOTE: Clang-Format Team Automated Review Comment Your

[PATCH] D153205: [clang-format] Support block indenting array/struct list initializers

2023-07-05 Thread Gedare Bloom via Phabricator via cfe-commits
gedare requested review of this revision. gedare marked 8 inline comments as done. gedare added inline comments. Comment at: clang/lib/Format/ContinuationIndenter.cpp:365-367 + (Current.is(tok::r_brace) && Style.Cpp11BracedListStyle && +

[PATCH] D154755: [clang-format] Fix formatting of if statements with BlockIndent

2023-07-07 Thread Gedare Bloom via Phabricator via cfe-commits
gedare created this revision. Herald added projects: All, clang, clang-format. Herald added a subscriber: cfe-commits. Herald added reviewers: rymiel, HazardyKnusperkeks, owenpan, MyDeveloperDay. gedare requested review of this revision. A bug with BlockIndent prevents line breaks within if (and

[PATCH] D154755: [clang-format] Fix formatting of if statements with BlockIndent

2023-07-07 Thread Gedare Bloom via Phabricator via cfe-commits
gedare added a comment. Although I chose to preserve the existing behavior of `AlwaysBreak` and to mimic it for `BlockIndent`, I think it would be best to choose a consistent approach and document it. I also have a patch that does not apply the AlignAfterOpenBracket for if clauses, which could

[PATCH] D154552: [clang-format] Add note directive generation for docs

2023-07-07 Thread Gedare Bloom via Phabricator via cfe-commits
gedare added a comment. It looks like this: F28163425: image.png Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D154552/new/ https://reviews.llvm.org/D154552 ___

[PATCH] D156360: [clang-format] Support function and overloaded operator SpacesInParensOption

2023-08-01 Thread Gedare Bloom via Phabricator via cfe-commits
gedare added inline comments. Comment at: clang/unittests/Format/FormatTest.cpp:16786 verifyFormat("SomeType *__attribute__( ( attr ) ) *a = NULL;", Spaces); - verifyFormat("void __attribute__( ( naked ) ) foo( int bar )", Spaces); + verifyFormat("void __attribute__( ( x )

[PATCH] D155529: [clang-format] Add SpaceInParensOption for __attribute__ keyword

2023-07-26 Thread Gedare Bloom via Phabricator via cfe-commits
gedare updated this revision to Diff 544466. gedare added a comment. Rebase to 18 Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D155529/new/ https://reviews.llvm.org/D155529 Files: clang/docs/ClangFormatStyleOptions.rst

[PATCH] D156360: [clang-format] Support function and overloaded operator SpacesInParensOption

2023-07-26 Thread Gedare Bloom via Phabricator via cfe-commits
gedare created this revision. Herald added projects: All, clang, clang-format. Herald added a subscriber: cfe-commits. Herald added reviewers: rymiel, HazardyKnusperkeks, owenpan, MyDeveloperDay. gedare requested review of this revision. This change separates function calls, declarations,

[PATCH] D155239: [clang-format] Add SpacesInParens with SpacesInParensOptions

2023-07-24 Thread Gedare Bloom via Phabricator via cfe-commits
gedare updated this revision to Diff 543727. gedare added a comment. Add a release note. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D155239/new/ https://reviews.llvm.org/D155239 Files: clang/docs/ClangFormatStyleOptions.rst

[PATCH] D154550: [clang-format] Allow empty loops on a single line.

2023-07-24 Thread Gedare Bloom via Phabricator via cfe-commits
gedare planned changes to this revision. gedare added a comment. In D154550#4526386 , @owenpan wrote: > Like `while (a);`, `while (a) {}` is also an empty loop, so `NonEmpty` is > misleading if it excludes the former but not the latter. IMO we should

[PATCH] D154550: [clang-format] Allow empty loops on a single line.

2023-07-24 Thread Gedare Bloom via Phabricator via cfe-commits
gedare updated this revision to Diff 543721. gedare added a comment. This revision is now accepted and ready to land. Change option name from NonEmpty to NonNullStatement. Fix space before semi. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D155529: [clang-format] Add SpaceInParensOption for __attribute__ keyword

2023-07-24 Thread Gedare Bloom via Phabricator via cfe-commits
gedare updated this revision to Diff 543729. gedare added a comment. Add a release note. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D155529/new/ https://reviews.llvm.org/D155529 Files: clang/docs/ClangFormatStyleOptions.rst

[PATCH] D154550: [clang-format] Allow empty loops on a single line.

2023-08-05 Thread Gedare Bloom via Phabricator via cfe-commits
gedare added a comment. In D154550#4562061 , @owenpan wrote: > In D154550#4529346 , @gedare wrote: > >> In D154550#4526386 , @owenpan >> wrote: >> >>> Like `while (a);`,

[PATCH] D154550: [clang-format] Allow empty loops on a single line.

2023-08-05 Thread Gedare Bloom via Phabricator via cfe-commits
gedare added a comment. In D154550#4562061 , @owenpan wrote: > In D154550#4529346 , @gedare wrote: > >> In D154550#4526386 , @owenpan >> wrote: >> >>> Like `while (a);`,

[PATCH] D156370: [clang-format] Fix bug with parsing of function/variable names.

2023-07-26 Thread Gedare Bloom via Phabricator via cfe-commits
gedare created this revision. Herald added projects: All, clang, clang-format. Herald added a subscriber: cfe-commits. Herald added reviewers: rymiel, HazardyKnusperkeks, owenpan, MyDeveloperDay. gedare requested review of this revision. Function and variable names are not detected correctly when

[PATCH] D156370: [clang-format] Fix bug with parsing of function/variable names.

2023-07-26 Thread Gedare Bloom via Phabricator via cfe-commits
gedare added a comment. In D156370#4536793 , @HazardyKnusperkeks wrote: > Does this result in a different annotation? Could you add a test for that? If I understand you correctly, it does, for example: `$ echo "void __attribute__((naked)) foo(int

[PATCH] D156360: [clang-format] Support function and overloaded operator SpacesInParensOption

2023-07-26 Thread Gedare Bloom via Phabricator via cfe-commits
gedare updated this revision to Diff 544544. gedare added a comment. Add tests and correct function call detection. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D156360/new/ https://reviews.llvm.org/D156360 Files:

[PATCH] D153205: [clang-format] Add new block type ListInit

2023-06-17 Thread Gedare Bloom via Phabricator via cfe-commits
gedare created this revision. Herald added projects: All, clang, clang-format. Herald added a subscriber: cfe-commits. Herald added reviewers: rymiel, HazardyKnusperkeks, owenpan, MyDeveloperDay. gedare requested review of this revision. C89 and C90 list initializers are treated differently than

[PATCH] D152975: [clang-format] Allow break after return keyword

2023-06-17 Thread Gedare Bloom via Phabricator via cfe-commits
gedare added a comment. In D152975#4425932 , @HazardyKnusperkeks wrote: > I'd like more tests (and examples how it is before the change), some > operations (+, *, etc.), your stated string literal with and without many > spaces, call chains. Ok.

[PATCH] D153205: [clang-format] Add new block type ListInit

2023-06-17 Thread Gedare Bloom via Phabricator via cfe-commits
gedare added a comment. In D153205#4430528 , @owenpan wrote: > It seems to me that there has been a proliferation of new options being > proposed and/or accepted recently. I'd like to remind everyone of the > long-standing policy >

[PATCH] D153205: [clang-format] Add new block type ListInit

2023-06-22 Thread Gedare Bloom via Phabricator via cfe-commits
gedare added a comment. Can someone land for me? thanks. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D153205/new/ https://reviews.llvm.org/D153205 ___ cfe-commits mailing list

[PATCH] D152975: [clang-format] Allow break after return keyword

2023-06-22 Thread Gedare Bloom via Phabricator via cfe-commits
gedare abandoned this revision. gedare added a comment. I don't like the approach I took. It will be hard (impossible) to tune a default return penalty that ensures backward compatibility. The only way I see to make this work is to add an option to enable breaks after the return keyword. This

[PATCH] D153579: [clang-format] Fix RAS reference alignment when PAS is left or middle

2023-06-22 Thread Gedare Bloom via Phabricator via cfe-commits
gedare added a comment. In D153579#4442346 , @HazardyKnusperkeks wrote: > Could you please split this into two reviews? yes, done, will stage the other review soon. The function pointer alignment requires this fix for the formatting to be correct

[PATCH] D153579: [clang-format] Align consecutive function pointers and references

2023-06-22 Thread Gedare Bloom via Phabricator via cfe-commits
gedare created this revision. Herald added projects: All, clang, clang-format. Herald added a subscriber: cfe-commits. Herald added reviewers: rymiel, HazardyKnusperkeks, owenpan, MyDeveloperDay. gedare requested review of this revision. Allows alignment of consecutive declarations that include

[PATCH] D153579: [clang-format] Align consecutive function pointers and references

2023-06-22 Thread Gedare Bloom via Phabricator via cfe-commits
gedare updated this revision to Diff 533745. gedare edited the summary of this revision. gedare added a comment. Split and keep right-aligned references, will put function pointers in new rev Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D153585: [clang-format] Fix align consecutive declarations over function pointers

2023-06-22 Thread Gedare Bloom via Phabricator via cfe-commits
gedare created this revision. Herald added projects: All, clang, clang-format. Herald added a subscriber: cfe-commits. Herald added reviewers: rymiel, HazardyKnusperkeks, owenpan, MyDeveloperDay. gedare requested review of this revision. Fixes a bug that prevents alignment from proceeding through

[PATCH] D153585: [clang-format] Fix align consecutive declarations over function pointers

2023-06-22 Thread Gedare Bloom via Phabricator via cfe-commits
gedare added a comment. Split this out from D153579 . This requires D153579 first, for the test cases to pass. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D153585/new/

  1   2   >