[PATCH] D50699: [clang-format] fix PR38525 - Extraneous continuation indent spaces with BreakBeforeBinaryOperators set to All

2018-08-14 Thread Owen Pan via Phabricator via cfe-commits
owenpan updated this revision to Diff 160622. owenpan added a comment. Simplified the test case. Repository: rC Clang https://reviews.llvm.org/D50699 Files: lib/Format/ContinuationIndenter.cpp unittests/Format/FormatTest.cpp Index: unittests/Format/FormatTest.cpp

[PATCH] D50697: [clang-format] fix PR38557 - comments between "default" and ':' causes the case label to be treated as an identifier

2018-08-14 Thread Owen Pan via Phabricator via cfe-commits
owenpan updated this revision to Diff 160591. owenpan added a comment. Updated the test case. Repository: rC Clang https://reviews.llvm.org/D50697 Files: lib/Format/UnwrappedLineParser.cpp unittests/Format/FormatTest.cpp Index: unittests/Format/FormatTest.cpp

[PATCH] D50699: [clang-format] fix PR38525 - Extraneous continuation indent spaces with BreakBeforeBinaryOperators set to All

2018-08-14 Thread Owen Pan via Phabricator via cfe-commits
owenpan updated this revision to Diff 160564. owenpan added a comment. Updated the patch to include lib/Format path prefix. Repository: rC Clang https://reviews.llvm.org/D50699 Files: lib/Format/ContinuationIndenter.cpp Index: lib/Format/ContinuationIndenter.cpp

[PATCH] D50699: [clang-format] fix PR38525 - Extraneous continuation indent spaces with BreakBeforeBinaryOperators set to All

2018-08-14 Thread Owen Pan via Phabricator via cfe-commits
owenpan updated this revision to Diff 160577. owenpan added a comment. Added a test case. Repository: rC Clang https://reviews.llvm.org/D50699 Files: lib/Format/ContinuationIndenter.cpp unittests/Format/FormatTest.cpp Index: unittests/Format/FormatTest.cpp

[PATCH] D50699: Extraneous continuation indent spaces with BreakBeforeBinaryOperators set to All

2018-08-14 Thread Owen Pan via Phabricator via cfe-commits
owenpan created this revision. owenpan added a project: clang. See bug report https://bugs.llvm.org/show_bug.cgi?id=38525 for more details. Repository: rC Clang https://reviews.llvm.org/D50699 Files: lib/Format/ContinuationIndenter.cpp Index: lib/Format/ContinuationIndenter.cpp

[PATCH] D50699: Extraneous continuation indent spaces with BreakBeforeBinaryOperators set to All

2018-08-14 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. Test case: F6937162: BreakBeforeBinaryOperators.cpp Repository: rC Clang https://reviews.llvm.org/D50699 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D50699: [clang-format] fix PR38525 - Extraneous continuation indent spaces with BreakBeforeBinaryOperators set to All

2018-08-14 Thread Owen Pan via Phabricator via cfe-commits
owenpan updated this revision to Diff 160561. owenpan added a comment. Updated patch created by "svn diff --diff-cmd=diff -x -U99" Repository: rC Clang https://reviews.llvm.org/D50699 Files: ContinuationIndenter.cpp Index: ContinuationIndenter.cpp

[PATCH] D51036: clang-format: Fix formatting C++ namespaces with preceding 'inline' or 'export' specifier

2018-08-21 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: lib/Format/NamespaceEndCommentsFixer.cpp:128-133 + // Detect "(inline|export)? namespace" in the beginning of a line. + if (NamespaceTok->is(tok::kw_inline) || NamespaceTok->is(tok::kw_export)) NamespaceTok =

[PATCH] D51036: clang-format: Fix formatting C++ namespaces with preceding 'inline' or 'export' specifier

2018-08-24 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: lib/Format/Format.cpp:1312 auto = *AnnotatedLines[i]; if (Line.startsWith(tok::kw_namespace) || + Line.startsWith(tok::kw_inline, tok::kw_namespace) || sammccall wrote: > these 3 startswith

[PATCH] D51036: clang-format: Fix formatting C++ namespaces with preceding 'inline' or 'export' specifier

2018-08-24 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: lib/Format/UnwrappedLineFormatter.cpp:533-535 + !(Line.startsWith(tok::kw_namespace) || + Line.startsWith(tok::kw_inline, tok::kw_namespace) || + Line.startsWith(tok::kw_export,

[PATCH] D50699: [clang-format] fix PR38525 - Extraneous continuation indent spaces with BreakBeforeBinaryOperators set to All

2018-08-24 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. @JonasToth Yes, please. Also https://reviews.llvm.org/D50697 :) Thanks again for getting me started! Repository: rC Clang https://reviews.llvm.org/D50699 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D51036: clang-format: Fix formatting C++ namespaces with preceding 'inline' or 'export' specifier

2018-08-21 Thread Owen Pan via Phabricator via cfe-commits
owenpan requested changes to this revision. owenpan added a comment. This revision now requires changes to proceed. By the way, I didn't review the test cases. Comment at: lib/Format/FormatToken.h:524-525 +// Detect "(inline|export)? namespace" in the beginning of a line.

[PATCH] D51036: clang-format: Fix formatting C++ namespaces with preceding 'inline' or 'export' specifier

2018-08-21 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: lib/Format/NamespaceEndCommentsFixer.cpp:129-130 + // Detect "(inline|export)? namespace" in the beginning of a line. + if (NamespaceTok->is(tok::kw_inline) || NamespaceTok->is(tok::kw_export)) NamespaceTok =

[PATCH] D33029: [clang-format] add option for dangling parenthesis

2018-08-25 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. @stringham Here is what I did to run the unit tests: cd build make FormatTests tools/clang/unittests/Format/FormatTests https://reviews.llvm.org/D33029 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D51294: Fix Bug 38713: clang-format mishandles a short block after "default:" in a switch statement

2018-08-28 Thread Owen Pan via Phabricator via cfe-commits
owenpan updated this revision to Diff 162989. owenpan marked an inline comment as done. owenpan added a comment. Added a comment suggested by @sammccall Repository: rC Clang https://reviews.llvm.org/D51294 Files: lib/Format/UnwrappedLineFormatter.cpp unittests/Format/FormatTest.cpp

[PATCH] D51294: Fix Bug 38713: clang-format mishandles a short block after "default:" in a switch statement

2018-08-28 Thread Owen Pan via Phabricator via cfe-commits
owenpan marked an inline comment as done. owenpan added inline comments. Comment at: lib/Format/UnwrappedLineFormatter.cpp:486 return 0; +if (Line.First->is(tok::kw_default)) { + const FormatToken *Tok = Line.First->getNextNonComment(); sammccall

[PATCH] D51294: Fix Bug 38713: clang-format mishandles a short block after "default:" in a switch statement

2018-08-27 Thread Owen Pan via Phabricator via cfe-commits
owenpan created this revision. owenpan added reviewers: djasper, klimek, sammccall. Herald added a subscriber: cfe-commits. See https://bugs.llvm.org/show_bug.cgi?id=38713 Repository: rC Clang https://reviews.llvm.org/D51294 Files: lib/Format/UnwrappedLineFormatter.cpp

[PATCH] D51036: clang-format: Fix formatting C++ namespaces with preceding 'inline' or 'export' specifier

2018-08-22 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: lib/Format/UnwrappedLineParser.cpp:1066-1072 +if (Style.isCpp()) { + nextToken(); + if (FormatTok->Tok.is(tok::kw_namespace)) { +parseNamespace(); +return; + } +} owenpan wrote: >

[PATCH] D51036: clang-format: Fix formatting C++ namespaces with preceding 'inline' or 'export' specifier

2018-09-05 Thread Owen Pan via Phabricator via cfe-commits
owenpan accepted this revision. owenpan added a comment. This revision is now accepted and ready to land. In https://reviews.llvm.org/D51036#1223254, @sammccall wrote: > In https://reviews.llvm.org/D51036#1223230, @melver wrote: > > > Awaiting remaining reviewer acceptance. > > > > FYI: I do not

[PATCH] D51719: Wrapped block after case label should not be merged into a single line (Bug 38854)

2018-09-06 Thread Owen Pan via Phabricator via cfe-commits
owenpan created this revision. owenpan added a project: clang. Herald added a subscriber: cfe-commits. See https://bugs.llvm.org/show_bug.cgi?id=38854 Repository: rC Clang https://reviews.llvm.org/D51719 Files: lib/Format/UnwrappedLineFormatter.cpp unittests/Format/FormatTest.cpp

[PATCH] D51719: Wrapped block after case label should not be merged into a single line (Bug 38854)

2018-09-10 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a reviewer: krasimir. owenpan added a comment. Can one of the reviews have a quick look at this one? Thanks! Repository: rC Clang https://reviews.llvm.org/D51719 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D52527: [clang-format] fix Bug 38686: add AfterCaseLabel to BraceWrapping

2018-10-13 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. ping Repository: rC Clang https://reviews.llvm.org/D52527 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D52591: Fix Bug 39067: The keyword "try" in C++ function-try-blocks doesn't obey BraceWrapping settings

2018-09-28 Thread Owen Pan via Phabricator via cfe-commits
owenpan abandoned this revision. owenpan added a comment. Closed by r343305 Repository: rC Clang https://reviews.llvm.org/D52591 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D50403: [clang-format]AlignConsecutiveAssignments

2018-09-29 Thread Owen Pan via Phabricator via cfe-commits
owenpan requested changes to this revision. owenpan added inline comments. This revision now requires changes to proceed. Comment at: include/clang/Format/Format.h:91-93 + /// int ddd += 12; + /// int ee += 22; + /// int f += 23; These are invalid

[PATCH] D52527: [clang-format] fix Bug 38686: add AfterCaseLabel to BraceWrapping

2018-10-06 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. I'd greatly appreciate it if someone could review this before I commit it next week. Repository: rC Clang https://reviews.llvm.org/D52527 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D52021: Fix Bug 38926: don't merge short case labels if followed by a block

2018-09-20 Thread Owen Pan via Phabricator via cfe-commits
owenpan abandoned this revision. owenpan added a comment. Closed by r342708. Repository: rC Clang https://reviews.llvm.org/D52021 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D52021: Fix Bug 38926: don't merge short case labels if followed by a block

2018-09-19 Thread Owen Pan via Phabricator via cfe-commits
owenpan updated this revision to Diff 166216. owenpan added a comment. Simplified the fix and improved the test case. Repository: rC Clang https://reviews.llvm.org/D52021 Files: lib/Format/UnwrappedLineFormatter.cpp unittests/Format/FormatTest.cpp Index:

[PATCH] D52021: Fix Bug 38926: don't merge short case labels if followed by a block

2018-09-19 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. This fix has become obvious, but I still prefer that it gets reviewed before I commit it. Repository: rC Clang https://reviews.llvm.org/D52021 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D52527: [clang-format] fix Bug 38686: add AfterCaseLabel to BraceWrapping

2018-09-26 Thread Owen Pan via Phabricator via cfe-commits
owenpan updated this revision to Diff 167225. owenpan added a comment. Updated ClangFormatStyleOptions.rst. Repository: rC Clang https://reviews.llvm.org/D52527 Files: docs/ClangFormatStyleOptions.rst include/clang/Format/Format.h lib/Format/Format.cpp

[PATCH] D52527: [clang-format] fix Bug 38686: add AfterCaseLabel to BraceWrapping

2018-09-25 Thread Owen Pan via Phabricator via cfe-commits
owenpan created this revision. owenpan added reviewers: sammccall, klimek, djasper, krasimir. Herald added a subscriber: cfe-commits. https://bugs.llvm.org/show_bug.cgi?id=38686 Repository: rC Clang https://reviews.llvm.org/D52527 Files: include/clang/Format/Format.h

[PATCH] D52591: Fix Bug 39067: The keyword "try" in C++ function-try-blocks doesn't obey BraceWrapping settings

2018-09-27 Thread Owen Pan via Phabricator via cfe-commits
owenpan created this revision. owenpan added reviewers: sammccall, klimek, djasper, krasimir. Herald added a subscriber: cfe-commits. https://bugs.llvm.org/show_bug.cgi?id=39067 Repository: rC Clang https://reviews.llvm.org/D52591 Files: lib/Format/UnwrappedLineParser.cpp

[PATCH] D51719: Wrapped block after case label should not be merged into a single line (Bug 38854)

2018-09-13 Thread Owen Pan via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL342116: [clang-format] Wrapped block after case label should not be merged into one line (authored by owenpan, committed by ). Herald added a subscriber: llvm-commits. Changed prior to commit:

[PATCH] D52021: Fix Bug 38926: don't merge short case labels if followed by a block

2018-09-13 Thread Owen Pan via Phabricator via cfe-commits
owenpan created this revision. owenpan added reviewers: djasper, klimek, sammccall, krasimir. Herald added a subscriber: cfe-commits. https://bugs.llvm.org/show_bug.cgi?id=38926 Repository: rC Clang https://reviews.llvm.org/D52021 Files: lib/Format/UnwrappedLineFormatter.cpp

[PATCH] D52021: Fix Bug 38926: don't merge short case labels if followed by a block

2018-09-17 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. ping any review. Repository: rC Clang https://reviews.llvm.org/D52021 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D60308: Leave alone the semicolon after the MacroBlockBegin name

2019-04-05 Thread Owen Pan via Phabricator via cfe-commits
owenpan created this revision. owenpan added reviewers: sammccall, klimek, djasper, krasimir. owenpan added a project: clang. Herald added a subscriber: cfe-commits. This patch fixes the bug below. The code: FOO_BEGIN(); FOO_ENTRY FOO_END(); is erroneously formatted to: FOO_BEGIN()

[PATCH] D60359: [clang-format] Fix incorrect indentation of C++ constructor initializer list

2019-04-06 Thread Owen Pan via Phabricator via cfe-commits
owenpan created this revision. owenpan added reviewers: sammccall, klimek, djasper, krasimir. owenpan added a project: clang. Herald added a subscriber: cfe-commits. See https://bugs.llvm.org/show_bug.cgi?id=41407 for more info. Repository: rC Clang https://reviews.llvm.org/D60359 Files:

[PATCH] D60308: Leave alone the semicolon after the MacroBlockBegin name

2019-04-05 Thread Owen Pan via Phabricator via cfe-commits
owenpan abandoned this revision. owenpan added a comment. 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. Repository: rC Clang CHANGES SINCE LAST ACTION

[PATCH] D60374: clang-format incorrectly indents wrapped closing parenthesis

2019-04-07 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D60374#1457638 , @klimek wrote: > The previous behavior looks intentional, and much more regular. I'd be > curious why you think the proposed behavior is more readable. I see the bug in the inconsistency for the code below:

[PATCH] D60374: clang-format incorrectly indents wrapped closing parenthesis

2019-04-07 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D60374#1457693 , @MyDeveloperDay wrote: > 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 Thanks! I just got the alternative

[PATCH] D60374: clang-format incorrectly indents wrapped closing parenthesis

2019-04-07 Thread Owen Pan via Phabricator via cfe-commits
owenpan requested review of this revision. owenpan added a comment. Updated the diff. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60374/new/ https://reviews.llvm.org/D60374 ___ cfe-commits mailing list

[PATCH] D60374: clang-format incorrectly indents wrapped closing parenthesis

2019-04-07 Thread Owen Pan via Phabricator via cfe-commits
owenpan planned changes to this revision. owenpan added inline comments. Comment at: clang/lib/Format/ContinuationIndenter.cpp:968 if (Current.is(tok::r_paren) && State.Stack.size() > 1 && - (!Current.Next || Current.Next->isOneOf(tok::semi, tok::l_brace))) +

[PATCH] D60374: clang-format incorrectly indents wrapped closing parenthesis

2019-04-07 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D60374#1457639 , @MyDeveloperDay wrote: > 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 {} > I

[PATCH] D60374: clang-format incorrectly indents wrapped closing parenthesis

2019-04-07 Thread Owen Pan via Phabricator via cfe-commits
owenpan updated this revision to Diff 194072. This revision is now accepted and ready to land. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60374/new/ https://reviews.llvm.org/D60374 Files: clang/lib/Format/ContinuationIndenter.cpp

[PATCH] D60374: clang-format incorrectly indents wrapped closing parenthesis

2019-04-07 Thread Owen Pan via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL357877: [clang-format] Fix bug https://bugs.llvm.org/show_bug.cgi?id=41413 (authored by owenpan, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Changed prior to

[PATCH] D60374: clang-format incorrectly indents wrapped closing parenthesis

2019-04-07 Thread Owen Pan via Phabricator via cfe-commits
owenpan created this revision. owenpan added reviewers: MyDeveloperDay, sammccall, klimek, krasimir, djasper. owenpan added a project: clang. Herald added a subscriber: cfe-commits. See https://bugs.llvm.org/show_bug.cgi?id=41413 Repository: rC Clang https://reviews.llvm.org/D60374 Files:

[PATCH] D60359: [clang-format] Fix incorrect indentation of C++ constructor initializer list

2019-04-06 Thread Owen Pan via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL357851: [clang-format] Fix Bug 41407 (authored by owenpan, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Changed prior to commit:

[PATCH] D52527: [clang-format] fix Bug 38686: add AfterCaseLabel to BraceWrapping

2019-04-06 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. @MyDeveloperDay: Can you add a link to the bugzilla report? I stopped pushing my solution because as @krasimir said it's probably not a bug although the current documentation doesn't spell it out. Nonetheless, I'm with you and would like to see this improvement

[PATCH] D52527: [clang-format] fix Bug 38686: add AfterCaseLabel to BraceWrapping

2019-04-08 Thread Owen Pan via Phabricator via cfe-commits
owenpan updated this revision to Diff 194219. owenpan added a reviewer: reuk. owenpan added a comment. Thank you to all for reviewing this revision! Here is the update that addresses all of your comments. (Also added @reuk to the reviewer list per @MyDeveloperDay 's suggestion.) Repository:

[PATCH] D52527: [clang-format] fix Bug 38686: add AfterCaseLabel to BraceWrapping

2019-04-08 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. @MyDeveloperDay : > 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 I believe the developer must run it manually. > If the latter, then I reckon the two are out of sync, perhaps I

[PATCH] D52527: [clang-format] fix Bug 38686: add AfterCaseLabel to BraceWrapping

2019-04-09 Thread Owen Pan via Phabricator via cfe-commits
owenpan closed this revision. owenpan added a comment. llvm-svn: 357957 Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D52527/new/ https://reviews.llvm.org/D52527 ___ cfe-commits mailing list

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

2019-04-14 Thread Owen Pan via Phabricator via cfe-commits
owenpan accepted this revision. owenpan added a comment. This revision is now accepted and ready to land. Looks good! CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60363/new/ https://reviews.llvm.org/D60363 ___ cfe-commits mailing list

[PATCH] D60362: [clang-format] [PR39719] clang-format converting object-like macro to function-like macro

2019-04-17 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. 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 `(` Repository: rC Clang CHANGES SINCE LAST ACTION

[PATCH] D60362: [clang-format] [PR39719] clang-format converting object-like macro to function-like macro

2019-04-17 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. Actually, there is a neater way: https://reviews.llvm.org/D60853 Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60362/new/ https://reviews.llvm.org/D60362 ___ cfe-commits mailing list

[PATCH] D60853: clang-format incorrectly inserts a space after a macro function name that is a keyword

2019-04-17 Thread Owen Pan via Phabricator via cfe-commits
owenpan created this revision. owenpan added reviewers: klimek, djasper, reuk, russellmcc, sammccall, MyDeveloperDay. owenpan added a project: clang. Herald added a subscriber: cfe-commits. See https://bugs.llvm.org/show_bug.cgi?id=39719 and discussion: https://reviews.llvm.org/D60362

[PATCH] D61729: [docs] Fix example for Allman brace breaking style

2019-06-01 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. 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. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D61729: [docs] Fix example for Allman brace breaking style

2019-06-05 Thread Owen Pan via Phabricator via cfe-commits
owenpan accepted this revision. owenpan added a comment. This revision is now accepted and ready to land. LGTM CHANGES SINCE LAST ACTION https://reviews.llvm.org/D61729/new/ https://reviews.llvm.org/D61729 ___ cfe-commits mailing list

[PATCH] D61297: [clang-format] Fix bug that misses some function-like macro usages

2019-05-01 Thread Owen Pan via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL359687: [clang-format] Fix bug that misses some function-like macro usages (authored by owenpan, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Changed prior to

[PATCH] D61276: [clang-format] Fix bug in block comment reflow that joins * and /

2019-05-01 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. @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. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D61276/new/ https://reviews.llvm.org/D61276

[PATCH] D61222: [clang-format] Fix a bug in AlignConsecutiveDeclarations

2019-05-01 Thread Owen Pan via Phabricator via cfe-commits
owenpan updated this revision to Diff 197566. owenpan added a comment. Removed a redundant test case. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D61222/new/ https://reviews.llvm.org/D61222 Files: clang/lib/Format/WhitespaceManager.cpp

[PATCH] D61222: [clang-format] Fix a bug in AlignConsecutiveDeclarations

2019-05-01 Thread Owen Pan via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL359711: [clang-format] Fix a bug in AlignConsecutiveDeclarations. (authored by owenpan, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Changed prior to commit:

[PATCH] D61276: [clang-format] Fix bug in block comment reflow that joins * and /

2019-05-02 Thread Owen Pan via Phabricator via cfe-commits
owenpan planned changes to this revision. owenpan added a comment. There are some corner cases this patch doesn't cover. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D61276/new/ https://reviews.llvm.org/D61276 ___

[PATCH] D61222: [clang-format] Fix bug in determineTokenType() for TT_StartOfName

2019-04-27 Thread Owen Pan via Phabricator via cfe-commits
owenpan created this revision. owenpan added reviewers: klimek, MyDeveloperDay, sammccall, krasimir, djasper. owenpan added a project: clang. Herald added a subscriber: cfe-commits. This patch fixes PR37175 . Repository: rC Clang

[PATCH] D61276: [clang-format] Fix bug in block comment reflow that joins * and /

2019-04-29 Thread Owen Pan via Phabricator via cfe-commits
owenpan created this revision. owenpan added reviewers: klimek, sammccall, MyDeveloperDay, djasper, krasimir. owenpan added a project: clang. Herald added a subscriber: cfe-commits. This patch fixes PR41213 . Repository: rC Clang

[PATCH] D61297: [clang-format] Fix bug that misses some function-like macro usages

2019-04-30 Thread Owen Pan via Phabricator via cfe-commits
owenpan created this revision. owenpan added reviewers: klimek, djasper, sammccall, krasimir, MyDeveloperDay. owenpan added a project: clang. Herald added a subscriber: cfe-commits. This patch fixes PR41483 . Repository: rC Clang

[PATCH] D61628: Fix a bug that reports UTF16 (LE) files as UTF32 (LE) ones

2019-05-07 Thread Owen Pan via Phabricator via cfe-commits
owenpan created this revision. owenpan added a reviewer: sammccall. owenpan added a project: clang. Herald added a subscriber: cfe-commits. Also fix a typo for the SCSU byte order mark. Repository: rC Clang https://reviews.llvm.org/D61628 Files: clang/lib/Basic/SourceManager.cpp Index:

[PATCH] D61559: Fix the crash when formatting unsupported encodings

2019-05-07 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. I copied the code from `clang/lib/Basic/SourceManager.cpp`. See D61628 . I will update this patch to correct the typo in SCSU or remove it along with the other rare BOMs. How do you add test cases for this kind of fixes that emit error

[PATCH] D61628: Fix a bug that reports UTF16 (LE) files as UTF32 (LE) ones

2019-05-07 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. 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. Repository: rC Clang

[PATCH] D60853: clang-format converts a keyword macro definition to a macro function

2019-04-18 Thread Owen Pan via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL358710: [clang-format] Fix incorrect formatting of keyword macro definition (authored by owenpan, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Changed prior to

[PATCH] D60853: clang-format converts a keyword macro definition to a macro function

2019-04-18 Thread Owen Pan via Phabricator via cfe-commits
owenpan marked 2 inline comments as done. owenpan added inline comments. Comment at: clang/lib/Format/UnwrappedLineParser.cpp:808 - if (FormatTok->Tok.getKind() != tok::identifier) { + if (!FormatTok->Tok.getIdentifierInfo()) { IncludeGuard = IG_Rejected;

[PATCH] D61276: [clang-format] Fix bug in block comment reflow that joins * and /

2019-05-03 Thread Owen Pan via Phabricator via cfe-commits
owenpan updated this revision to Diff 198057. owenpan added a comment. Updated the test cases to make them precise and more varied. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D61276/new/ https://reviews.llvm.org/D61276 Files:

[PATCH] D61276: [clang-format] Fix bug in block comment reflow that joins * and /

2019-05-03 Thread Owen Pan via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL359943: [clang-format] Fix bug in block comment reflow that joins * and / (authored by owenpan, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Changed prior to

[PATCH] D61276: [clang-format] Fix bug in block comment reflow that joins * and /

2019-05-02 Thread Owen Pan via Phabricator via cfe-commits
owenpan updated this revision to Diff 197720. owenpan added a comment. Updated the patch to cover all scenarios in which the bug might be triggered. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D61276/new/ https://reviews.llvm.org/D61276 Files:

[PATCH] D61222: [clang-format] Fix a bug in AlignConsecutiveDeclarations

2019-04-27 Thread Owen Pan via Phabricator via cfe-commits
owenpan updated this revision to Diff 196994. owenpan retitled this revision from "[clang-format] Fix bug in determineTokenType() for TT_StartOfName" to "[clang-format] Fix a bug in AlignConsecutiveDeclarations". owenpan added a comment. This revision is now accepted and ready to land. Fix it

[PATCH] D61222: [clang-format] Fix bug in determineTokenType() for TT_StartOfName

2019-04-27 Thread Owen Pan via Phabricator via cfe-commits
owenpan planned changes to this revision. owenpan added a comment. 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

[PATCH] D61559: Fix the crash when formatting unsupported encodings

2019-05-04 Thread Owen Pan via Phabricator via cfe-commits
owenpan created this revision. owenpan added reviewers: klimek, djasper, sammccall, MyDeveloperDay, krasimir. owenpan added a project: clang. Herald added a subscriber: cfe-commits. See PR33946 . Repository: rC Clang

[PATCH] D61559: Fix the crash when formatting unsupported encodings

2019-05-05 Thread Owen Pan via Phabricator via cfe-commits
owenpan updated this revision to Diff 198205. owenpan added a comment. Moved "UTF-32 (LE)" to before "UTF-16 (LE)" in `llvm::StringSwitch` so that the former BOM wouldn't be misnamed as the latter. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D61559/new/

[PATCH] D61628: Fix a bug that reports UTF16 (LE) files as UTF32 (LE) ones

2019-05-08 Thread Owen Pan via Phabricator via cfe-commits
This revision was not accepted when it landed; it landed in state "Needs Review". This revision was automatically updated to reflect the committed changes. Closed by commit rL360256: [clang] Fix a bug that reports UTF32 (LE) files as UTF16 (LE) ones (authored by owenpan, committed by ). Herald

[PATCH] D61559: Fix the crash when formatting unsupported encodings

2019-05-08 Thread Owen Pan via Phabricator via cfe-commits
owenpan marked an inline comment as done. owenpan added inline comments. Comment at: clang/tools/clang-format/ClangFormat.cpp:273 +.StartsWith("\xFF\xFE", "UTF-16 (LE)") +.StartsWith("\x2B\x2F\x76", "UTF-7") +.StartsWith("\xF7\x64\x4C", "UTF-1")

[PATCH] D61559: Fix the crash when formatting unsupported encodings

2019-05-08 Thread Owen Pan via Phabricator via cfe-commits
owenpan updated this revision to Diff 198652. owenpan added a comment. Fixed the typo for SCSU. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D61559/new/ https://reviews.llvm.org/D61559 Files: clang/tools/clang-format/ClangFormat.cpp Index:

[PATCH] D61559: Fix the crash when formatting unsupported encodings

2019-05-08 Thread Owen Pan via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL360257: [clang-format] Fix the crash when formatting unsupported encodings (authored by owenpan, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Changed prior to

[PATCH] D60996: [clang-format] Fix bug in reflow of block comments containing CR/LF

2019-04-23 Thread Owen Pan via Phabricator via cfe-commits
owenpan created this revision. owenpan added reviewers: klimek, krasimir, sammccall, MyDeveloperDay, djasper. owenpan added a project: clang. Herald added a subscriber: cfe-commits. This patch fixes PR 36119 . Repository: rC Clang

[PATCH] D60996: [clang-format] Fix bug in reflow of block comments containing CR/LF

2019-04-23 Thread Owen Pan via Phabricator via cfe-commits
owenpan updated this revision to Diff 196197. owenpan added a comment. Removes a no longer needed hack that worked around this bug when computing `StartOfLine` in the `BreakableBlockComment::adjustWhitespace` function. Also updates the test case. Repository: rC Clang CHANGES SINCE LAST

[PATCH] D60996: [clang-format] Fix bug in reflow of block comments containing CR/LF

2019-04-23 Thread Owen Pan via Phabricator via cfe-commits
owenpan updated this revision to Diff 196261. owenpan added a comment. Removes a redundant test case. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60996/new/ https://reviews.llvm.org/D60996 Files: clang/lib/Format/BreakableToken.cpp

[PATCH] D60996: [clang-format] Fix bug in reflow of block comments containing CR/LF

2019-04-23 Thread Owen Pan via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC359029: [clang-format] Fix bug in reflow of block comments containing CR/LF (authored by owenpan, committed by ). Changed prior to commit: https://reviews.llvm.org/D60996?vs=196261=196314#toc

[PATCH] D61174: [clang-format] Fix documentation for FixNamespaceComments

2019-04-26 Thread Owen Pan via Phabricator via cfe-commits
owenpan created this revision. owenpan added a project: clang. Herald added a subscriber: cfe-commits. Fixes PR40409 . Repository: rC Clang https://reviews.llvm.org/D61174 Files: clang/docs/ClangFormatStyleOptions.rst

[PATCH] D61174: [clang-format] Fix documentation for FixNamespaceComments

2019-04-26 Thread Owen Pan via Phabricator via cfe-commits
This revision was not accepted when it landed; it landed in state "Needs Review". This revision was automatically updated to reflect the committed changes. Closed by commit rL359280: [clang-format] Fix documentation for FixNamespaceComments (authored by owenpan, committed by ). Herald added a

[PATCH] D66332: [clang-format] Fix the bug that joins template closer and > or >>

2019-08-16 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D66332#1633448 , @Quuxplusone wrote: > 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

[PATCH] D66384: [clang-format] Fix a bug that joins template closer and =

2019-08-18 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D66384#1634405 , @Quuxplusone wrote: > although I would still question whether > `Style.SpaceBeforeAssignmentOperators` is providing anyone any benefit at all. See here

[PATCH] D66384: [clang-format] Fix a bug that joins template closer and =

2019-08-18 Thread Owen Pan via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL369214: [clang-format] Fix a bug that joins template closer and = (authored by owenpan, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Changed prior to commit:

[PATCH] D66384: [clang-format] Fix a bug that joins template closer and =

2019-08-18 Thread Owen Pan via Phabricator via cfe-commits
owenpan marked an inline comment as done. owenpan added inline comments. Comment at: clang/unittests/Format/FormatTest.cpp:6631 + verifyFormat("a = 1;", Style); + verifyFormat("a >>= 1;", Style); Quuxplusone wrote: > Actually, could you add a test case

[PATCH] D66332: [clang-format] Fix the bug that joins template closer and > or >>

2019-08-15 Thread Owen Pan via Phabricator via cfe-commits
owenpan created this revision. owenpan added reviewers: sammccall, MyDeveloperDay, klimek, djasper. Herald added a project: clang. Herald added a subscriber: cfe-commits. Also fixes a buggy test case. See PR42404 Repository: rC Clang https://reviews.llvm.org/D66332 Files:

[PATCH] D65925: [clang-format] Add SpaceInEmptyBlock option for WebKit

2019-08-10 Thread Owen Pan via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL368507: [clang-format] Add SpaceInEmptyBlock option for WebKit (authored by owenpan, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Changed prior to commit:

[PATCH] D65925: [clang-format] Add SpaceInEmptyBlock option for WebKit

2019-08-10 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. In D65925#1623965 , @thakis wrote: > 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

[PATCH] D65925: [clang-format] Add SpaceInEmptyBlock option for WebKit

2019-08-10 Thread Owen Pan via Phabricator via cfe-commits
owenpan updated this revision to Diff 214509. owenpan added a comment. Changed "may" to "will" and updated the diff. (Should we do the same for the SpaceInEmptyParentheses option?) Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D65925/new/

[PATCH] D66059: [clang-format] Expand AllowShortBlocksOnASingleLine for WebKit

2019-08-10 Thread Owen Pan via Phabricator via cfe-commits
owenpan created this revision. owenpan added reviewers: sammccall, MyDeveloperDay, klimek, djasper. Herald added a project: clang. Herald added a subscriber: cfe-commits. See PR40840 Repository: rC Clang https://reviews.llvm.org/D66059 Files: clang/docs/ClangFormatStyleOptions.rst

[PATCH] D66059: [clang-format] Expand AllowShortBlocksOnASingleLine for WebKit

2019-08-11 Thread Owen Pan via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL368539: [clang-format] Expand AllowShortBlocksOnASingleLine for WebKit (authored by owenpan, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Changed prior to

[PATCH] D66332: [clang-format] Fix the bug that joins template closer and > or >>

2019-08-16 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. > Are there any other clang-format options that might lead to a lack-of-space > before `>`, `>=`, `==`, or `=`? I brought up `enable_if_t=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,

[PATCH] D66332: [clang-format] Fix the bug that joins template closer and > or >>

2019-08-16 Thread Owen Pan via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGac67414618df: [clang-format] Fix the bug that joins template closer and or (authored by owenpan). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D66332/new/

[PATCH] D66384: [clang-format] Fix a bug that joins template closer and =

2019-08-17 Thread Owen Pan via Phabricator via cfe-commits
owenpan created this revision. owenpan added reviewers: Quuxplusone, MyDeveloperDay, sammccall, klimek, djasper. Herald added a project: clang. Herald added a subscriber: cfe-commits. Also fixes the documentation for `SpaceBeforeAssignmentOperators`. See the discussion here

[PATCH] D66662: [clang-format] [PR43100] clang-format C# support does not add a space between "using" and paren

2019-08-24 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. The test case fails after the missing `)` is added, so it seems that the patch has no effect. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D2/new/ https://reviews.llvm.org/D2 ___

  1   2   3   4   5   6   7   8   9   10   >