Page MenuHomePhabricator

owenpan (Owen Pan)
User

Projects

User does not belong to any projects.

User Details

User Since
Aug 14 2018, 4:06 AM (44 w, 6 d)

Recent Activity

Wed, Jun 5

owenpan accepted D61729: [docs] Fix example for Allman brace breaking style.

LGTM

Wed, Jun 5, 1:48 PM · Restricted Project, Restricted Project

Sat, Jun 1

owenpan added a comment to D61729: [docs] Fix example for Allman brace breaking style.

This file is generated from the clang/include/clang/Format/Format.h header file by the clang/docs/tools/dump_format_style.py script. Please update the header file and rerun the script.

Sat, Jun 1, 11:33 AM · Restricted Project, Restricted Project

May 8 2019

owenpan committed rG4ba5269f33ff: [clang-format] Fix the crash when formatting unsupported encodings (authored by owenpan).
[clang-format] Fix the crash when formatting unsupported encodings
May 8 2019, 7:11 AM
owenpan committed rC360257: [clang-format] Fix the crash when formatting unsupported encodings.
[clang-format] Fix the crash when formatting unsupported encodings
May 8 2019, 7:11 AM
owenpan committed rL360257: [clang-format] Fix the crash when formatting unsupported encodings.
[clang-format] Fix the crash when formatting unsupported encodings
May 8 2019, 7:11 AM
owenpan closed D61559: Fix the crash when formatting unsupported encodings.
May 8 2019, 7:11 AM · Restricted Project, Restricted Project
owenpan added inline comments to D61559: Fix the crash when formatting unsupported encodings.
May 8 2019, 7:05 AM · Restricted Project, Restricted Project
owenpan updated the diff for D61559: Fix the crash when formatting unsupported encodings.

Fixed the typo for SCSU.

May 8 2019, 7:02 AM · Restricted Project, Restricted Project
owenpan committed rGd064c71802ac: [clang] Fix a bug that reports UTF32 (LE) files as UTF16 (LE) ones (authored by owenpan).
[clang] Fix a bug that reports UTF32 (LE) files as UTF16 (LE) ones
May 8 2019, 6:47 AM
owenpan committed rC360256: [clang] Fix a bug that reports UTF32 (LE) files as UTF16 (LE) ones.
[clang] Fix a bug that reports UTF32 (LE) files as UTF16 (LE) ones
May 8 2019, 6:47 AM
owenpan committed rL360256: [clang] Fix a bug that reports UTF32 (LE) files as UTF16 (LE) ones.
[clang] Fix a bug that reports UTF32 (LE) files as UTF16 (LE) ones
May 8 2019, 6:47 AM
owenpan closed D61628: Fix a bug that reports UTF16 (LE) files as UTF32 (LE) ones.
May 8 2019, 6:47 AM · Restricted Project, Restricted Project

May 7 2019

owenpan added a comment to D61628: Fix a bug that reports UTF16 (LE) files as UTF32 (LE) ones.

This patch fixes clang. I copied the code from here to clang/tools/clang-format/ClangFormat.cpp in D61559 to fix clang-format. I'm not sure if the code here should be moved into a function, though.

May 7 2019, 9:34 AM · Restricted Project, Restricted Project
owenpan added a comment to D61559: Fix the crash when formatting unsupported encodings.

I copied the code from clang/lib/Basic/SourceManager.cpp. See D61628.

May 7 2019, 9:34 AM · Restricted Project, Restricted Project
owenpan created D61628: Fix a bug that reports UTF16 (LE) files as UTF32 (LE) ones.
May 7 2019, 1:03 AM · Restricted Project, Restricted Project

May 5 2019

owenpan updated the diff for D61559: Fix the crash when formatting unsupported encodings.

Moved "UTF-32 (LE)" to before "UTF-16 (LE)" in llvm::StringSwitch so that the former BOM wouldn't be misnamed as the latter.

May 5 2019, 3:35 PM · Restricted Project, Restricted Project

May 4 2019

owenpan created D61559: Fix the crash when formatting unsupported encodings.
May 4 2019, 10:41 PM · Restricted Project, Restricted Project

May 3 2019

owenpan committed rG3dcb892d2d6f: [clang-format] Fix bug in block comment reflow that joins * and / (authored by owenpan).
[clang-format] Fix bug in block comment reflow that joins * and /
May 3 2019, 4:14 PM
owenpan committed rC359943: [clang-format] Fix bug in block comment reflow that joins * and /.
[clang-format] Fix bug in block comment reflow that joins * and /
May 3 2019, 4:13 PM
owenpan committed rL359943: [clang-format] Fix bug in block comment reflow that joins * and /.
[clang-format] Fix bug in block comment reflow that joins * and /
May 3 2019, 4:13 PM
owenpan closed D61276: [clang-format] Fix bug in block comment reflow that joins * and /.
May 3 2019, 4:13 PM · Restricted Project, Restricted Project
owenpan updated the diff for D61276: [clang-format] Fix bug in block comment reflow that joins * and /.

Updated the test cases to make them precise and more varied.

May 3 2019, 4:13 PM · Restricted Project, Restricted Project

May 2 2019

owenpan updated the diff for D61276: [clang-format] Fix bug in block comment reflow that joins * and /.

Updated the patch to cover all scenarios in which the bug might be triggered.

May 2 2019, 2:10 AM · Restricted Project, Restricted Project
owenpan planned changes to D61276: [clang-format] Fix bug in block comment reflow that joins * and /.

There are some corner cases this patch doesn't cover.

May 2 2019, 1:31 AM · Restricted Project, Restricted Project

May 1 2019

owenpan committed rGa0df4d37b0f6: [clang-format] Fix a bug in AlignConsecutiveDeclarations. (authored by owenpan).
[clang-format] Fix a bug in AlignConsecutiveDeclarations.
May 1 2019, 11:25 AM
owenpan committed rC359711: [clang-format] Fix a bug in AlignConsecutiveDeclarations..
[clang-format] Fix a bug in AlignConsecutiveDeclarations.
May 1 2019, 11:21 AM
owenpan committed rL359711: [clang-format] Fix a bug in AlignConsecutiveDeclarations..
[clang-format] Fix a bug in AlignConsecutiveDeclarations.
May 1 2019, 11:21 AM
owenpan closed D61222: [clang-format] Fix a bug in AlignConsecutiveDeclarations.
May 1 2019, 11:21 AM · Restricted Project, Restricted Project
owenpan updated the diff for D61222: [clang-format] Fix a bug in AlignConsecutiveDeclarations.

Removed a redundant test case.

May 1 2019, 11:19 AM · Restricted Project, Restricted Project
owenpan added a comment to D61276: [clang-format] Fix bug in block comment reflow that joins * and /.

@MyDeveloperDay In theory, any whitespace character other than a blank might trigger the bug, but in practice, we only need to handle the tab, IMO.

May 1 2019, 8:16 AM · Restricted Project, Restricted Project
owenpan committed rG945890a63cbb: [clang-format] Fix bug that misses some function-like macro usages (authored by owenpan).
[clang-format] Fix bug that misses some function-like macro usages
May 1 2019, 8:04 AM
owenpan committed rC359687: [clang-format] Fix bug that misses some function-like macro usages.
[clang-format] Fix bug that misses some function-like macro usages
May 1 2019, 8:04 AM
owenpan committed rL359687: [clang-format] Fix bug that misses some function-like macro usages.
[clang-format] Fix bug that misses some function-like macro usages
May 1 2019, 8:01 AM
owenpan closed D61297: [clang-format] Fix bug that misses some function-like macro usages.
May 1 2019, 8:01 AM · Restricted Project, Restricted Project

Apr 30 2019

owenpan created D61297: [clang-format] Fix bug that misses some function-like macro usages.
Apr 30 2019, 1:51 AM · Restricted Project, Restricted Project

Apr 29 2019

owenpan created D61276: [clang-format] Fix bug in block comment reflow that joins * and /.
Apr 29 2019, 1:05 PM · Restricted Project, Restricted Project

Apr 27 2019

owenpan requested review of D61222: [clang-format] Fix a bug in AlignConsecutiveDeclarations.
Apr 27 2019, 5:13 PM · Restricted Project, Restricted Project
owenpan updated the diff for D61222: [clang-format] Fix a bug in AlignConsecutiveDeclarations.

Fix it in WhitespaceManager::alignConsecutiveDeclarations() instead.

Apr 27 2019, 5:08 PM · Restricted Project, Restricted Project
owenpan planned changes to D61222: [clang-format] Fix a bug in AlignConsecutiveDeclarations.

Tested it a bit more and found another problem. The code

DECOR1 uint32_t DECOR2 function1 (int arg1, int arg2) { return 1U; }
DECOR1 unsigned DECOR2 function2 (int arg1, int arg2) { return 1U; }

would still be misformatted to:

DECOR1 uint32_t DECOR2
       function1(int arg1, int arg2) { return 1U; }
DECOR1 unsigned DECOR2
function2(int arg1, int arg2) { return 1U; }
Apr 27 2019, 4:18 PM · Restricted Project, Restricted Project
owenpan created D61222: [clang-format] Fix a bug in AlignConsecutiveDeclarations.
Apr 27 2019, 2:10 AM · Restricted Project, Restricted Project

Apr 26 2019

owenpan committed rGd7f287f5b1d8: [clang-format] Fix documentation for FixNamespaceComments (authored by owenpan).
[clang-format] Fix documentation for FixNamespaceComments
Apr 26 2019, 12:04 AM
owenpan committed rC359280: [clang-format] Fix documentation for FixNamespaceComments.
[clang-format] Fix documentation for FixNamespaceComments
Apr 26 2019, 12:04 AM
owenpan committed rL359280: [clang-format] Fix documentation for FixNamespaceComments.
[clang-format] Fix documentation for FixNamespaceComments
Apr 26 2019, 12:04 AM
owenpan closed D61174: [clang-format] Fix documentation for FixNamespaceComments.
Apr 26 2019, 12:04 AM · Restricted Project, Restricted Project

Apr 25 2019

owenpan created D61174: [clang-format] Fix documentation for FixNamespaceComments.
Apr 25 2019, 11:56 PM · Restricted Project, Restricted Project
owenpan updated the summary of D60853: clang-format converts a keyword macro definition to a macro function.
Apr 25 2019, 12:17 AM · Restricted Project, Restricted Project

Apr 23 2019

owenpan committed rG108cbbc262ff: [clang-format] Fix bug in reflow of block comments containing CR/LF (authored by owenpan).
[clang-format] Fix bug in reflow of block comments containing CR/LF
Apr 23 2019, 1:29 PM
owenpan committed rL359029: [clang-format] Fix bug in reflow of block comments containing CR/LF.
[clang-format] Fix bug in reflow of block comments containing CR/LF
Apr 23 2019, 1:28 PM
owenpan committed rC359029: [clang-format] Fix bug in reflow of block comments containing CR/LF.
[clang-format] Fix bug in reflow of block comments containing CR/LF
Apr 23 2019, 1:28 PM
owenpan closed D60996: [clang-format] Fix bug in reflow of block comments containing CR/LF.
Apr 23 2019, 1:28 PM · Restricted Project
owenpan updated the diff for D60996: [clang-format] Fix bug in reflow of block comments containing CR/LF.

Removes a redundant test case.

Apr 23 2019, 9:36 AM · Restricted Project
owenpan updated the diff for D60996: [clang-format] Fix bug in reflow of block comments containing CR/LF.

Removes a no longer needed hack that worked around this bug when computing StartOfLine in the BreakableBlockComment::adjustWhitespace function.

Apr 23 2019, 2:14 AM · Restricted Project
owenpan updated the summary of D60996: [clang-format] Fix bug in reflow of block comments containing CR/LF.
Apr 23 2019, 2:04 AM · Restricted Project
owenpan updated subscribers of D60996: [clang-format] Fix bug in reflow of block comments containing CR/LF.
Apr 23 2019, 12:21 AM · Restricted Project
owenpan created D60996: [clang-format] Fix bug in reflow of block comments containing CR/LF.
Apr 23 2019, 12:19 AM · Restricted Project

Apr 18 2019

owenpan committed rGfb73b79a14d5: [clang-format] Fix incorrect formatting of keyword macro definition (authored by owenpan).
[clang-format] Fix incorrect formatting of keyword macro definition
Apr 18 2019, 1:16 PM
owenpan committed rC358710: [clang-format] Fix incorrect formatting of keyword macro definition.
[clang-format] Fix incorrect formatting of keyword macro definition
Apr 18 2019, 1:16 PM
owenpan committed rL358710: [clang-format] Fix incorrect formatting of keyword macro definition.
[clang-format] Fix incorrect formatting of keyword macro definition
Apr 18 2019, 1:16 PM
owenpan closed D60853: clang-format converts a keyword macro definition to a macro function.
Apr 18 2019, 1:16 PM · Restricted Project, Restricted Project
owenpan added inline comments to D60853: clang-format converts a keyword macro definition to a macro function.
Apr 18 2019, 9:36 AM · Restricted Project, Restricted Project

Apr 17 2019

owenpan retitled D60853: clang-format converts a keyword macro definition to a macro function from clang-format incorrectly inserts a space after a macro function name that is a keyword to clang-format incorrectly converts a keyword macro definition to a macro function.
Apr 17 2019, 10:55 PM · Restricted Project, Restricted Project
owenpan retitled D60853: clang-format converts a keyword macro definition to a macro function from clang-format incorrectly converts a keyword macro definition to a macro function to clang-format converts a keyword macro definition to a macro function.
Apr 17 2019, 10:55 PM · Restricted Project, Restricted Project
owenpan added a comment to D60362: [clang-format] [PR39719] clang-format converting object-like macro to function-like macro.

Actually, there is a neater way: https://reviews.llvm.org/D60853

Apr 17 2019, 10:46 PM · Restricted Project
owenpan created D60853: clang-format converts a keyword macro definition to a macro function.
Apr 17 2019, 10:38 PM · Restricted Project, Restricted Project
owenpan added a comment to D60362: [clang-format] [PR39719] clang-format converting object-like macro to function-like macro.

A more straightforward way, IMO, is to add to the spaceRequiredBetween function a separate if statement that returns false for the sequence of tokens: #, define, tok::identifier, and (

Apr 17 2019, 5:31 PM · Restricted Project

Apr 14 2019

owenpan accepted D60363: [clang-format] [PR41170] Break after return type ignored with certain comments positions.

Looks good!

Apr 14 2019, 11:33 AM · Restricted Project, Restricted Project

Apr 9 2019

owenpan closed D52527: [clang-format] fix Bug 38686: add AfterCaseLabel to BraceWrapping.

llvm-svn: 357957

Apr 9 2019, 12:23 AM · Restricted Project

Apr 8 2019

owenpan committed rG806d5741aa7f: [clang-format] Add AfterCaseLabel to BraceWrapping (authored by owenpan).
[clang-format] Add AfterCaseLabel to BraceWrapping
Apr 8 2019, 4:36 PM
owenpan committed rL357957: [clang-format] Add AfterCaseLabel to BraceWrapping.
[clang-format] Add AfterCaseLabel to BraceWrapping
Apr 8 2019, 4:36 PM
owenpan committed rC357957: [clang-format] Add AfterCaseLabel to BraceWrapping.
[clang-format] Add AfterCaseLabel to BraceWrapping
Apr 8 2019, 4:35 PM
owenpan added a comment to D52527: [clang-format] fix Bug 38686: add AfterCaseLabel to BraceWrapping.

do you happen to know if this script is run by the build or is supposed to be run by the developer after making the change to Format.h

Apr 8 2019, 4:28 PM · Restricted Project
owenpan updated the diff for D52527: [clang-format] fix Bug 38686: add AfterCaseLabel to BraceWrapping.

Thank you to all for reviewing this revision! Here is the update that addresses all of your comments.

Apr 8 2019, 4:19 PM · Restricted Project
owenpan added inline comments to D60363: [clang-format] [PR41170] Break after return type ignored with certain comments positions.
Apr 8 2019, 1:04 PM · Restricted Project, Restricted Project

Apr 7 2019

owenpan added a reviewer for D60362: [clang-format] [PR39719] clang-format converting object-like macro to function-like macro: sammccall.
Apr 7 2019, 11:54 PM · Restricted Project
owenpan requested changes to D60362: [clang-format] [PR39719] clang-format converting object-like macro to function-like macro.
Apr 7 2019, 11:52 PM · Restricted Project
owenpan added a reviewer for D60363: [clang-format] [PR41170] Break after return type ignored with certain comments positions: sammccall.

I added @sammccall to the reviewer list as I'm not sure if we need all these test cases or if there are overlaps among them. It seems all we need is a test case that has a function definition which has a comment after the closing parenthesis of the function header, e.g.:

void
foo() // this might be a function definition
{
}
Apr 7 2019, 7:35 PM · Restricted Project, Restricted Project
owenpan requested changes to D60363: [clang-format] [PR41170] Break after return type ignored with certain comments positions.
Apr 7 2019, 3:19 PM · Restricted Project, Restricted Project
owenpan committed rGe4f95e8e39b6: [clang-format] Fix bug https://bugs.llvm.org/show_bug.cgi?id=41413 (authored by owenpan).
[clang-format] Fix bug https://bugs.llvm.org/show_bug.cgi?id=41413
Apr 7 2019, 2:06 PM
owenpan committed rC357877: [clang-format] Fix bug https://bugs.llvm.org/show_bug.cgi?id=41413.
[clang-format] Fix bug https://bugs.llvm.org/show_bug.cgi?id=41413
Apr 7 2019, 2:06 PM
owenpan committed rL357877: [clang-format] Fix bug https://bugs.llvm.org/show_bug.cgi?id=41413.
[clang-format] Fix bug https://bugs.llvm.org/show_bug.cgi?id=41413
Apr 7 2019, 2:06 PM
owenpan closed D60374: clang-format incorrectly indents wrapped closing parenthesis.
Apr 7 2019, 2:05 PM · Restricted Project, Restricted Project
owenpan requested review of D60374: clang-format incorrectly indents wrapped closing parenthesis.

Updated the diff.

Apr 7 2019, 1:43 PM · Restricted Project, Restricted Project
owenpan updated the diff for D60374: clang-format incorrectly indents wrapped closing parenthesis.
Apr 7 2019, 1:41 PM · Restricted Project, Restricted Project
owenpan added a comment to D60374: clang-format incorrectly indents wrapped closing parenthesis.

LGTM , if you also think the test will help show the use case then please add it, otherwise this revision notes might be information enough

Apr 7 2019, 1:24 PM · Restricted Project, Restricted Project
owenpan planned changes to D60374: clang-format incorrectly indents wrapped closing parenthesis.
Apr 7 2019, 12:52 PM · Restricted Project, Restricted Project
owenpan added a comment to D60374: clang-format incorrectly indents wrapped closing parenthesis.

maybe add the following as a test because I think it shows the inconsistency

void Foo::bar( // some comment
) {}

void Foo::bar( // some comment
) const {}
Apr 7 2019, 12:37 PM · Restricted Project, Restricted Project
owenpan added a comment to D60374: clang-format incorrectly indents wrapped closing parenthesis.

The previous behavior looks intentional, and much more regular. I'd be curious why you think the proposed behavior is more readable.

Apr 7 2019, 12:27 PM · Restricted Project, Restricted Project

Apr 6 2019

owenpan created D60374: clang-format incorrectly indents wrapped closing parenthesis.
Apr 6 2019, 11:01 PM · Restricted Project, Restricted Project
owenpan added a reviewer for D52527: [clang-format] fix Bug 38686: add AfterCaseLabel to BraceWrapping: MyDeveloperDay.
Apr 6 2019, 4:49 PM · Restricted Project
owenpan added a comment to D52527: [clang-format] fix Bug 38686: add AfterCaseLabel to BraceWrapping.

@MyDeveloperDay: Can you add a link to the bugzilla report?

Apr 6 2019, 4:49 PM · Restricted Project
owenpan committed rGfca07890a991: [clang-format] Fix Bug 41407 Differential Revision: https://reviews.llvm. (authored by owenpan).
[clang-format] Fix Bug 41407 Differential Revision: https://reviews.llvm.
Apr 6 2019, 4:13 PM
owenpan committed rC357851: [clang-format] Fix Bug 41407.
[clang-format] Fix Bug 41407
Apr 6 2019, 4:12 PM
owenpan committed rL357851: [clang-format] Fix Bug 41407.
[clang-format] Fix Bug 41407
Apr 6 2019, 4:12 PM
owenpan closed D60359: [clang-format] Fix incorrect indentation of C++ constructor initializer list.
Apr 6 2019, 4:12 PM · Restricted Project, Restricted Project
owenpan added a comment to D60361: [clang-format] [PR41407] Constructor initializer list indented incorrectly.

I had already proposed a fix:
https://reviews.llvm.org/D60359

Apr 6 2019, 11:53 AM · Restricted Project
owenpan added reviewers for D60359: [clang-format] Fix incorrect indentation of C++ constructor initializer list: MyDeveloperDay, reuk.
Apr 6 2019, 11:51 AM · Restricted Project, Restricted Project

Apr 5 2019

owenpan created D60359: [clang-format] Fix incorrect indentation of C++ constructor initializer list.
Apr 5 2019, 11:25 PM · Restricted Project, Restricted Project
owenpan abandoned D60308: Leave alone the semicolon after the MacroBlockBegin name.

The semicolon is redundant but makes the MacroBlockBegin name stand out more. Nonetheless, I agree it's not a bug and we should leave the current behavior as is.

Apr 5 2019, 7:15 PM · Restricted Project

Apr 4 2019

owenpan created D60308: Leave alone the semicolon after the MacroBlockBegin name.
Apr 4 2019, 11:21 PM · Restricted Project

Oct 13 2018

owenpan added a comment to D52527: [clang-format] fix Bug 38686: add AfterCaseLabel to BraceWrapping.

ping

Oct 13 2018, 12:55 PM · Restricted Project