Page MenuHomePhabricator

Please use GitHub pull requests for new patches. Avoid migrating existing patches. Phabricator shutdown timeline

jackhong12 (Jack Huang)
User

Projects

User does not belong to any projects.

User Details

User Since
Jun 2 2022, 7:41 AM (78 w, 2 d)

Recent Activity

Sep 3 2022

jackhong12 added a comment to D131750: [clang-format] Distinguish logical and after bracket from reference.

Is there any chance we also add this patch to version 15?

Sep 3 2022, 9:11 AM · Restricted Project, Restricted Project, Restricted Project

Aug 30 2022

jackhong12 added inline comments to D132911: [clang-format] Fix annotating when deleting array of pointers.
Aug 30 2022, 6:44 PM · Restricted Project, Restricted Project, Restricted Project
jackhong12 updated the diff for D132911: [clang-format] Fix annotating when deleting array of pointers.

Add left alignment test

Aug 30 2022, 6:41 PM · Restricted Project, Restricted Project, Restricted Project
jackhong12 updated the diff for D132911: [clang-format] Fix annotating when deleting array of pointers.

Use endsSequence to match the pattern

Aug 30 2022, 6:35 PM · Restricted Project, Restricted Project, Restricted Project
jackhong12 added inline comments to D132911: [clang-format] Fix annotating when deleting array of pointers.
Aug 30 2022, 2:53 AM · Restricted Project, Restricted Project, Restricted Project
jackhong12 added a comment to D132911: [clang-format] Fix annotating when deleting array of pointers.

In this case, I think it's dereferencing a pointer instead of multiplying two numbers.

Aug 30 2022, 1:30 AM · Restricted Project, Restricted Project, Restricted Project
jackhong12 updated the summary of D132911: [clang-format] Fix annotating when deleting array of pointers.
Aug 30 2022, 1:02 AM · Restricted Project, Restricted Project, Restricted Project
jackhong12 updated the diff for D132911: [clang-format] Fix annotating when deleting array of pointers.

Annotate * as UnaryOperator instead of PointerOrReference

Aug 30 2022, 12:59 AM · Restricted Project, Restricted Project, Restricted Project

Aug 29 2022

jackhong12 retitled D132911: [clang-format] Fix annotating when deleting array of pointers from Fix annotating when deleting array of pointers to [clang-format] Fix annotating when deleting array of pointers.
Aug 29 2022, 11:42 PM · Restricted Project, Restricted Project, Restricted Project
jackhong12 published D132911: [clang-format] Fix annotating when deleting array of pointers for review.
Aug 29 2022, 11:23 PM · Restricted Project, Restricted Project, Restricted Project

Aug 12 2022

jackhong12 updated the diff for D131750: [clang-format] Distinguish logical and after bracket from reference.

Remove redundant code.

Aug 12 2022, 6:48 PM · Restricted Project, Restricted Project, Restricted Project
jackhong12 updated the diff for D131750: [clang-format] Distinguish logical and after bracket from reference.
Aug 12 2022, 6:43 PM · Restricted Project, Restricted Project, Restricted Project

Aug 11 2022

jackhong12 requested review of D131750: [clang-format] Distinguish logical and after bracket from reference.
Aug 11 2022, 11:39 PM · Restricted Project, Restricted Project, Restricted Project
jackhong12 added a comment to D127873: [clang-format] Fix misplacement of `*` in declaration of pointer to struct.

Right, I think we can fix this in the same way. I'll look into it soon.

Aug 11 2022, 6:46 PM · Restricted Project, Restricted Project, Restricted Project
jackhong12 added a comment to D129771: [clang-format] distinguish multiplication after brace-init from pointer.
Aug 11 2022, 6:45 PM · Restricted Project, Restricted Project, Restricted Project

Jul 14 2022

jackhong12 accepted D129771: [clang-format] distinguish multiplication after brace-init from pointer.

I think we can also add new test cases in clang/unittests/Format/TokenAnnotatorTest.cpp.

Jul 14 2022, 6:55 PM · Restricted Project, Restricted Project, Restricted Project
jackhong12 added a comment to D127873: [clang-format] Fix misplacement of `*` in declaration of pointer to struct.

Good point!

Jul 14 2022, 5:21 AM · Restricted Project, Restricted Project, Restricted Project
jackhong12 added a comment to D127873: [clang-format] Fix misplacement of `*` in declaration of pointer to struct.

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 relation of tokens in a single line, so we cannot know whether } belongs to struct or not.

Jul 14 2022, 4:29 AM · Restricted Project, Restricted Project, Restricted Project

Jul 10 2022

jackhong12 added inline comments to D129061: [Lex] Diagnose macro in command lines.
Jul 10 2022, 10:15 AM · Restricted Project, Restricted Project, Restricted Project
jackhong12 updated the diff for D129061: [Lex] Diagnose macro in command lines.
  • modify option names
  • only allow driver-defined macros used in cc1
Jul 10 2022, 10:07 AM · Restricted Project, Restricted Project, Restricted Project

Jul 9 2022

jackhong12 updated the diff for D129061: [Lex] Diagnose macro in command lines.

I added two flags, -driver-define and -driver-undefine, to indicate macros that the driver defines. And I moved driver-defined macros from <command line> file to <built-in> file, like

Jul 9 2022, 10:16 AM · Restricted Project, Restricted Project, Restricted Project

Jul 4 2022

jackhong12 added a comment to D129061: [Lex] Diagnose macro in command lines.

Sorry, I didn't consider some cases. I'll fix it soon!

Jul 4 2022, 2:54 AM · Restricted Project, Restricted Project, Restricted Project

Jul 3 2022

jackhong12 requested review of D129061: [Lex] Diagnose macro in command lines.
Jul 3 2022, 11:59 PM · Restricted Project, Restricted Project, Restricted Project

Jun 29 2022

jackhong12 committed rGb646f0955574: [clang-format] Fix misplacement of `*` in declaration of pointer to struct (authored by Huang Zhen-Hong <jackhunag1205@gmail.com>).
[clang-format] Fix misplacement of `*` in declaration of pointer to struct
Jun 29 2022, 12:21 AM · Restricted Project, Restricted Project
jackhong12 closed D127873: [clang-format] Fix misplacement of `*` in declaration of pointer to struct.
Jun 29 2022, 12:21 AM · Restricted Project, Restricted Project, Restricted Project

Jun 28 2022

jackhong12 added a comment to D127873: [clang-format] Fix misplacement of `*` in declaration of pointer to struct.

Sorry, I don't have commit access. @HazardyKnusperkeks, could you help me commit it?

Jun 28 2022, 12:18 AM · Restricted Project, Restricted Project, Restricted Project

Jun 26 2022

jackhong12 added a comment to D127873: [clang-format] Fix misplacement of `*` in declaration of pointer to struct.

Got it. Thanks for your reply!

Jun 26 2022, 12:36 AM · Restricted Project, Restricted Project, Restricted Project

Jun 25 2022

jackhong12 added a comment to D127873: [clang-format] Fix misplacement of `*` in declaration of pointer to struct.

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 this issue? Thanks!

Jun 25 2022, 5:41 AM · Restricted Project, Restricted Project, Restricted Project

Jun 22 2022

jackhong12 updated the diff for D127873: [clang-format] Fix misplacement of `*` in declaration of pointer to struct.

Right. It looks better.

Jun 22 2022, 10:43 AM · Restricted Project, Restricted Project, Restricted Project
jackhong12 updated the diff for D127873: [clang-format] Fix misplacement of `*` in declaration of pointer to struct.

I have added a variable for MatchingLBrace->getPreviousNonComment().

Jun 22 2022, 12:15 AM · Restricted Project, Restricted Project, Restricted Project

Jun 21 2022

jackhong12 updated the diff for D127873: [clang-format] Fix misplacement of `*` in declaration of pointer to struct.

Thanks for your reply! I added comments for each clause.

Jun 21 2022, 5:57 AM · Restricted Project, Restricted Project, Restricted Project

Jun 20 2022

jackhong12 added inline comments to D127873: [clang-format] Fix misplacement of `*` in declaration of pointer to struct.
Jun 20 2022, 7:41 AM · Restricted Project, Restricted Project, Restricted Project

Jun 19 2022

jackhong12 updated the diff for D127873: [clang-format] Fix misplacement of `*` in declaration of pointer to struct.

Just like mentioned above, UnwrappedLineParser will split the input into multiple lines. And MatchingParen will be reset before annotating(code). So when defining a struct, union, or class, the MatchingParen of the right brace will be NULL. If we want to access the left matching brace from the right brace, we need to add new member data, which saves the address of the left brace token, in class FormatToken.
In my opinion, it will be too complicated. Instead of MatchingParen, I categorize the tokens by checking whether it is a template because && will be a binary operator only in a template. In the other cases, && is likely a reference operator.

Jun 19 2022, 7:59 AM · Restricted Project, Restricted Project, Restricted Project

Jun 17 2022

jackhong12 added inline comments to D127873: [clang-format] Fix misplacement of `*` in declaration of pointer to struct.
Jun 17 2022, 10:27 AM · Restricted Project, Restricted Project, Restricted Project
jackhong12 added inline comments to D127873: [clang-format] Fix misplacement of `*` in declaration of pointer to struct.
Jun 17 2022, 10:12 AM · Restricted Project, Restricted Project, Restricted Project
jackhong12 updated the diff for D127873: [clang-format] Fix misplacement of `*` in declaration of pointer to struct.

Add Left/Middle/Right alignment test cases.

Jun 17 2022, 6:50 AM · Restricted Project, Restricted Project, Restricted Project
jackhong12 updated the diff for D127873: [clang-format] Fix misplacement of `*` in declaration of pointer to struct.
  • Add annotator test
  • Add formatting test
  • Handle reference cases by PrevToken->MatchingParen
Jun 17 2022, 6:14 AM · Restricted Project, Restricted Project, Restricted Project

Jun 16 2022

jackhong12 added a comment to D127873: [clang-format] Fix misplacement of `*` in declaration of pointer to struct.

I think it's a good idea. When does MatchingParen bind? The value of PrevToken->MatchingParen is still NULL in determineStarAmpUsage function.

Jun 16 2022, 10:25 AM · Restricted Project, Restricted Project, Restricted Project
jackhong12 updated the summary of D127873: [clang-format] Fix misplacement of `*` in declaration of pointer to struct.
Jun 16 2022, 3:44 AM · Restricted Project, Restricted Project, Restricted Project

Jun 15 2022

jackhong12 added a reviewer for D127873: [clang-format] Fix misplacement of `*` in declaration of pointer to struct: owenpan.
Jun 15 2022, 9:31 AM · Restricted Project, Restricted Project, Restricted Project
jackhong12 requested review of D127873: [clang-format] Fix misplacement of `*` in declaration of pointer to struct.
Jun 15 2022, 9:28 AM · Restricted Project, Restricted Project, Restricted Project