[PATCH] D127873: [clang-format] Fix misplacement of `*` in declaration of pointer to struct

2022-08-11 Thread Jack Huang via Phabricator via cfe-commits
jackhong12 added a comment. Right, I think we can fix this in the same way. I'll look into it soon. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D127873/new/ https://reviews.llvm.org/D127873 ___ cfe-comm

[PATCH] D127873: [clang-format] Fix misplacement of `*` in declaration of pointer to struct

2022-08-11 Thread Ben Smith via Phabricator via cfe-commits
binji added a comment. This change seems to have also regressed code like this: // before bool b = 3 == int{3} && true; // after bool b = 3 == int{3}&& true; I suppose a similar fix to the one done for multiply should be done for `&&` too? Repository: rG LLVM Github Monorepo CHANGE

[PATCH] D127873: [clang-format] Fix misplacement of `*` in declaration of pointer to struct

2022-07-14 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir added a comment. Proposed https://reviews.llvm.org/D129771. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D127873/new/ https://reviews.llvm.org/D127873 ___ cfe-commits mailing list cfe-commits@li

[PATCH] D127873: [clang-format] Fix misplacement of `*` in declaration of pointer to struct

2022-07-14 Thread Jack Huang via Phabricator via cfe-commits
jackhong12 added a comment. Good point! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D127873/new/ https://reviews.llvm.org/D127873 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.ll

[PATCH] D127873: [clang-format] Fix misplacement of `*` in declaration of pointer to struct

2022-07-14 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir added a comment. In D127873#3651364 , @jackhong12 wrote: > I think we cannot identify `struct`, `union`, `class` or `enum` by the right > bracket. Clang-format will split the input into multiple lines. For instance > `struct Tmp {} *tmp;` will

[PATCH] D127873: [clang-format] Fix misplacement of `*` in declaration of pointer to struct

2022-07-14 Thread Jack Huang via Phabricator via cfe-commits
jackhong12 added a comment. I think we cannot identify `struct`, `union`, `class` or `enum` by the right bracket. Clang-format will split the input into multiple lines. For instance `struct Tmp {} *tmp;` will be separated as `struct Tmp {` and `} *tmp;`. In annotating, we only handle the relat

[PATCH] D127873: [clang-format] Fix misplacement of `*` in declaration of pointer to struct

2022-07-14 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir added a comment. Appears that this regressed examples like this: // before int i = int{16} * 1024; // after int i = int{16}* 1024; Naively it looks like in all added examples, the token preceding the matching `{` of the `}` is one of `struct`, `class`, `union`, `enum`, or a `>`

[PATCH] D127873: [clang-format] Fix misplacement of `*` in declaration of pointer to struct

2022-06-29 Thread Jack Huang 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 rGb646f0955574: [clang-format] Fix misplacement of `*` in declaration of pointer to struct (authored by Huang Zhen-Hong , com

[PATCH] D127873: [clang-format] Fix misplacement of `*` in declaration of pointer to struct

2022-06-28 Thread Björn Schäpers via Phabricator via cfe-commits
HazardyKnusperkeks added a comment. In D127873#3614559 , @jackhong12 wrote: > Sorry, I don't have commit access. @HazardyKnusperkeks, could you help me > commit it? > > If I want to contribute to LLVM in the future, how do I get the commit > permission

[PATCH] D127873: [clang-format] Fix misplacement of `*` in declaration of pointer to struct

2022-06-28 Thread Jack Huang via Phabricator via cfe-commits
jackhong12 added a comment. Sorry, I don't have commit access. @HazardyKnusperkeks, could you help me commit it? If I want to contribute to LLVM in the future, how do I get the commit permission? Does it depend on the number of patches I submit? CHANGES SINCE LAST ACTION https://reviews.llv

[PATCH] D127873: [clang-format] Fix misplacement of `*` in declaration of pointer to struct

2022-06-26 Thread MyDeveloperDay via Phabricator via cfe-commits
MyDeveloperDay accepted this revision. MyDeveloperDay added a comment. This revision is now accepted and ready to land. LGTM CHANGES SINCE LAST ACTION https://reviews.llvm.org/D127873/new/ https://reviews.llvm.org/D127873 ___ cfe-commits mailing li

[PATCH] D127873: [clang-format] Fix misplacement of `*` in declaration of pointer to struct

2022-06-26 Thread Jack Huang via Phabricator via cfe-commits
jackhong12 added a comment. Got it. Thanks for your reply! CHANGES SINCE LAST ACTION https://reviews.llvm.org/D127873/new/ https://reviews.llvm.org/D127873 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailm

[PATCH] D127873: [clang-format] Fix misplacement of `*` in declaration of pointer to struct

2022-06-25 Thread Björn Schäpers via Phabricator via cfe-commits
HazardyKnusperkeks added a comment. But for now you should wait for @MyDeveloperDay that he at least removes the changes needed, or state what you have to change, or even better accept it. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D127873/new/ https://reviews.llvm.org/D127873 _

[PATCH] D127873: [clang-format] Fix misplacement of `*` in declaration of pointer to struct

2022-06-25 Thread Björn Schäpers via Phabricator via cfe-commits
HazardyKnusperkeks added a comment. In D127873#3610106 , @jackhong12 wrote: > Hi. I passed the unit tests on my computer. But the build status here is > failed. The build log only shows the issue is related to `git reset --hard`. > So, I don't know whe

[PATCH] D127873: [clang-format] Fix misplacement of `*` in declaration of pointer to struct

2022-06-25 Thread Jack Huang via Phabricator via cfe-commits
jackhong12 marked 2 inline comments as done. jackhong12 added a comment. Hi. I passed the unit tests on my computer. But the build status here is failed. The build log only shows the issue is related to `git reset --hard`. So, I don't know where the bug is. Could you give me some hints to fix th

[PATCH] D127873: [clang-format] Fix misplacement of `*` in declaration of pointer to struct

2022-06-22 Thread Jack Huang via Phabricator via cfe-commits
jackhong12 updated this revision to Diff 439091. jackhong12 added a comment. Right. It looks better. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D127873/new/ https://reviews.llvm.org/D127873 Files: clang/lib/Format/TokenAnnotator.cpp clang/unittests/Format/FormatTest.cpp clang/u

[PATCH] D127873: [clang-format] Fix misplacement of `*` in declaration of pointer to struct

2022-06-22 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D127873#3600978 , @jackhong12 wrote: > Thanks. I am not sure which modification will be better, the patch I > submitted or the following code. > > FormatToken *BeforeLBraceToken = nullptr; > if (MatchingLBrace) > Befo

[PATCH] D127873: [clang-format] Fix misplacement of `*` in declaration of pointer to struct

2022-06-22 Thread Jack Huang via Phabricator via cfe-commits
jackhong12 updated this revision to Diff 438921. jackhong12 marked an inline comment as done. jackhong12 added a comment. I have added a variable for `MatchingLBrace->getPreviousNonComment()`. Thanks. I am not sure which modification will be better, the patch I submitted or the following code.

[PATCH] D127873: [clang-format] Fix misplacement of `*` in declaration of pointer to struct

2022-06-21 Thread Owen Pan via Phabricator via cfe-commits
owenpan accepted this revision. owenpan added inline comments. Comment at: clang/lib/Format/TokenAnnotator.cpp:2319-2320 + // enable_if<>{} && ... + if (MatchingLBrace && MatchingLBrace->getPreviousNonComment() && + MatchingLBrace->getPreviousNonComment()->is