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

2023-07-24 Thread Owen Pan 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 rGc669541c969c: [clang-format] Add SpacesInParens with SpacesInParensOptions (authored by gedare, committed by owenpan). Changed prior to commit: ht

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

2023-07-24 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/docs/ReleaseNotes.rst:830 +- Add ``SpacesInParens`` style with ``SpacesInParensOptions`` to replace + ``SpacesInConditionalStatement``, ``SpacesInCStyleCastParentheses``, + ``SpaceInEmptyParentheses``, and ``SpacesInParentheses`

[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 clang/docs/Releas

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

2023-07-20 Thread Björn Schäpers via Phabricator via cfe-commits
HazardyKnusperkeks accepted this revision. HazardyKnusperkeks added a comment. This revision is now accepted and ready to land. Nice work. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D155239/new/ https://reviews.llvm.org/D155239 _

[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 cases.

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

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

2023-07-20 Thread Björn Schäpers via Phabricator via cfe-commits
HazardyKnusperkeks added a comment. In D155239#4520081 , @gedare wrote: > In D155239#4520067 , > @HazardyKnusperkeks wrote: > >> Everything is fine, I just need to know how the attribute stuff is formatted >> wi

[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 clang/include/clang/Format/F

[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. Rep

[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 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. Reposit

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

2023-07-20 Thread Björn Schäpers via Phabricator via cfe-commits
HazardyKnusperkeks added a comment. Everything is fine, I just need to know how the attribute stuff is formatted with plain LLVM style. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D155239/new/ https://reviews.llvm.org/D155239 ___

[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] D155239: [clang-format] Add SpacesInParens with SpacesInParensOptions

2023-07-19 Thread Björn Schäpers via Phabricator via cfe-commits
HazardyKnusperkeks requested changes to this revision. HazardyKnusperkeks added a comment. This revision now requires changes to proceed. D155529#inline-1505573 But what does `clang-format` without this patch format? I just want to make sure, that

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

2023-07-18 Thread MyDeveloperDay via Phabricator via cfe-commits
MyDeveloperDay accepted this revision. MyDeveloperDay added a comment. This revision is now accepted and ready to land. This looks good can you wait for one of the others to accept too Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D155239/new/ https

[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). > > B

[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: clang/docs/ClangFormatStyleOptio

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

2023-07-18 Thread Björn Schäpers via Phabricator via cfe-commits
HazardyKnusperkeks added a comment. 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). But I think having at least the `Always` option would be nice. If you want **always** to

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

2023-07-17 Thread MyDeveloperDay via Phabricator via cfe-commits
MyDeveloperDay added inline comments. Comment at: clang/lib/Format/Format.cpp:1035 IO.mapOptional("SpaceInEmptyBlock", Style.SpaceInEmptyBlock); -IO.mapOptional("SpaceInEmptyParentheses", Style.SpaceInEmptyParentheses); IO.mapOptional("SpacesBeforeTrailingComments",

[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 allows,

[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/ https

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

2023-07-16 Thread MyDeveloperDay via Phabricator via cfe-commits
MyDeveloperDay added inline comments. Comment at: clang/lib/Format/TokenAnnotator.cpp:4046 + ? (Style.SpacesInParens == FormatStyle::SIPO_Always || + Style.SpacesInParentheses) + : true; isn't SpacesInParentheses mappe

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

2023-07-15 Thread Björn Schäpers via Phabricator via cfe-commits
HazardyKnusperkeks added inline comments. Comment at: clang/include/clang/Format/Format.h:4220 /// \version 3.7 bool SpacesInParentheses; The deprecated options should be removed from the struct, see `AllowAllConstructorInitializersOnNextLine` for an exa

[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 `EmptyParenthe

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