[PATCH] D80144: [clang-format] @lefticus just taught the world how to use [[unlikely]] but we forgot to teach clang-format

2022-12-20 Thread Roel Vercammen via Phabricator via cfe-commits
Roelio81 added a comment. Herald added a project: All. This change also has impact which was undesired on our code base as it now considers all attributes to be "bound" to the if-expression rather than to the if-body. For example, we had this in our code base if (condition)

[PATCH] D80144: [clang-format] @lefticus just taught the world how to use [[unlikely]] but we forgot to teach clang-format

2020-05-26 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir added a comment. In D80144#2054451 , @MyDeveloperDay wrote: > Will this help? D80547: [clang-format] Fix an ObjC regression introduced with > new [[likely]][[unlikely]] support in if/else clauses > This is

Re: [PATCH] D80144: [clang-format] @lefticus just taught the world how to use [[unlikely]] but we forgot to teach clang-format

2020-05-26 Thread Marcus Johnson via cfe-commits
Why objective C? C++ has attributes and so does C2x, and I believe they’re both getting /have the unlikely attribute. > On May 25, 2020, at 1:10 PM, MyDeveloperDay via Phabricator > wrote: > > MyDeveloperDay added a comment. > > > >> I know that we didn't have a test for this in ObjC

[PATCH] D80144: [clang-format] @lefticus just taught the world how to use [[unlikely]] but we forgot to teach clang-format

2020-05-26 Thread MyDeveloperDay via Phabricator via cfe-commits
MyDeveloperDay added a comment. Will this help? D80547: [clang-format] Fix an ObjC regression introduced with new [[likely]][[unlikely]] support in if/else clauses Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D80144: [clang-format] @lefticus just taught the world how to use [[unlikely]] but we forgot to teach clang-format

2020-05-26 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir added a comment. In D80144#2053543 , @MyDeveloperDay wrote: > maybe for now we just do > > if (FormatTok->is(tok::l_square) && !Style.isObjC()) > parseSquare(); > I tried this, however FormatTest.cpp's verifyFormat is picky and

[PATCH] D80144: [clang-format] @lefticus just taught the world how to use [[unlikely]] but we forgot to teach clang-format

2020-05-25 Thread MyDeveloperDay via Phabricator via cfe-commits
MyDeveloperDay added a comment. maybe for now we just do if (FormatTok->is(tok::l_square) && !Style.isObjC()) parseSquare(); Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80144/new/ https://reviews.llvm.org/D80144

[PATCH] D80144: [clang-format] @lefticus just taught the world how to use [[unlikely]] but we forgot to teach clang-format

2020-05-25 Thread MyDeveloperDay via Phabricator via cfe-commits
MyDeveloperDay added a comment. > I know that we didn't have a test for this in ObjC land, but the regression > seems severe enough to revert this Sure go ahead, that's the process. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80144/new/

[PATCH] D80144: [clang-format] @lefticus just taught the world how to use [[unlikely]] but we forgot to teach clang-format

2020-05-25 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir added a comment. Unfortunately this introduced a bad regression with ObjC method expressions in `if` bodies: if (argc > 5) [obj func:arg]; is now formatted as: if (argc > 5)[obj func:arg] ; It seems that at this stage of processing it would be non-trivial to distinguish

[PATCH] D80144: [clang-format] @lefticus just taught the world how to use [[unlikely]] but we forgot to teach clang-format

2020-05-19 Thread MyDeveloperDay via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG5d82cb3c3a6a: [clang-format] @lefticus just taught the world how to use [[unlikely]] but we… (authored by MyDeveloperDay). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D80144: [clang-format] @lefticus just taught the world how to use [[unlikely]] but we forgot to teach clang-format

2020-05-19 Thread Jake Merdich via Phabricator via cfe-commits
JakeMerdichAMD accepted this revision. JakeMerdichAMD added a comment. This revision is now accepted and ready to land. LGTM assuming CI tests pass. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80144/new/ https://reviews.llvm.org/D80144

[PATCH] D80144: [clang-format] @lefticus just taught the world how to use [[unlikely]] but we forgot to teach clang-format

2020-05-19 Thread MyDeveloperDay via Phabricator via cfe-commits
MyDeveloperDay added a comment. In D80144#2042926 , @JakeMerdichAMD wrote: > This is a great improvement in readability. I think this will get in here > before it does for clang proper :D > > Likely/unlikely also seem to be supported on while, do-while,

[PATCH] D80144: [clang-format] @lefticus just taught the world how to use [[unlikely]] but we forgot to teach clang-format

2020-05-18 Thread Jake Merdich via Phabricator via cfe-commits
JakeMerdichAMD added a comment. This is a great improvement in readability. I think this will get in here before it does for clang proper :D Likely/unlikely also seem to be supported on while, do-while, and for loops (case statements too, but that's not relevant). Should we also apply

[PATCH] D80144: [clang-format] @lefticus just taught the world how to use [[unlikely]] but we forgot to teach clang-format

2020-05-18 Thread MyDeveloperDay via Phabricator via cfe-commits
MyDeveloperDay updated this revision to Diff 264717. MyDeveloperDay added a comment. rebase CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80144/new/ https://reviews.llvm.org/D80144 Files: clang/lib/Format/UnwrappedLineParser.cpp clang/unittests/Format/FormatTest.cpp Index:

[PATCH] D80144: [clang-format] @lefticus just taught the world how to use [[unlikely]] but we forgot to teach clang-format

2020-05-18 Thread MyDeveloperDay via Phabricator via cfe-commits
MyDeveloperDay created this revision. MyDeveloperDay added reviewers: krasimir, mitchell-stellar, JakeMerdichAMD, curdeius, lefticus. MyDeveloperDay added projects: clang, clang-format. https://twitter.com/lefticus/status/1262392152950288384?s=20 Jason Turner's (@lefticus) most recent C++