[PATCH] D144709: [clang-format] Improve QualifierAlignment

2023-03-27 Thread Alexander Hederstaf via Phabricator via cfe-commits
AlexanderHederstaf added a comment. Okay thanks. If the + options works let's go with alexanderhederstaf+l...@gmail.com Thanks again for the review and answers. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D144709/new/ https://reviews.llvm.org/D14

[PATCH] D144709: [clang-format] Improve QualifierAlignment

2023-03-15 Thread Alexander Hederstaf via Phabricator via cfe-commits
AlexanderHederstaf added a comment. In D144709#4193603 , @MyDeveloperDay wrote: > In D144709#4188921 , > @AlexanderHederstaf wrote: > >> What is the next step in the process? Anything I should do? > > If you hav

[PATCH] D144709: [clang-format] Improve QualifierAlignment

2023-03-13 Thread Alexander Hederstaf via Phabricator via cfe-commits
AlexanderHederstaf added a comment. What is the next step in the process? Anything I should do? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D144709/new/ https://reviews.llvm.org/D144709 ___ cfe-commits

[PATCH] D144709: [clang-format] Improve QualifierAlignment

2023-03-06 Thread Alexander Hederstaf via Phabricator via cfe-commits
AlexanderHederstaf requested review of this revision. AlexanderHederstaf added a comment. Refactored using the NonComment() functions and added some tests to verify that it works correctly. In D144709#4171029 , @MyDeveloperDay wrote: > I might have bee

[PATCH] D144709: [clang-format] Improve QualifierAlignment

2023-03-06 Thread Alexander Hederstaf via Phabricator via cfe-commits
AlexanderHederstaf updated this revision to Diff 502563. AlexanderHederstaf added a comment. This revision is now accepted and ready to land. Handle /*c*/ comments inside types. Add >> test to right->left. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.or

[PATCH] D144709: [clang-format] Improve QualifierAlignment

2023-03-06 Thread Alexander Hederstaf via Phabricator via cfe-commits
AlexanderHederstaf planned changes to this revision. AlexanderHederstaf added a comment. Missed right->left in the fix. Also looking a bit at comments, e.g. ns::/*ns2::*/vector v; Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D144709/new/ https:/

[PATCH] D144709: [clang-format] Improve QualifierAlignment

2023-03-06 Thread Alexander Hederstaf via Phabricator via cfe-commits
AlexanderHederstaf updated this revision to Diff 502545. AlexanderHederstaf added a comment. Add extra tests based on https://github.com/llvm/llvm-project/issues/56111 Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D144709/new/ https://reviews.llvm.o

[PATCH] D144709: [clang-format] Improve QualifierAlignment

2023-03-04 Thread Alexander Hederstaf via Phabricator via cfe-commits
AlexanderHederstaf added inline comments. Comment at: clang/unittests/Format/QualifierFixerTest.cpp:733 + // TODO: Something strange is going on with this formating. + verifyFormat("Bar < Foo, const Foo >> ;", "Bar < Foo, Foo const >> ;", Style); + rymiel wrot

[PATCH] D144709: [clang-format] Improve QualifierAlignment

2023-03-02 Thread Alexander Hederstaf via Phabricator via cfe-commits
AlexanderHederstaf added a comment. Thanks for the comments and help on this review. There are a lot of special cases I had not considered before, and while it works on the clang/ and llvm/ subfolders as well as tests and the other repository I tested on, I suppose there could still be some hid

[PATCH] D144709: [clang-format] Improve QualifierAlignment

2023-03-01 Thread Alexander Hederstaf via Phabricator via cfe-commits
AlexanderHederstaf added a comment. In D144709#4160939 , @AlexanderHederstaf wrote: > This code from llvm/tools/llvm-exegesis/lib/SerialSnippetGenerator.cpp failed > with **Right** but without a full list of specifiers. As **static** was not > configur

[PATCH] D144709: [clang-format] Improve QualifierAlignment

2023-03-01 Thread Alexander Hederstaf via Phabricator via cfe-commits
AlexanderHederstaf updated this revision to Diff 501476. AlexanderHederstaf added a comment. Change order for typename and :: as const typename ::Bar b; is valid code. Add code for handling ::template. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D

[PATCH] D144709: [clang-format] Improve QualifierAlignment

2023-03-01 Thread Alexander Hederstaf via Phabricator via cfe-commits
AlexanderHederstaf added a comment. In D144709#4160820 , @MyDeveloperDay wrote: > As tests currently fail can you set it to "planned changes" until they pass > > [ FAILED ] 5 tests, listed below: > [ FAILED ] QualifierFixerTest.RightQualifier >

[PATCH] D144709: [clang-format] Improve QualifierAlignment

2023-03-01 Thread Alexander Hederstaf via Phabricator via cfe-commits
AlexanderHederstaf added a comment. This code from llvm/tools/llvm-exegesis/lib/SerialSnippetGenerator.cpp failed with **Right** but without a full list of specifiers. As **static** was not configured, the } was not discovered by **IsRightQualifier**. Changed some of the qualifier tests to chec

[PATCH] D144709: [clang-format] Improve QualifierAlignment

2023-03-01 Thread Alexander Hederstaf via Phabricator via cfe-commits
AlexanderHederstaf updated this revision to Diff 501420. AlexanderHederstaf added a comment. Distinguish configured qualifiers from other qualifiers. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D144709/new/ https://reviews.llvm.org/D144709 Files:

[PATCH] D144709: [clang-format] Improve QualifierAlignment

2023-02-28 Thread Alexander Hederstaf via Phabricator via cfe-commits
AlexanderHederstaf added a comment. Discovered incorrect code generation for `llvm/include/llvm/ADT/StringMap.h`. using base = StringMapIterBase, const StringMapEntry>; was converted to, removing two characters. I checked the Token length in InsertQualifierAf

[PATCH] D144709: [clang-format] Improve QualifierAlignment

2023-02-28 Thread Alexander Hederstaf via Phabricator via cfe-commits
AlexanderHederstaf updated this revision to Diff 501137. AlexanderHederstaf added a comment. Simplify insertQualifierAfter. Ignore decltype, typeof, and _Atomic. Set length of TT_TemplateCloser to 1. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D144

[PATCH] D144709: [clang-format] Improve QualifierAlignment

2023-02-27 Thread Alexander Hederstaf via Phabricator via cfe-commits
AlexanderHederstaf updated this revision to Diff 500799. AlexanderHederstaf added a comment. Update commit message Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D144709/new/ https://reviews.llvm.org/D144709 Files: clang/lib/Format/QualifierAlignm

[PATCH] D144709: [clang-format] Improve left to right const

2023-02-27 Thread Alexander Hederstaf via Phabricator via cfe-commits
AlexanderHederstaf added a comment. There are a lot of complicated cases when trying to extend this functionality. I addressed a few more and thought that it might be acceptable to avoid adjusting the qualifiers for variable declared as struct Foo const; -> const struct Foo; const struct Fo

[PATCH] D144709: [clang-format] Improve left to right const

2023-02-27 Thread Alexander Hederstaf via Phabricator via cfe-commits
AlexanderHederstaf updated this revision to Diff 500792. AlexanderHederstaf added a comment. Update right to left analyzer Add support for requires clauses Ignore usages of struct/class keyword Add new, and uncomment old tests Fix invalid tests with 'const Foo b* const;' Repository: rG LLVM G

[PATCH] D144709: [clang-format] Improve left to right const

2023-02-27 Thread Alexander Hederstaf via Phabricator via cfe-commits
AlexanderHederstaf updated this revision to Diff 500710. AlexanderHederstaf added a comment. Fix simple types not moving all the way right. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D144709/new/ https://reviews.llvm.org/D144709 Files: clang/l

[PATCH] D144709: [clang-format] Improve left to right const

2023-02-27 Thread Alexander Hederstaf via Phabricator via cfe-commits
AlexanderHederstaf marked 6 inline comments as done. AlexanderHederstaf added a comment. Fixed comments and rebased. Tested right to left on the output of left to right and discovered two cases where the output code would not compile. Added new tests for those cases and I am working on improveme

[PATCH] D144709: [clang-format] Improve left to right const

2023-02-27 Thread Alexander Hederstaf via Phabricator via cfe-commits
AlexanderHederstaf updated this revision to Diff 500697. AlexanderHederstaf added a comment. Rebase after change to pointer to member was merged. Add case for typename used for nested dependent names. Add assertions for template closers/openers. Add commented-out tests for two cases where right t

[PATCH] D144709: [clang-format] Improve west to east const

2023-02-25 Thread Alexander Hederstaf via Phabricator via cfe-commits
AlexanderHederstaf added a comment. Thanks for the review so far! Passes all tests and works in one shot on my test files as well as 3k+ files repository, i.e. it does not have to be run twice. As one use-case of this rule is to be able to checkout code and freely swap between left/right. Then

[PATCH] D144709: [clang-format] Improve west to east const

2023-02-25 Thread Alexander Hederstaf via Phabricator via cfe-commits
AlexanderHederstaf updated this revision to Diff 500403. AlexanderHederstaf added a comment. Add comments for different cases. Add more tests. Fix whitespace issue. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D144709/new/ https://reviews.llvm.org/

[PATCH] D144709: [clang-format] Improve west to east const

2023-02-24 Thread Alexander Hederstaf via Phabricator via cfe-commits
AlexanderHederstaf added a comment. > Highlight by me. That is not acceptable, running the output of `clang-format` > through `clang-format` shall not result in any change. In that case it's > better to not touch it in any way. That is no longer an issue in the latest patch. Repository: rG

[PATCH] D144709: [clang-format] Improve west to east const

2023-02-24 Thread Alexander Hederstaf via Phabricator via cfe-commits
AlexanderHederstaf updated this revision to Diff 500225. AlexanderHederstaf added a comment. Add test with advanced type that would not work before. Add pointer to member. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D144709/new/ https://reviews.ll

[PATCH] D144709: [clang-format] Improve west to east const

2023-02-24 Thread Alexander Hederstaf via Phabricator via cfe-commits
AlexanderHederstaf updated this revision to Diff 500215. AlexanderHederstaf added a comment. Fixed the const/volatile placement. Added a few tests. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D144709/new/ https://reviews.llvm.org/D144709 Files:

[PATCH] D144709: [clang-format] Improve west to east const

2023-02-24 Thread Alexander Hederstaf via Phabricator via cfe-commits
AlexanderHederstaf added a comment. I will add new tests / examples as well as look into the volatile/const ordering. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D144709/new/ https://reviews.llvm.org/D144709 _

[PATCH] D144709: [clang-format] Improve west to east const

2023-02-24 Thread Alexander Hederstaf via Phabricator via cfe-commits
AlexanderHederstaf added a reviewer: MyDeveloperDay. AlexanderHederstaf added a comment. I tried to refactor QualifierAlignmentFixer to handle more types, notably removing the *,&,&& requirement as e.g. const Foo did not work. To avoid moving qualifiers too far, a test for "already east const" i

[PATCH] D144709: [clang-format] Improve west to east const

2023-02-24 Thread Alexander Hederstaf via Phabricator via cfe-commits
AlexanderHederstaf created this revision. Herald added a project: All. AlexanderHederstaf requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Qualifiers were not moved for non-pointer non-simple types. Remove the requirement for *,&,&& and