Page MenuHomePhabricator

owenpan (Owen Pan)
User

Projects

User does not belong to any projects.

User Details

User Since
Aug 14 2018, 4:06 AM (61 w, 2 d)

Recent Activity

Today

owenpan added a comment to D68914: [clang-format] Remove duplciate code from Invalid BOM detection.

Thanks for clearing it up!

Thu, Oct 17, 12:02 AM · Restricted Project, Restricted Project, Restricted Project

Tue, Oct 15

owenpan added a comment to D68914: [clang-format] Remove duplciate code from Invalid BOM detection.

I did a quick search of the LLVM code base and found dozens of const StringRef &, including the Twine API.

Tue, Oct 15, 9:39 PM · Restricted Project, Restricted Project, Restricted Project
owenpan added a comment to D68914: [clang-format] Remove duplciate code from Invalid BOM detection.

Here are some const StringRef & examples.

Tue, Oct 15, 12:48 AM · Restricted Project, Restricted Project, Restricted Project
owenpan added inline comments to D68914: [clang-format] Remove duplciate code from Invalid BOM detection.
Tue, Oct 15, 12:36 AM · Restricted Project, Restricted Project, Restricted Project

Sat, Oct 12

owenpan added inline comments to D68914: [clang-format] Remove duplciate code from Invalid BOM detection.
Sat, Oct 12, 5:35 PM · Restricted Project, Restricted Project, Restricted Project
owenpan added a comment to D68914: [clang-format] Remove duplciate code from Invalid BOM detection.

Thank you for taking care of this! When I fixed a bug in this part of the code last time, I had to do it in both files.

Sat, Oct 12, 5:26 PM · Restricted Project, Restricted Project, Restricted Project

Fri, Oct 11

owenpan added inline comments to D68767: [clang-format] NFC - Move functionality into functions to help code structure.
Fri, Oct 11, 1:18 AM · Restricted Project, Restricted Project

Mon, Sep 23

owenpan accepted D67888: [clang-format] NFC clang-format the clang-format unit tests.

Thanks!

Mon, Sep 23, 7:19 AM · Restricted Project, Restricted Project, Restricted Project

Sun, Sep 22

owenpan added a comment to D67888: [clang-format] NFC clang-format the clang-format unit tests.

I suppose the .clang-format file you used only had BasedOnStyle: LLVM in it. Did you run clang-format the second time to ensure that the formatted file was stable?

Sun, Sep 22, 10:33 PM · Restricted Project, Restricted Project, Restricted Project

Sep 10 2019

owenpan committed rGd40ddb9df26b: [clang-format] Apply BAS_AlwaysBreak to C++11 braced lists (authored by owenpan).
[clang-format] Apply BAS_AlwaysBreak to C++11 braced lists
Sep 10 2019, 4:26 PM
owenpan committed rL371571: [clang-format] Apply BAS_AlwaysBreak to C++11 braced lists.
[clang-format] Apply BAS_AlwaysBreak to C++11 braced lists
Sep 10 2019, 4:25 PM
owenpan closed D67395: [clang-format] Apply BAS_AlwaysBreak to C++11 braced lists.
Sep 10 2019, 4:25 PM · Restricted Project, Restricted Project
owenpan added a reviewer for D67395: [clang-format] Apply BAS_AlwaysBreak to C++11 braced lists: djasper.
Sep 10 2019, 6:00 AM · Restricted Project, Restricted Project
owenpan created D67395: [clang-format] Apply BAS_AlwaysBreak to C++11 braced lists.
Sep 10 2019, 6:00 AM · Restricted Project, Restricted Project

Aug 26 2019

owenpan accepted D66662: [clang-format] [PR43100] clang-format C# support does not add a space between "using" and paren.
Aug 26 2019, 11:56 PM · Restricted Project, Restricted Project
owenpan added a comment to D66662: [clang-format] [PR43100] clang-format C# support does not add a space between "using" and paren.

The patch would have no effect if the using statement is not in a block, but that would probably be against C# syntax.

Aug 26 2019, 11:56 PM · Restricted Project, Restricted Project

Aug 24 2019

owenpan added a comment to D66662: [clang-format] [PR43100] clang-format C# support does not add a space between "using" and paren.

The test case fails after the missing ) is added, so it seems that the patch has no effect.

Aug 24 2019, 10:35 PM · Restricted Project, Restricted Project
owenpan added inline comments to D66662: [clang-format] [PR43100] clang-format C# support does not add a space between "using" and paren.
Aug 24 2019, 12:32 AM · Restricted Project, Restricted Project

Aug 23 2019

owenpan added inline comments to D66662: [clang-format] [PR43100] clang-format C# support does not add a space between "using" and paren.
Aug 23 2019, 8:28 PM · Restricted Project, Restricted Project
owenpan added inline comments to D66662: [clang-format] [PR43100] clang-format C# support does not add a space between "using" and paren.
Aug 23 2019, 3:46 PM · Restricted Project, Restricted Project

Aug 18 2019

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 =
Aug 18 2019, 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 =
Aug 18 2019, 11:51 AM
owenpan closed D66384: [clang-format] Fix a bug that joins template closer and =.
Aug 18 2019, 11:50 AM · Restricted Project, Restricted Project
owenpan added inline comments to D66384: [clang-format] Fix a bug that joins template closer and =.
Aug 18 2019, 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.

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

Aug 17 2019

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

Aug 16 2019

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.

Aug 16 2019, 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 >>
Aug 16 2019, 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 >>
Aug 16 2019, 2:49 PM
owenpan closed D66332: [clang-format] Fix the bug that joins template closer and > or >>.
Aug 16 2019, 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?

Aug 16 2019, 2:47 PM · Restricted Project

Aug 15 2019

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

Aug 11 2019

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

Aug 10 2019

owenpan created D66059: [clang-format] Expand AllowShortBlocksOnASingleLine for WebKit.
Aug 10 2019, 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
Aug 10 2019, 12:53 AM
owenpan committed rL368507: [clang-format] Add SpaceInEmptyBlock option for WebKit.
[clang-format] Add SpaceInEmptyBlock option for WebKit
Aug 10 2019, 12:52 AM
owenpan closed D65925: [clang-format] Add SpaceInEmptyBlock option for WebKit.
Aug 10 2019, 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?

Aug 10 2019, 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?)

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

Aug 7 2019

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

Aug 1 2019

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…
Aug 1 2019, 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
Aug 1 2019, 9:32 PM
owenpan closed D65631: [clang-format] Fix a bug that doesn't break braces before unions for Allman.
Aug 1 2019, 9:32 PM · Restricted Project, Restricted Project
owenpan created D65631: [clang-format] Fix a bug that doesn't break braces before unions for Allman.
Aug 1 2019, 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