[clang] [clang-format] Fix crashes in AlignArrayOfStructures (PR #72520)

2023-11-16 Thread Owen Pan via cfe-commits
https://github.com/owenca edited https://github.com/llvm/llvm-project/pull/72520 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Fix crashes in AlignArrayOfStructures (PR #72520)

2023-11-16 Thread Owen Pan via cfe-commits
@@ -1316,6 +1316,8 @@ void WhitespaceManager::alignArrayInitializersRightJustified( auto Offset = std::distance(Cells.begin(), CellIter); for (const auto *Next = CellIter->NextColumnElement; Next; Next = Next->NextColumnElement) { + if

[clang] [clang-format] Handle lambdas in QualifierAlignment (PR #72456)

2023-11-16 Thread Owen Pan via cfe-commits
https://github.com/owenca closed https://github.com/llvm/llvm-project/pull/72456 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Skip alignArrayInitializers() for 1-row matrices (PR #72166)

2023-11-16 Thread Owen Pan via cfe-commits
https://github.com/owenca edited https://github.com/llvm/llvm-project/pull/72166 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Fix crashes in AlignArrayOfStructures (PR #72520)

2023-11-16 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/72520 Fixed #55493. Fixed #68431. >From efdf321e9447e8b3f1c27ccdf6da842107deb6dd Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Thu, 16 Nov 2023 06:36:41 -0800 Subject: [PATCH] [clang-format] Fix crashes in

[clang] [clang-format] Handle lambdas in QualifierAlignment (PR #72456)

2023-11-15 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/72456 Fixed #62780. >From 5aae5d3c5b976d91548219aba4fb9c937d0fbbcc Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Wed, 15 Nov 2023 16:13:46 -0800 Subject: [PATCH] [clang-format] Handle lambdas in QualifierAlignment

[clang] [clang-format] Fix more bugs in isStartOfName() (PR #72336)

2023-11-15 Thread Owen Pan via cfe-commits
https://github.com/owenca closed https://github.com/llvm/llvm-project/pull/72336 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Handle constrained auto in QualifierAlignment (PR #72251)

2023-11-15 Thread Owen Pan via cfe-commits
https://github.com/owenca closed https://github.com/llvm/llvm-project/pull/72251 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Fix more bugs in isStartOfName() (PR #72336)

2023-11-14 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/72336 Fixed #72264. >From 832b6dccb1a8b0d3af4c3970c6c85f97e9cf3283 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Tue, 14 Nov 2023 19:21:11 -0800 Subject: [PATCH] [clang-format] Fix more bugs in isStartOfName() Fixed

[clang] [clang-format] Handle constrained auto in QualifierAlignment (PR #72251)

2023-11-14 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/72251 >From 8e61a470fc7e4cf11a6cf285668a7f9eca72702c Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Tue, 14 Nov 2023 05:05:14 -0800 Subject: [PATCH 1/2] [clang-format] Handle constrained auto in QualifierAlignment

[clang] [clang-format] Handle constrained auto in QualifierAlignment (PR #72251)

2023-11-14 Thread Owen Pan via cfe-commits
https://github.com/owenca edited https://github.com/llvm/llvm-project/pull/72251 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Handle constrained auto in QualifierAlignment (PR #72251)

2023-11-14 Thread Owen Pan via cfe-commits
@@ -345,6 +345,8 @@ const FormatToken *LeftRightQualifierAlignmentFixer::analyzeRight( TypeToken = Next->getNextNonComment()->getNextNonComment(); } } +if (Next->is(tok::kw_auto)) owenca wrote: ```suggestion if

[clang] [clang-format] Skip alignArrayInitializers() for 1-row matrices (PR #72166)

2023-11-14 Thread Owen Pan via cfe-commits
@@ -20875,13 +20875,15 @@ TEST_F(FormatTest, CatchAlignArrayOfStructuresRightAlignment) { "};", Style); // TODO: Fix the indentations below when this option is fully functional. +#if 0 owenca wrote: Because it's wrong as the

[clang] [clang-format] Skip alignArrayInitializers() for 1-row matrices (PR #72166)

2023-11-14 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/72166 >From 7442d202cdd0e22dba178731be01517aa8257d40 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Mon, 13 Nov 2023 14:04:32 -0800 Subject: [PATCH 1/2] [clang-format] Skip alignArrayInitializers() for 1-row matrices

[clang] [clang-format] Handle constrained auto in QualifierAlignment (PR #72251)

2023-11-14 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/72251 Fixed #69610. >From 8e61a470fc7e4cf11a6cf285668a7f9eca72702c Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Tue, 14 Nov 2023 05:05:14 -0800 Subject: [PATCH] [clang-format] Handle constrained auto in

[clang] a852869 - [clang-format] Fix a bug in parsing function/variable names

2023-11-13 Thread Owen Pan via cfe-commits
Author: Gedare Bloom Date: 2023-11-13T19:35:28-08:00 New Revision: a852869398af71141d9422ab3e53a11433a3791f URL: https://github.com/llvm/llvm-project/commit/a852869398af71141d9422ab3e53a11433a3791f DIFF: https://github.com/llvm/llvm-project/commit/a852869398af71141d9422ab3e53a11433a3791f.diff

[clang] [clang-format] Skip alignArrayInitializers() for 1-row matrices (PR #72166)

2023-11-13 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/72166 Fixed #68431. >From 7442d202cdd0e22dba178731be01517aa8257d40 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Mon, 13 Nov 2023 14:04:32 -0800 Subject: [PATCH] [clang-format] Skip alignArrayInitializers() for 1-row

[clang] [clang-format] Fix a bug in aligning comments in vector of structs (PR #72099)

2023-11-13 Thread Owen Pan via cfe-commits
https://github.com/owenca closed https://github.com/llvm/llvm-project/pull/72099 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Fix a bug in aligning comments in vector of structs (PR #72099)

2023-11-13 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/72099 Fixed #71825. >From eab0253833b7a5910cec573cabf86bb6a1abf6ef Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Mon, 13 Nov 2023 02:37:30 -0800 Subject: [PATCH] [clang-format] Fix a bug in aligning comments in vector

[clang] a699ab5 - [clang-format][NFC] Remove redundant Block/Line Comment in is()

2023-11-13 Thread Owen Pan via cfe-commits
Author: Owen Pan Date: 2023-11-13T02:14:37-08:00 New Revision: a699ab5adbefc4fa0d63edac8a137b0073576018 URL: https://github.com/llvm/llvm-project/commit/a699ab5adbefc4fa0d63edac8a137b0073576018 DIFF: https://github.com/llvm/llvm-project/commit/a699ab5adbefc4fa0d63edac8a137b0073576018.diff

[clang] [clang-format][NFC] Simplify parseBracedList() (PR #72010)

2023-11-12 Thread Owen Pan via cfe-commits
https://github.com/owenca closed https://github.com/llvm/llvm-project/pull/72010 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Handle control statements in BreakAfterAttributes (PR #71995)

2023-11-12 Thread Owen Pan via cfe-commits
https://github.com/owenca closed https://github.com/llvm/llvm-project/pull/71995 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format][NFC] Simplify parseBracedList() (PR #72010)

2023-11-11 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/72010 >From f3f303d80a40b9ce8a13721cfa108b4094b8b2c3 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Fri, 10 Nov 2023 17:34:06 -0800 Subject: [PATCH 1/2] [clang-format][NFC] Simplify parseBracedList() ---

[clang] [clang-format] Remove special handling of comments after brace/paren (PR #71672)

2023-11-11 Thread Owen Pan via cfe-commits
@@ -802,7 +802,10 @@ void ContinuationIndenter::addTokenOnCurrentLine(LineState , bool DryRun, Previous.isNot(TT_ObjCMethodExpr) && Previous.isNot(TT_RequiresClause) && !(Current.MacroParent && Previous.MacroParent) && (Current.isNot(TT_LineComment) || -

[clang] [clang-format] Handle control statements in BreakAfterAttributes (PR #71995)

2023-11-11 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/71995 >From b67ea36d180e700cc6b0661e8f2390eda515c566 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Fri, 10 Nov 2023 00:21:58 -0800 Subject: [PATCH 1/2] [clang-format] Handle control statements in BreakAfterAttributes

[clang] [clang-format] Handle control statements in BreakAfterAttributes (PR #71995)

2023-11-11 Thread Owen Pan via cfe-commits
@@ -2049,8 +2049,10 @@ the configuration (without a prefix: ``Auto``). .. _BreakAfterAttributes: **BreakAfterAttributes** (``AttributeBreakingStyle``) :versionbadge:`clang-format 16` :ref:`¶ ` - Break after a group of C++11 attributes before a variable/function -

[clang] [clang-format] Handle control statements in BreakAfterAttributes (PR #71995)

2023-11-11 Thread Owen Pan via cfe-commits
@@ -1432,34 +1432,82 @@ struct FormatStyle { /// const int i; /// [[gnu::const]] [[maybe_unused]] /// int j; +/// /// [[nodiscard]] /// inline int f(); /// [[gnu::const]] [[nodiscard]] /// int g(); +/// +///

[clang] [clang-format][NFC] Simplify parseBracedList() (PR #72010)

2023-11-10 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/72010 None >From f3f303d80a40b9ce8a13721cfa108b4094b8b2c3 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Fri, 10 Nov 2023 17:34:06 -0800 Subject: [PATCH] [clang-format][NFC] Simplify parseBracedList() ---

[clang] [clang-format] Handle control statements in BreakAfterAttributes (PR #71995)

2023-11-10 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/71995 This patch doesn't work for do-while loops. Fixed #64474. >From b67ea36d180e700cc6b0661e8f2390eda515c566 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Fri, 10 Nov 2023 00:21:58 -0800 Subject: [PATCH]

[llvm] [clang-tools-extra] [clang] [clang-format] Handle variable declarations in BreakAfterAttributes (PR #71935)

2023-11-10 Thread Owen Pan via cfe-commits
https://github.com/owenca closed https://github.com/llvm/llvm-project/pull/71935 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [llvm] [clang-format] Handle variable declarations in BreakAfterAttributes (PR #71935)

2023-11-10 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/71935 Also fixed a bug in `isStartOfName()` and cleaned up some old test cases. Fixed #71563. This is a rework of #71755. >From 17921d5a1d74017128691428815ede53ac1a4d67 Mon Sep 17 00:00:00 2001 From: Owen Pan Date:

[clang] [clang-format] Handle variable declarations in BreakAfterAttributes (PR #71755)

2023-11-10 Thread Owen Pan via cfe-commits
owenca wrote: @Meinersbur thanks for the info! https://github.com/llvm/llvm-project/pull/71755 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 86ef9d3 - Revert "[clang-format] Handle variable declarations in BreakAfterAttributes (#71755)"

2023-11-10 Thread Owen Pan via cfe-commits
Author: Owen Pan Date: 2023-11-10T02:03:35-08:00 New Revision: 86ef9d36519f72c06741335ce0a445ab73eb4cfb URL: https://github.com/llvm/llvm-project/commit/86ef9d36519f72c06741335ce0a445ab73eb4cfb DIFF: https://github.com/llvm/llvm-project/commit/86ef9d36519f72c06741335ce0a445ab73eb4cfb.diff

[clang] f7bbb58 - Reland "[clang-format] Handle variable declarations in BreakAfterAttributes (#71755)"

2023-11-10 Thread Owen Pan via cfe-commits
Author: Owen Pan Date: 2023-11-10T01:53:43-08:00 New Revision: f7bbb58690910a8320b0927525dfba19df69a910 URL: https://github.com/llvm/llvm-project/commit/f7bbb58690910a8320b0927525dfba19df69a910 DIFF: https://github.com/llvm/llvm-project/commit/f7bbb58690910a8320b0927525dfba19df69a910.diff

[clang] cc75e52 - [clang-format][NFC] Refactor isPointerOrReference

2023-11-10 Thread Owen Pan via cfe-commits
Author: Owen Pan Date: 2023-11-10T01:23:05-08:00 New Revision: cc75e520162ef651977d3f6d11b0d0b92dd2be07 URL: https://github.com/llvm/llvm-project/commit/cc75e520162ef651977d3f6d11b0d0b92dd2be07 DIFF: https://github.com/llvm/llvm-project/commit/cc75e520162ef651977d3f6d11b0d0b92dd2be07.diff

[clang] a0710e1 - Revert "[clang-format] Handle variable declarations in BreakAfterAttributes (#71755)"

2023-11-09 Thread Owen Pan via cfe-commits
Author: Owen Pan Date: 2023-11-09T23:34:06-08:00 New Revision: a0710e162dac8eb845588779deb39f2b35e5cb88 URL: https://github.com/llvm/llvm-project/commit/a0710e162dac8eb845588779deb39f2b35e5cb88 DIFF: https://github.com/llvm/llvm-project/commit/a0710e162dac8eb845588779deb39f2b35e5cb88.diff

[clang] [clang-format] Handle variable declarations in BreakAfterAttributes (PR #71755)

2023-11-09 Thread Owen Pan via cfe-commits
https://github.com/owenca closed https://github.com/llvm/llvm-project/pull/71755 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Handle variable declarations in BreakAfterAttributes (PR #71755)

2023-11-09 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/71755 >From 17921d5a1d74017128691428815ede53ac1a4d67 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Wed, 8 Nov 2023 17:55:56 -0800 Subject: [PATCH 1/2] [clang-format] Handle variable declarations in

[clang] [clang-format]: Split alignment of declarations around assignment (PR #69340)

2023-11-09 Thread Owen Pan via cfe-commits
https://github.com/owenca commented: See https://github.com/llvm/llvm-project/issues/66857#issuecomment-1793022188. Can you make this a suboption, e.g. `AlignFunctionPointers`? We can add another (e.g. `AlignConstructorsDestructors`) for ctors and dtors in the future.

[clang] [clang-format] Handle variable declarations in BreakAfterAttributes (PR #71755)

2023-11-08 Thread Owen Pan via cfe-commits
owenca wrote: > However this doesn't address the second part of the linked issue (with the > `if`) does it? Nope! That part is a duplicate of #64474. I was going to add a note in #71563 before merging this PR but now just saw that @FalcoGer closed the old issue and opened the new one, which

[clang] [clang-format] Handle variable declarations in BreakAfterAttributes (PR #71755)

2023-11-08 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/71755 >From 17921d5a1d74017128691428815ede53ac1a4d67 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Wed, 8 Nov 2023 17:55:56 -0800 Subject: [PATCH] [clang-format] Handle variable declarations in BreakAfterAttributes

[clang] [clang-format] Handle variable declarations in BreakAfterAttributes (PR #71755)

2023-11-08 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/71755 >From c85d3c4879a5ff9d6f3ab318ebd7b63410249062 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Wed, 8 Nov 2023 17:55:56 -0800 Subject: [PATCH] [clang-format] Handle variable declarations in BreakAfterAttributes

[clang] [clang-format] Add ability for clang-format-diff to exit with non-0 status (PR #70883)

2023-11-08 Thread Owen Pan via cfe-commits
https://github.com/owenca closed https://github.com/llvm/llvm-project/pull/70883 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Add ability for clang-format-diff to exit with non-0 status (PR #70883)

2023-11-08 Thread Owen Pan via cfe-commits
https://github.com/owenca approved this pull request. https://github.com/llvm/llvm-project/pull/70883 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Handle variable declarations in BreakAfterAttributes (PR #71755)

2023-11-08 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/71755 Also cleaned up some old test cases. Fixes #71563. >From 40769fdc8163e61c8a89bc983a7fa50b08ba5e04 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Wed, 8 Nov 2023 17:55:56 -0800 Subject: [PATCH] [clang-format]

[clang] [clang-format] Add ability for clang-format-diff to exit with non-0 status (PR #70883)

2023-11-08 Thread Owen Pan via cfe-commits
https://github.com/owenca edited https://github.com/llvm/llvm-project/pull/70883 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Add ability for clang-format-diff to exit with non-0 status (PR #70883)

2023-11-08 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/70883 >From 646cabcf167facb63c78277b50ea62afbc61b3c0 Mon Sep 17 00:00:00 2001 From: Conrad Donahue Date: Tue, 31 Oct 2023 21:55:27 -0400 Subject: [PATCH 1/5] Add ability for clang-format-diff to exit with non-0 status

[clang] Add ability for clang-format-diff to exit with non-0 status (PR #70883)

2023-11-08 Thread Owen Pan via cfe-commits
@@ -95,6 +95,12 @@ def main(): default="clang-format", help="location of binary to use for clang-format", ) +parser.add_argument( +"-non-zero-exit-code", +action="store_true", +default=False, +help="exit with a non-zero

[clang] Add ability for clang-format-diff to exit with non-0 status (PR #70883)

2023-11-08 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/70883 >From 646cabcf167facb63c78277b50ea62afbc61b3c0 Mon Sep 17 00:00:00 2001 From: Conrad Donahue Date: Tue, 31 Oct 2023 21:55:27 -0400 Subject: [PATCH 1/4] Add ability for clang-format-diff to exit with non-0 status

[clang] Add ability for clang-format-diff to exit with non-0 status (PR #70883)

2023-11-08 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/70883 >From 646cabcf167facb63c78277b50ea62afbc61b3c0 Mon Sep 17 00:00:00 2001 From: Conrad Donahue Date: Tue, 31 Oct 2023 21:55:27 -0400 Subject: [PATCH 1/3] Add ability for clang-format-diff to exit with non-0 status

[clang] Add ability for clang-format-diff to exit with non-0 status (PR #70883)

2023-11-08 Thread Owen Pan via cfe-commits
@@ -325,6 +325,7 @@ output of a unified diff and reformats all contained lines with The name of the predefined style used as a fallback in case clang-format is invoked with-style=file, but can not find the .clang-formatfile

[clang] [clang-format] Add spaces around the Verilog implication operator (PR #71352)

2023-11-06 Thread Owen Pan via cfe-commits
https://github.com/owenca approved this pull request. https://github.com/llvm/llvm-project/pull/71352 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Skip PP directives when determining brace kind (PR #69473)

2023-11-02 Thread Owen Pan via cfe-commits
owenca wrote: @rymiel can we merge this? https://github.com/llvm/llvm-project/pull/69473 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Treat empty for/while loops as short loops (PR #70768)

2023-11-02 Thread Owen Pan via cfe-commits
https://github.com/owenca closed https://github.com/llvm/llvm-project/pull/70768 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Treat empty for/while loops as short loops (PR #70768)

2023-11-01 Thread Owen Pan via cfe-commits
@@ -3117,9 +3117,16 @@ void UnwrappedLineParser::parseForOrWhileLoop(bool HasParens) { FormatTok->setFinalizedType(TT_ConditionLParen); parseParens(); } - // Event control. - if (Style.isVerilog()) + + if (Style.isVerilog()) { +// Event control.

[clang] [clang-format] Treat empty for/while loops as short loops (PR #70768)

2023-11-01 Thread Owen Pan via cfe-commits
https://github.com/owenca edited https://github.com/llvm/llvm-project/pull/70768 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Treat empty for/while loops as short loops (PR #70768)

2023-11-01 Thread Owen Pan via cfe-commits
@@ -3117,9 +3117,16 @@ void UnwrappedLineParser::parseForOrWhileLoop(bool HasParens) { FormatTok->setFinalizedType(TT_ConditionLParen); parseParens(); } - // Event control. - if (Style.isVerilog()) + + if (Style.isVerilog()) { +// Event control.

[clang] [clang-format] Treat empty for/while loops as short loops (PR #70768)

2023-11-01 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/70768 >From 7e6030532f99b4128807631e993609ce40171043 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Mon, 30 Oct 2023 22:50:27 -0700 Subject: [PATCH 1/2] [clang-format] Treat empty for/while loops as short loops A

[clang] Add ability for clang-format-diff to exit with non-0 status (PR #70883)

2023-11-01 Thread Owen Pan via cfe-commits
@@ -185,6 +191,8 @@ def main(): diff_string = "".join(diff) if len(diff_string) > 0: sys.stdout.write(diff_string) +if args.non_zero_exit_code: +sys.exit(1) owenca wrote: I was aware

[clang] [clang-format] Treat empty for/while loops as short loops (PR #70768)

2023-11-01 Thread Owen Pan via cfe-commits
@@ -3117,9 +3117,16 @@ void UnwrappedLineParser::parseForOrWhileLoop(bool HasParens) { FormatTok->setFinalizedType(TT_ConditionLParen); parseParens(); } - // Event control. - if (Style.isVerilog()) + + if (Style.isVerilog()) { +// Event control.

[clang] Add ability for clang-format-diff to exit with non-0 status (PR #70883)

2023-10-31 Thread Owen Pan via cfe-commits
@@ -185,6 +191,8 @@ def main(): diff_string = "".join(diff) if len(diff_string) > 0: sys.stdout.write(diff_string) +if args.non_zero_exit_code: +sys.exit(1) owenca wrote:

[clang] [clang-format] Treat empty for/while loops as short loops (PR #70768)

2023-10-31 Thread Owen Pan via cfe-commits
https://github.com/owenca edited https://github.com/llvm/llvm-project/pull/70768 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Treat empty for/while loops as short loops (PR #70768)

2023-10-31 Thread Owen Pan via cfe-commits
@@ -3117,9 +3117,16 @@ void UnwrappedLineParser::parseForOrWhileLoop(bool HasParens) { FormatTok->setFinalizedType(TT_ConditionLParen); parseParens(); } - // Event control. - if (Style.isVerilog()) + + if (Style.isVerilog()) { +// Event control.

[clang] [clang-format] Treat empty for/while loops as short loops (PR #70768)

2023-10-30 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/70768 A for/while loop with only a semicolon as its body should be treated as an empty loop. Fixes #61708. >From 7e6030532f99b4128807631e993609ce40171043 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Mon, 30 Oct

[clang] [clang-format] Fix annotating annotations after requires clause (PR #70602)

2023-10-29 Thread Owen Pan via cfe-commits
https://github.com/owenca approved this pull request. https://github.com/llvm/llvm-project/pull/70602 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format][NFC] Reduce indent (PR #70583)

2023-10-29 Thread Owen Pan via cfe-commits
https://github.com/owenca approved this pull request. https://github.com/llvm/llvm-project/pull/70583 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format][NFC] Delete TT_LambdaArrow (PR #70519)

2023-10-28 Thread Owen Pan via cfe-commits
https://github.com/owenca closed https://github.com/llvm/llvm-project/pull/70519 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Option to ignore PP directives (PR #70338)

2023-10-27 Thread Owen Pan via cfe-commits
owenca wrote: > #67911 is a pull request, not an issue, i'm not sure what you're referring to I think it was a typo. It should be #67991. https://github.com/llvm/llvm-project/pull/70338 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang-format] Option to ignore PP directives (PR #70338)

2023-10-27 Thread Owen Pan via cfe-commits
https://github.com/owenca edited https://github.com/llvm/llvm-project/pull/70338 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Option to ignore PP directives (PR #70338)

2023-10-27 Thread Owen Pan via cfe-commits
https://github.com/owenca requested changes to this pull request. Please refer to the [policy](https://clang.llvm.org/docs/ClangFormatStyleOptions.html#adding-additional-style-options) for adding new options. https://github.com/llvm/llvm-project/pull/70338

[clang] [clang-format][NFC] Delete TT_LambdaArrow (PR #70519)

2023-10-27 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/70519 It's one type of TT_TrailingReturnArrow. >From 64d622264f2e3cd3345f741965f450daa00bac5e Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Fri, 27 Oct 2023 15:33:40 -0700 Subject: [PATCH] [clang-format][NFC] Delete

[clang] [clang-format]: Split alignment of declarations around assignment (PR #69340)

2023-10-27 Thread Owen Pan via cfe-commits
https://github.com/owenca requested changes to this pull request. Please see [here](https://github.com/llvm/llvm-project/issues/68079#issuecomment-1776826021). https://github.com/llvm/llvm-project/pull/69340 ___ cfe-commits mailing list

[clang] [clang-format]: Split alignment of declarations around assignment (PR #69340)

2023-10-27 Thread Owen Pan via cfe-commits
owenca wrote: > @gedare can you fix the merge conflict on this one? We don't want to merge this yet. See [here](https://github.com/llvm/llvm-project/issues/68079#issuecomment-1776826021). https://github.com/llvm/llvm-project/pull/69340 ___

[clang] [clang-format] Change LLVM style to BreakAfterAttributes == ABS_Leave (PR #70360)

2023-10-27 Thread Owen Pan via cfe-commits
https://github.com/owenca approved this pull request. https://github.com/llvm/llvm-project/pull/70360 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 9299ace - [clang-format][NFC] Remove extraneous newlines in remaining unit tests

2023-10-27 Thread Owen Pan via cfe-commits
Author: Owen Pan Date: 2023-10-27T03:42:16-07:00 New Revision: 9299ace0a20d3ea4d921c033a49364ea6f24263e URL: https://github.com/llvm/llvm-project/commit/9299ace0a20d3ea4d921c033a49364ea6f24263e DIFF: https://github.com/llvm/llvm-project/commit/9299ace0a20d3ea4d921c033a49364ea6f24263e.diff

[clang] [clang-format] Change LLVM style to BreakAfterAttributes == ABS_Leave (PR #70360)

2023-10-27 Thread Owen Pan via cfe-commits
@@ -26179,7 +26179,7 @@ TEST_F(FormatTest, RemoveSemicolon) { TEST_F(FormatTest, BreakAfterAttributes) { FormatStyle Style = getLLVMStyle(); - EXPECT_EQ(Style.BreakAfterAttributes, FormatStyle::ABS_Never); + EXPECT_EQ(Style.BreakAfterAttributes, FormatStyle::ABS_Leave);

[clang] [clang-format] Change LLVM style to BreakAfterAttributes == ABS_Leave (PR #70360)

2023-10-27 Thread Owen Pan via cfe-commits
@@ -794,6 +794,7 @@ clang-format - Add ``AllowBreakBeforeNoexceptSpecifier`` option. - Add ``AllowShortCompoundRequirementOnASingleLine`` option. +- Change ``BreakAfterAttributes`` from ``Never`` to ``Leave`` in LLVM style owenca wrote: Full stop

[clang] [clang-format] Change LLVM style to BreakAfterAttributes == ABS_Leave (PR #70360)

2023-10-27 Thread Owen Pan via cfe-commits
https://github.com/owenca approved this pull request. https://github.com/llvm/llvm-project/pull/70360 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Change LLVM style to BreakAfterAttributes == ABS_Leave (PR #70360)

2023-10-27 Thread Owen Pan via cfe-commits
https://github.com/owenca edited https://github.com/llvm/llvm-project/pull/70360 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Change LLVM style to BreakAfterAttributes == ABS_Leave (PR #70360)

2023-10-27 Thread Owen Pan via cfe-commits
owenca wrote: > [Google](https://google.github.io/styleguide/cppguide.html) is the only one > mentioning attributes: > > > Attributes, and macros that expand to attributes, appear at the very > > beginning of the function declaration or definition, before the return type: > > ```c++ > >

[clang] 6c3bc91 - [clang-format][NFC] Remove more extraneous newlines in unit tests

2023-10-27 Thread Owen Pan via cfe-commits
Author: Owen Pan Date: 2023-10-27T02:22:36-07:00 New Revision: 6c3bc910588f962e49470098ccc3b13c29cae493 URL: https://github.com/llvm/llvm-project/commit/6c3bc910588f962e49470098ccc3b13c29cae493 DIFF: https://github.com/llvm/llvm-project/commit/6c3bc910588f962e49470098ccc3b13c29cae493.diff

[clang] [clang-format] Don't break between string literal operands of << (PR #69871)

2023-10-27 Thread Owen Pan via cfe-commits
owenca wrote: IMO, the new behavior is consistent with the [documentation](https://clang.llvm.org/docs/ClangFormatStyleOptions.html#columnlimit) for `ColumnLimt: 0`. https://github.com/llvm/llvm-project/pull/69871 ___ cfe-commits mailing list

[clang] 88934a8 - [clang-format][NFC] Remove extraneous newlines in some unit test files

2023-10-26 Thread Owen Pan via cfe-commits
Author: Owen Pan Date: 2023-10-26T21:43:27-07:00 New Revision: 88934a82dced0116227e4ad9af8896d8fa0943b8 URL: https://github.com/llvm/llvm-project/commit/88934a82dced0116227e4ad9af8896d8fa0943b8 DIFF: https://github.com/llvm/llvm-project/commit/88934a82dced0116227e4ad9af8896d8fa0943b8.diff

[clang] [clang-format] Change LLVM style to BreakAfterAttributes == ABS_Leave (PR #70360)

2023-10-26 Thread Owen Pan via cfe-commits
owenca wrote: This would change the default for every other predefined style, which might be ok if there's no mention of breaking after C++11 attributes in those styles. https://github.com/llvm/llvm-project/pull/70360 ___ cfe-commits mailing list

[clang] e3ecdf7 - [clang-format][NFC] Remove some extraneous newlines at end of test cases

2023-10-26 Thread Owen Pan via cfe-commits
Author: Owen Pan Date: 2023-10-26T13:37:23-07:00 New Revision: e3ecdf7d3b7ec8fa2c3c594ff39b20788e75eaf2 URL: https://github.com/llvm/llvm-project/commit/e3ecdf7d3b7ec8fa2c3c594ff39b20788e75eaf2 DIFF: https://github.com/llvm/llvm-project/commit/e3ecdf7d3b7ec8fa2c3c594ff39b20788e75eaf2.diff

[clang] 265ed68 - [clang-format] Fix a JavaScript import order bug

2023-10-25 Thread Owen Pan via cfe-commits
Author: Owen Pan Date: 2023-10-25T17:06:53-07:00 New Revision: 265ed6819409a9d76f112a601d48b971904921c8 URL: https://github.com/llvm/llvm-project/commit/265ed6819409a9d76f112a601d48b971904921c8 DIFF: https://github.com/llvm/llvm-project/commit/265ed6819409a9d76f112a601d48b971904921c8.diff

[clang] 23d6a6d - [clang-format] Fix the version for a newly added option

2023-10-25 Thread Owen Pan via cfe-commits
Author: Owen Pan Date: 2023-10-25T05:45:32-07:00 New Revision: 23d6a6dfc1bc6e79bdcc48a59a0698a5b79262e9 URL: https://github.com/llvm/llvm-project/commit/23d6a6dfc1bc6e79bdcc48a59a0698a5b79262e9 DIFF: https://github.com/llvm/llvm-project/commit/23d6a6dfc1bc6e79bdcc48a59a0698a5b79262e9.diff

[clang] 69209e3 - [clang-format] AllowShortCompoundRequirementOnASingleLine

2023-10-25 Thread Owen Pan via cfe-commits
Author: Backl1ght Date: 2023-10-25T05:13:50-07:00 New Revision: 69209e30a7168b0493d8fb34989ddccd8c574670 URL: https://github.com/llvm/llvm-project/commit/69209e30a7168b0493d8fb34989ddccd8c574670 DIFF: https://github.com/llvm/llvm-project/commit/69209e30a7168b0493d8fb34989ddccd8c574670.diff

[clang] [clang-format] Don't align comments over scopes (PR #68743)

2023-10-25 Thread Owen Pan via cfe-commits
https://github.com/owenca approved this pull request. https://github.com/llvm/llvm-project/pull/68743 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Don't align comments over scopes (PR #68743)

2023-10-25 Thread Owen Pan via cfe-commits
@@ -182,7 +182,7 @@ TEST_F(FormatTestComments, UnderstandsSingleLineComments) { "int a; // This is unrelated")); EXPECT_EQ("class C {\n" " void f() { // This does something ..\n" -" } // awesome..\n" +"

[clang] [clang-format] Don't align comments over scopes (PR #68743)

2023-10-24 Thread Owen Pan via cfe-commits
@@ -3191,20 +3198,167 @@ TEST_F(FormatTestComments, DontAlignNamespaceComments) { "}\n" "// Comment"; -#if 0 - // FIXME: The following comment is aligned with the namespace comment. verifyFormat("namespace A {\n" " int Foo;\n"

[clang] [clang-format] Don't break between string literal operands of << (PR #69871)

2023-10-24 Thread Owen Pan via cfe-commits
https://github.com/owenca closed https://github.com/llvm/llvm-project/pull/69871 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 7bc1031 - Revert "[clang-format] Fix align consecutive declarations over function pointers"

2023-10-24 Thread Owen Pan via cfe-commits
Author: Owen Pan Date: 2023-10-24T02:15:44-07:00 New Revision: 7bc1031c474ebb2216a5432273dafe4d1490fbce URL: https://github.com/llvm/llvm-project/commit/7bc1031c474ebb2216a5432273dafe4d1490fbce DIFF: https://github.com/llvm/llvm-project/commit/7bc1031c474ebb2216a5432273dafe4d1490fbce.diff

[clang] [clang-format] Don't break between string literal operands of << (PR #69871)

2023-10-24 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/69871 >From d12aee14e9d588c402e69e49aa9b33be7f940acb Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Sun, 22 Oct 2023 01:36:17 -0700 Subject: [PATCH] [clang-format] Don't break between string literal operands of <<

[clang] [clang-format] Skip PP directives when determining brace kind (PR #69473)

2023-10-24 Thread Owen Pan via cfe-commits
owenca wrote: > I didn't expect you to not want to be credited, but I'll respect your opinion! I meant you didn't need to add me to the authorship.  Anyway, I do appreciate it and think you should be the only author. > GitHub adds co-ownership automatically if using the web ui to commit a >

[clang] [clang-format] Allow default values for template parameters in lambda (PR #69052)

2023-10-23 Thread Owen Pan via cfe-commits
owenca wrote: @rymiel, thanks for the co-authorship, but I really didn't deserve it here! https://github.com/llvm/llvm-project/pull/69052 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang-format] Skip PP directives when determining brace kind (PR #69473)

2023-10-23 Thread Owen Pan via cfe-commits
owenca wrote: @rymiel, please remove me from the authorship. I suggested code in numerous reviews and never expected to get co-authorship just because the authors took my suggestions.  https://github.com/llvm/llvm-project/pull/69473 ___ cfe-commits

[clang-tools-extra] [clang-format] Don't break between string literal operands of << (PR #69871)

2023-10-23 Thread Owen Pan via cfe-commits
owenca wrote: > I think adding the possibility of breaking '<<' is a good idea if it's > optional, what do u think? +1, but see also https://github.com/llvm/llvm-project/pull/69859#issuecomment-1776064714. https://github.com/llvm/llvm-project/pull/69871

[clang] [clang-format] Don't break between string literal operands of << (PR #69871)

2023-10-23 Thread Owen Pan via cfe-commits
owenca wrote: > I think adding the possibility of breaking '<<' is a good idea if it's > optional, what do u think? +1, but see also https://github.com/llvm/llvm-project/pull/69859#issuecomment-1776064714. https://github.com/llvm/llvm-project/pull/69871

[clang] [clang-format] unexpected break after binOp '<<' (PR #69859)

2023-10-23 Thread Owen Pan via cfe-commits
owenca wrote: > 2th solution is: Add new option that allowing specific behaviour, such as > "BreakAfterStreamOperator" or "BreakAfterLessLessOperator" with options [ > Leave | NoFitLine | All ]. We need a comprehensive solution to cover the following: - when to break - before or after the

<    3   4   5   6   7   8   9   10   11   12   >