Page MenuHomePhabricator

owenpan (Owen Pan)
User

Projects

User does not belong to any projects.

User Details

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

Recent Activity

Yesterday

owenpan committed rG37860d524e86: [clang-format] Fix a bug that joins template closer and = (authored by owenpan).
[clang-format] Fix a bug that joins template closer and =
Sun, Aug 18, 11:52 AM
owenpan committed rL369214: [clang-format] Fix a bug that joins template closer and =.
[clang-format] Fix a bug that joins template closer and =
Sun, Aug 18, 11:51 AM
owenpan closed D66384: [clang-format] Fix a bug that joins template closer and =.
Sun, Aug 18, 11:50 AM · Restricted Project, Restricted Project
owenpan added inline comments to D66384: [clang-format] Fix a bug that joins template closer and =.
Sun, Aug 18, 11:49 AM · Restricted Project, Restricted Project
owenpan added a comment to D66384: [clang-format] Fix a bug that joins template closer and =.

although I would still question whether Style.SpaceBeforeAssignmentOperators is providing anyone any benefit at all.

Sun, Aug 18, 10:51 AM · Restricted Project, Restricted Project

Sat, Aug 17

owenpan created D66384: [clang-format] Fix a bug that joins template closer and =.
Sat, Aug 17, 5:36 PM · Restricted Project, Restricted Project

Fri, Aug 16

owenpan added a comment to D66332: [clang-format] Fix the bug that joins template closer and > or >>.

Are there any other clang-format options that might lead to a lack-of-space before >, >=, ==, or =? I brought up enable_if_t<Foo, int>=0 because that specifically is a construction I've run into in my own code, even though I've never tried to clang-format it, let alone have it formatted incorrectly.

Any token that starts with >, e.g., >, >>, >=, and >>=, are already taken care of by this patch. For tokens starting with =, only the assignment operator = has a problem and it only occurs when SpaceBeforeAssignmentOperators is set to true.

Fri, Aug 16, 10:48 PM · Restricted Project
owenpan committed rGac67414618df: [clang-format] Fix the bug that joins template closer and > or >> (authored by owenpan).
[clang-format] Fix the bug that joins template closer and > or >>
Fri, Aug 16, 2:49 PM
owenpan committed rL369157: [clang-format] Fix the bug that joins template closer and > or >>.
[clang-format] Fix the bug that joins template closer and > or >>
Fri, Aug 16, 2:49 PM
owenpan closed D66332: [clang-format] Fix the bug that joins template closer and > or >>.
Fri, Aug 16, 2:49 PM · Restricted Project
owenpan added a comment to D66332: [clang-format] Fix the bug that joins template closer and > or >>.

Drive-by observation: My experiments with https://zed0.co.uk/clang-format-configurator/ show that there is a similar bug where clang-format accidentally produces >= via reformatting of template<enable_if_t<Foo, int> =0>, pi<int> =3;, and so on. Is it possible to fix that bug as part of this patch, and/or would you be interested in patching that bug as a follow-up to this one?

Fri, Aug 16, 2:47 PM · Restricted Project

Thu, Aug 15

owenpan created D66332: [clang-format] Fix the bug that joins template closer and > or >>.
Thu, Aug 15, 10:04 PM · Restricted Project

Sun, Aug 11

owenpan committed rG10234da71d6a: [clang-format] Expand AllowShortBlocksOnASingleLine for WebKit (authored by owenpan).
[clang-format] Expand AllowShortBlocksOnASingleLine for WebKit
Sun, Aug 11, 10:49 AM
owenpan committed rL368539: [clang-format] Expand AllowShortBlocksOnASingleLine for WebKit.
[clang-format] Expand AllowShortBlocksOnASingleLine for WebKit
Sun, Aug 11, 10:48 AM
owenpan closed D66059: [clang-format] Expand AllowShortBlocksOnASingleLine for WebKit.
Sun, Aug 11, 10:48 AM · Restricted Project, Restricted Project

Sat, Aug 10

owenpan created D66059: [clang-format] Expand AllowShortBlocksOnASingleLine for WebKit.
Sat, Aug 10, 8:45 PM · Restricted Project, Restricted Project
owenpan committed rGdb4ad3603ac9: [clang-format] Add SpaceInEmptyBlock option for WebKit (authored by owenpan).
[clang-format] Add SpaceInEmptyBlock option for WebKit
Sat, Aug 10, 12:53 AM
owenpan committed rL368507: [clang-format] Add SpaceInEmptyBlock option for WebKit.
[clang-format] Add SpaceInEmptyBlock option for WebKit
Sat, Aug 10, 12:52 AM
owenpan closed D65925: [clang-format] Add SpaceInEmptyBlock option for WebKit.
Sat, Aug 10, 12:52 AM · Restricted Project, Restricted Project
owenpan added a comment to D65925: [clang-format] Add SpaceInEmptyBlock option for WebKit.

https://webkit.org/code-style-guidelines/ has one instance of { } with a space and one of {} without a space, and as far as I can tell no text that says which instance is correct. Are you sure this is the right thing for webkit style?

Sat, Aug 10, 12:48 AM · Restricted Project, Restricted Project
owenpan updated the diff for D65925: [clang-format] Add SpaceInEmptyBlock option for WebKit.

Changed "may" to "will" and updated the diff. (Should we do the same for the SpaceInEmptyParentheses option?)

Sat, Aug 10, 12:40 AM · Restricted Project, Restricted Project

Wed, Aug 7

owenpan created D65925: [clang-format] Add SpaceInEmptyBlock option for WebKit.
Wed, Aug 7, 11:46 PM · Restricted Project, Restricted Project

Thu, Aug 1

owenpan committed rG9131e925fd6b: [clang-format] Fix a bug that doesn't break braces before unions for Allman… (authored by owenpan).
[clang-format] Fix a bug that doesn't break braces before unions for Allman…
Thu, Aug 1, 9:33 PM
owenpan committed rL367648: [clang-format] Fix a bug that doesn't break braces before unions for Allman.
[clang-format] Fix a bug that doesn't break braces before unions for Allman
Thu, Aug 1, 9:32 PM
owenpan closed D65631: [clang-format] Fix a bug that doesn't break braces before unions for Allman.
Thu, Aug 1, 9:32 PM · Restricted Project, Restricted Project
owenpan created D65631: [clang-format] Fix a bug that doesn't break braces before unions for Allman.
Thu, Aug 1, 9:20 PM · Restricted Project, Restricted Project

Jun 5 2019

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

LGTM

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

Jun 1 2019

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.

Jun 1 2019, 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