[clang] [clang-format] Annotate the l_paren of function pointer types (PR #109229)

2024-09-18 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/109229 Fixes #109146. >From 84c166dfabc3f314cd922baa3933b3d0ea11e08e Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Wed, 18 Sep 2024 21:03:24 -0700 Subject: [PATCH] [clang-format] Annotate the l_paren of function pointe

[clang] [clang-format] Fix regression in BAS_AlwaysBreak for-await (PR #108634)

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

[clang] [clang-format] Handle C-style cast of qualified type (PR #108929)

2024-09-17 Thread Owen Pan via cfe-commits
https://github.com/owenca closed https://github.com/llvm/llvm-project/pull/108929 ___ 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 SpacesInParens InConditionalStatements (PR #108797)

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

[clang] [clang-format] Reimplement InsertNewlineAtEOF (PR #108513)

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

[clang] [clang-format[NFC] Clean up FormatTestBase and Proto/TextProto tests (PR #108334)

2024-09-17 Thread Owen Pan via cfe-commits
https://github.com/owenca closed https://github.com/llvm/llvm-project/pull/108334 ___ 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 annotating angles containing FatArrow (PR #108671)

2024-09-16 Thread Owen Pan via cfe-commits
@@ -243,14 +244,16 @@ class AnnotatingParser { // operator that was misinterpreted because we are parsing template // parameters. // FIXME: This is getting out of hand, write a decent parser. - if (InExpr && !Line.startsWith(tok::kw_template) && + if

[clang] [clang-format] Handle C-style cast of qualified type (PR #108929)

2024-09-16 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/108929 Fixes #102874. >From db3da97b684403fdbf38b0f029438c00cfa16a5f Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Mon, 16 Sep 2024 21:31:29 -0700 Subject: [PATCH] [clang-format] Handle C-style cast of qualified type

[clang] [Format] Dont treat LBrace after extends/implements as initializer list (PR #108524)

2024-09-16 Thread Owen Pan via cfe-commits
https://github.com/owenca approved this pull request. https://github.com/llvm/llvm-project/pull/108524 ___ 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 SpacesInParens InConditionalStatements (PR #108797)

2024-09-16 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/108797 Fixes #64416. >From 85e130d6e1fc1213f7daccf492aecc422c026c73 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Mon, 16 Sep 2024 00:15:28 -0700 Subject: [PATCH] [clang-format] Fix a bug in SpacesInParens InCondition

[clang] [clang-format] Fix a bug in annotating StartOfName (PR #99791)

2024-09-15 Thread Owen Pan via cfe-commits
owenca wrote: > That is very unfortunate. It means one will either get different results for > the clang-format versions, one disables the formatting, or works around it by > sth. Like Q_EMIT(something()->mySignal()). Or wait for the next release (in this case 19.1.0, which is just around the

[clang] [git-clang-format] Fix: make the tool backward compatible (PR #108721)

2024-09-15 Thread Owen Pan via cfe-commits
owenca wrote: Why do we need to make newer versions of git-clang-format "compatible" with older versions of clang-format? Shouldn't both be from the same LLVM release? https://github.com/llvm/llvm-project/pull/108721 ___ cfe-commits mailing list cfe-c

[clang] [clang-format] Fix regression in BAS_AlwaysBreak for-await (PR #108634)

2024-09-15 Thread Owen Pan via cfe-commits
https://github.com/owenca edited https://github.com/llvm/llvm-project/pull/108634 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Fix regression in AlwaysBreak for-await (PR #108634)

2024-09-15 Thread Owen Pan via cfe-commits
https://github.com/owenca approved this pull request. https://github.com/llvm/llvm-project/pull/108634 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Fix regression in AlwaysBreak for-await (PR #108634)

2024-09-13 Thread Owen Pan via cfe-commits
@@ -809,7 +809,7 @@ void ContinuationIndenter::addTokenOnCurrentLine(LineState &State, bool DryRun, if (Tok.Previous->isIf()) return Style.AlignAfterOpenBracket == FormatStyle::BAS_AlwaysBreak; return !Tok.Previous->isOneOf(TT_CastRParen, tok::kw_for, tok::kw_whi

[clang] [Format] Dont treat LBrace after extends/implements as initializer list (PR #108524)

2024-09-13 Thread Owen Pan via cfe-commits
https://github.com/owenca commented: Can you add a `TokenAnnotatorTest`? https://github.com/llvm/llvm-project/pull/108524 ___ 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 annotating StartOfName (PR #99791)

2024-09-13 Thread Owen Pan via cfe-commits
owenca wrote: Unfortunately no because clang-format is part of llvm, and as far as I know there will be no more llvm 18 point releases. https://github.com/llvm/llvm-project/pull/99791 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lis

[clang] [clang-format] Fix a bug in annotating angles containing FatArrow (PR #108671)

2024-09-13 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/108671 Fixes #108536. >From 90a2015196595bb72fb64490d1579f01b7c18a2a Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Fri, 13 Sep 2024 19:36:48 -0700 Subject: [PATCH] [clang-format] Fix a bug in annotating angles containi

[clang] [clang-format] Reimplement InsertNewlineAtEOF (PR #108513)

2024-09-13 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/108513 Fixes #108333. >From c85d8cdd44ad577bbc2a29e45058b0c972c6fa9e Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Fri, 13 Sep 2024 01:21:29 -0700 Subject: [PATCH] [clang-format] Reimplement InsertNewlineAtEOF Fixes #

[clang] [clang-format[NFC] Clean up FormatTestBase and Proto/TextProto tests (PR #108334)

2024-09-11 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/108334 None >From 556db4b4c5b727cd44aec39d16178720edf77942 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Wed, 11 Sep 2024 23:07:37 -0700 Subject: [PATCH] [clang-format[NFC] Clean up FormatTestBase and Proto/TextProto

[clang] 9469836 - [clang-format][NFC] Minor clean of TokenAnnotatorTest

2024-09-11 Thread Owen Pan via cfe-commits
Author: Owen Pan Date: 2024-09-11T20:35:13-07:00 New Revision: 94698369e9cc211b4d1e666b82dc5848c40ab5ce URL: https://github.com/llvm/llvm-project/commit/94698369e9cc211b4d1e666b82dc5848c40ab5ce DIFF: https://github.com/llvm/llvm-project/commit/94698369e9cc211b4d1e666b82dc5848c40ab5ce.diff LOG:

[clang] [clang-format] Fix regressions in BAS_AlwaysBreak (PR #107506)

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

[clang] [Format] Avoid repeated hash lookups (NFC) (PR #107962)

2024-09-10 Thread Owen Pan via cfe-commits
@@ -86,9 +86,7 @@ void ObjCPropertyAttributeOrderFixer::sortPropertyAttributes( Value = Tok->TokenText; } -auto It = SortOrderMap.find(Attribute); -if (It == SortOrderMap.end()) - It = SortOrderMap.insert({Attribute, SortOrderMap.size()}).first; +aut

[clang] [Format] Avoid repeated hash lookups (NFC) (PR #107962)

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

[clang] [clang-format] Add new option: WrapNamespaceBodyWithNewlines (PR #106145)

2024-09-08 Thread Owen Pan via cfe-commits
https://github.com/owenca requested changes to this pull request. Running `FormatTests` failed: ``` [ RUN ] FormatTest.WrapNamespaceBodyWithEmptyLinesNever Assertion failed: (TheLine->MatchingClosingBlockLineIndex > 0), function tryFitMultipleLinesInOne, file UnwrappedLineFormatter.cpp, lin

[clang] [clang-format] Fix regressions in BAS_AlwaysBreak (PR #107506)

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

[clang] [clang-format] Fix regressions in BAS_AlwaysBreak (PR #107506)

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

[clang] [clang-format] Fix a regression on BAS_AlwaysBreak (PR #107506)

2024-09-08 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/107506 >From bd7da6ec9afabd829010db4c33d088590ab68b5a Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Thu, 5 Sep 2024 19:44:46 -0700 Subject: [PATCH 1/3] [clang-format] Fix a regression on BAS_AlwaysBreak Fixes #107401.

[clang] [clang-format] Fix a bug in annotating CastRParen (PR #107675)

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

[clang] [clang-format] Fix a regression on BAS_AlwaysBreak (PR #107506)

2024-09-07 Thread Owen Pan via cfe-commits
owenca wrote: > i've also found 3 more cases that point back to same patch in #107574, in > case you want to address all of them with this change I'd rather make incremental changes. Maybe you or @gedare can give them a try. https://github.com/llvm/llvm-project/pull/107506

[clang] [clang-format] Fix a regression on BAS_AlwaysBreak (PR #107506)

2024-09-07 Thread Owen Pan via cfe-commits
@@ -861,7 +861,7 @@ void ContinuationIndenter::addTokenOnCurrentLine(LineState &State, bool DryRun, // or // cal( // new SomethingElseee()); - !IsSimpleFunction(Current)) { + Current.isNot(

[clang] [clang-format] Fix a regression on BAS_AlwaysBreak (PR #107506)

2024-09-07 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/107506 >From bd7da6ec9afabd829010db4c33d088590ab68b5a Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Thu, 5 Sep 2024 19:44:46 -0700 Subject: [PATCH 1/2] [clang-format] Fix a regression on BAS_AlwaysBreak Fixes #107401.

[clang] [clang-format] Fix a bug in annotating CastRParen (PR #107675)

2024-09-07 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/107675 Fixes #107568. >From 6deac871ceae8ba3918570a4bdbd8476e014a3a1 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Sat, 7 Sep 2024 01:39:34 -0700 Subject: [PATCH] [clang-format] Fix a bug in annotating CastRParen Fixe

[clang] clang-format: Add "AllowShortNamespacesOnASingleLine" option (PR #105597)

2024-09-06 Thread Owen Pan via cfe-commits
@@ -27981,6 +27981,118 @@ TEST_F(FormatTest, BreakBinaryOperations) { Style); } +TEST_F(FormatTest, ShortNamespacesOption) { + FormatStyle Style = getLLVMStyle(); + Style.AllowShortNamespacesOnASingleLine = true; + Style.FixNamespaceComments = false; + + //

[clang] clang-format: Add "AllowShortNamespacesOnASingleLine" option (PR #105597)

2024-09-06 Thread Owen Pan via cfe-commits
https://github.com/owenca edited https://github.com/llvm/llvm-project/pull/105597 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] clang-format: Add "AllowShortNamespacesOnASingleLine" option (PR #105597)

2024-09-06 Thread Owen Pan via cfe-commits
@@ -27981,6 +27981,118 @@ TEST_F(FormatTest, BreakBinaryOperations) { Style); } +TEST_F(FormatTest, ShortNamespacesOption) { + FormatStyle Style = getLLVMStyle(); + Style.AllowShortNamespacesOnASingleLine = true; + Style.FixNamespaceComments = false; + + //

[clang] clang-format: Add "AllowShortNamespacesOnASingleLine" option (PR #105597)

2024-09-06 Thread Owen Pan via cfe-commits
@@ -27981,6 +27981,118 @@ TEST_F(FormatTest, BreakBinaryOperations) { Style); } +TEST_F(FormatTest, ShortNamespacesOption) { + FormatStyle Style = getLLVMStyle(); + Style.AllowShortNamespacesOnASingleLine = true; + Style.FixNamespaceComments = false; + + //

[clang] clang-format: Add "AllowShortNamespacesOnASingleLine" option (PR #105597)

2024-09-06 Thread Owen Pan via cfe-commits
https://github.com/owenca commented: The following are missing: - Run `dump_format_style.py`. - Add a `ConfigParseTest` for the new option. How does the new option interact with `CompactNamespaces`? For example: - `AllowShortNamespacesOnASingleLine: true` and `CompactNamespaces: false` ``` names

[clang] clang-format: Add "AllowShortNamespacesOnASingleLine" option (PR #105597)

2024-09-06 Thread Owen Pan via cfe-commits
@@ -27981,6 +27981,118 @@ TEST_F(FormatTest, BreakBinaryOperations) { Style); } +TEST_F(FormatTest, ShortNamespacesOption) { + FormatStyle Style = getLLVMStyle(); owenca wrote: ```suggestion auto Style = getLLVMStyle(); ``` https://github.c

[clang] [clang-tools-extra] [llvm] [clang-format] Add support for BasedOnStyle referencing an arbitrary file (PR #107312)

2024-09-06 Thread Owen Pan via cfe-commits
owenca wrote: @jediry, can you open a github issue for this? We probably should continue the discussion on your [RFC](https://discourse.llvm.org/t/rfc-clang-format-option-to-include-another-configuration-file/74891) before getting into the details of the implementation. At the very least, I n

[clang] [clang-format] Correctly annotate braces in macro definition (PR #107352)

2024-09-06 Thread Owen Pan via cfe-commits
owenca wrote: Done in #107531. https://github.com/llvm/llvm-project/pull/107352 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Correctly annotate braces in macro definition (PR #107352)

2024-09-05 Thread Owen Pan via cfe-commits
owenca wrote: /cherry-pick 616a8ce6203d8c7569266bfaf163e74df1f440ad https://github.com/llvm/llvm-project/pull/107352 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Correctly annotate braces in macro definition (PR #107352)

2024-09-05 Thread Owen Pan via cfe-commits
https://github.com/owenca milestoned https://github.com/llvm/llvm-project/pull/107352 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Fix a regression on BAS_AlwaysBreak (PR #107506)

2024-09-05 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/107506 Fixes #107401. >From bd7da6ec9afabd829010db4c33d088590ab68b5a Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Thu, 5 Sep 2024 19:44:46 -0700 Subject: [PATCH] [clang-format] Fix a regression on BAS_AlwaysBreak Fix

[clang] [clang-format] Correctly annotate braces in macro definition (PR #107352)

2024-09-04 Thread Owen Pan via cfe-commits
https://github.com/owenca edited https://github.com/llvm/llvm-project/pull/107352 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Correctly annotate braces in macro definition (PR #107352)

2024-09-04 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/107352 Also add a test case for #106418. Fixes #107096. >From 8b359c9ab7e2b119383235c042f9804136ee172e Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Wed, 4 Sep 2024 21:41:28 -0700 Subject: [PATCH] [clang-format] Corre

[clang] 3449ed8 - Revert "[clang-format] Correctly annotate braces in macro definition (#106662)"

2024-09-03 Thread Owen Pan via cfe-commits
Author: Owen Pan Date: 2024-09-03T22:54:50-07:00 New Revision: 3449ed8dece600f387357b71ff74ae4bc46828b6 URL: https://github.com/llvm/llvm-project/commit/3449ed8dece600f387357b71ff74ae4bc46828b6 DIFF: https://github.com/llvm/llvm-project/commit/3449ed8dece600f387357b71ff74ae4bc46828b6.diff LOG:

[clang] [clang-format] Handle pointer/reference in macro definitions (PR #107074)

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

[clang] [clang-format] Fix a regression in annotating ObjCBlockLParen (PR #107021)

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

[clang] [clang-format] Handle spaces in file paths in git-clang-format.bat (PR #107041)

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

[clang] [clang-format] Handle pointer/reference in macro definitions (PR #107074)

2024-09-03 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/107074 A macro definition needs its own scope stack in the annotator, so we add the MacroBodyScopes stack and use ScopeStack to refer to it when in the macro definition body. Also, we need to have a scope type for a c

[clang] [clang-format] Correctly annotate braces in macro definition (PR #106662)

2024-09-03 Thread Owen Pan via cfe-commits
owenca wrote: /cherry-pick 0fa78b6c7bd43c2498700a98c47a02cf4fd06388 https://github.com/llvm/llvm-project/pull/106662 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Handle spaces in file paths in git-clang-format.bat (PR #107041)

2024-09-02 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/107041 This patch is provided by @jeliebig. Fixes #107017. >From f44ecbe9880aba26ca02046dbe26582ea81abe73 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Mon, 2 Sep 2024 19:33:01 -0700 Subject: [PATCH] [clang-format] Ha

[clang] [clang-format] Fix a regression in annotating ObjCBlockLParen (PR #107021)

2024-09-02 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/107021 Fixes #106994. >From 563ad14fb2b5b91adbc906fce34e74e71dc1f141 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Mon, 2 Sep 2024 14:02:54 -0700 Subject: [PATCH] [clang-format] Fix a regression in annotating ObjCBlock

[clang] [clang-format] Correctly annotate braces in macro definition (PR #106662)

2024-09-02 Thread Owen Pan via cfe-commits
owenca wrote: /cherry-pick 0fa78b6c7bd43c2498700a98c47a02cf4fd06388 https://github.com/llvm/llvm-project/pull/106662 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Correctly annotate braces in macro definition (PR #106662)

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

[clang] [clang-format] Correctly identify token-pasted record names (PR #106484)

2024-09-01 Thread Owen Pan via cfe-commits
owenca wrote: /cherry-pick https://github.com/llvm/llvm-project/commit/7579787e05966f21684dd4b4a15b9deac13d09e1 https://github.com/llvm/llvm-project/pull/106484 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mai

[clang] [llvm] [NFC] Fix typos (PR #106817)

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

[clang] [llvm] [NFC] Fix typos (PR #106817)

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

[clang] [llvm] [Chore] Fix `formating` typos. NFC. (PR #106817)

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

[clang] [clang-format] Add new option: WrapNamespaceBodyWithNewlines (PR #106145)

2024-08-31 Thread Owen Pan via cfe-commits
owenca wrote: Please run `git clang-format HEAD~` and `ninja clang-format-check-format` before pushing. https://github.com/llvm/llvm-project/pull/106145 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/lis

[clang] [clang-format] Correctly annotate braces in macro definition (PR #106662)

2024-08-30 Thread Owen Pan via cfe-commits
https://github.com/owenca milestoned https://github.com/llvm/llvm-project/pull/106662 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Correctly annotate braces in ObjC square brackets (PR #106654)

2024-08-30 Thread Owen Pan via cfe-commits
owenca wrote: /cherry-pick e0f2368cdeb7312973a92fb2d22199d1de540db8 https://github.com/llvm/llvm-project/pull/106654 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Correctly annotate braces in ObjC square brackets (PR #106654)

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

[clang] [clang-format] Correctly annotate braces in ObjC square brackets (PR #106654)

2024-08-30 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/106654 >From b71f4cf3ae2844583171cd0cc75826b8911a7b2b Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Thu, 29 Aug 2024 19:27:32 -0700 Subject: [PATCH 1/2] [clang-format] Correctly annotate braces in ObjC square brackets

[clang] [clang-format] Correctly annotate braces in macro definition (PR #106662)

2024-08-29 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/106662 Fixes #106418. >From fbefbaae69e7238cf0fd52afe5ccc6b871e81b84 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Thu, 29 Aug 2024 22:14:46 -0700 Subject: [PATCH] [clang-format] Correctly annotate braces in macro defi

[clang] [clang-format] Correctly annotate braces in ObjC square brackets (PR #106654)

2024-08-29 Thread Owen Pan via cfe-commits
https://github.com/owenca milestoned https://github.com/llvm/llvm-project/pull/106654 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Correctly annotate braces in ObjC square brackets (PR #106654)

2024-08-29 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/106654 See https://github.com/llvm/llvm-project/pull/88238#issuecomment-2316954781. >From b71f4cf3ae2844583171cd0cc75826b8911a7b2b Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Thu, 29 Aug 2024 19:27:32 -0700 Subject:

[clang] [clang-format] Correctly identify token-pasted record names (PR #106484)

2024-08-29 Thread Owen Pan via cfe-commits
owenca wrote: /cherry-pick 7579787e05966f21684dd4b4a15b9deac13d09e1 https://github.com/llvm/llvm-project/pull/106484 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Correctly identify token-pasted record names (PR #106484)

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

[clang] [clang-format] Correctly identify token-pasted record names (PR #106484)

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

[clang] Fix clang-format-test.el past 625841c (PR #106398)

2024-08-28 Thread Owen Pan via cfe-commits
owenca wrote: @dklimkin I known this is a trivial fix, but it would be better to request anyone from https://github.com/orgs/llvm/teams/pr-subscribers-clang-format to have a look before merging it. There was an outstanding PR #106305 before yours. Can you review it and see if you want to ask

[clang] [clang-format] Correctly identifies token-pasted record names (PR #106484)

2024-08-28 Thread Owen Pan via cfe-commits
https://github.com/owenca milestoned https://github.com/llvm/llvm-project/pull/106484 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Correctly identifies token-pasted record names (PR #106484)

2024-08-28 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/106484 See https://github.com/llvm/llvm-project/pull/89706#issuecomment-2315549955. >From 9b05f16c3540a8a43c6bf8bf34e7e0fb38056e17 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Wed, 28 Aug 2024 19:56:32 -0700 Subject:

[clang] [clang-format] Revert "[clang-format][NFC] Delete TT_LambdaArrow (#70… (PR #105923)

2024-08-28 Thread Owen Pan via cfe-commits
owenca wrote: /cherry-pick 438ad9f2bf25575c474313de4ad85a5da6f69e4c https://github.com/llvm/llvm-project/pull/105923 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Revert "[clang-format][NFC] Delete TT_LambdaArrow (#70… (PR #105923)

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

[clang] [clang-format] js handle anonymous classes (PR #106242)

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

[clang] [clang-format] js handle anonymous classes (PR #106242)

2024-08-28 Thread Owen Pan via cfe-commits
https://github.com/owenca approved this pull request. LG except some nits. https://github.com/llvm/llvm-project/pull/106242 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] js handle anonymous classes (PR #106242)

2024-08-28 Thread Owen Pan via cfe-commits
@@ -3238,6 +3238,12 @@ TEST_F(TokenAnnotatorTest, BraceKind) { EXPECT_BRACE_KIND(Tokens[8], BK_BracedInit); EXPECT_BRACE_KIND(Tokens[11], BK_BracedInit); EXPECT_BRACE_KIND(Tokens[13], BK_Block); + + Tokens = annotate("a = class extends goog.a {}", +ge

[clang] [clang-format] Fix test (PR #106305)

2024-08-27 Thread Owen Pan via cfe-commits
owenca wrote: Please give a more descriptive title. https://github.com/llvm/llvm-project/pull/106305 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] js handle anonymous classes (PR #106242)

2024-08-27 Thread Owen Pan via cfe-commits
@@ -579,6 +579,14 @@ TEST_F(FormatTestJS, GoogScopes) { "});"); } +TEST_F(FormatTestJS, GoogAnonymousClass) { owenca wrote: Please add a `TokenAnnotatorTest` to test the annotation of the braces instead of (preferred), or in addition to, this

[clang] [clang-format] Fix misalignments of pointers in angle brackets (PR #106013)

2024-08-27 Thread Owen Pan via cfe-commits
owenca wrote: /cherry-pick 656d5aa95825515a55ded61f19d41053c850c82d https://github.com/llvm/llvm-project/pull/106013 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Insert a space between new/delete and a C-style cast (PR #106175)

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

[clang] [clang-format] Fix misalignments of pointers in angle brackets (PR #106013)

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

[clang] [clang-format] Insert a space between new/delete and a C-style cast (PR #106175)

2024-08-26 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/106175 It doesn't make sense to remove the space between new/delete and a C-style cast when SpaceBeforeParensOptions.AfterPlacementOperator is set to false. Fixes #105628. >From 8266cfb1d52dd55c710c16d9c57ca974bd94bb9

[clang] [clang-format] Fix misalignments of pointers in angle brackets (PR #106013)

2024-08-26 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/106013 >From a880299cd884d064e2bd03af308afa52736fa75d Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Sun, 25 Aug 2024 14:30:32 -0700 Subject: [PATCH 1/2] [clang-format] Fix misalignments of pointers in angle brackets F

[clang] [clang-format] Fix misalignments of pointers in angle brackets (PR #106013)

2024-08-25 Thread Owen Pan via cfe-commits
https://github.com/owenca milestoned https://github.com/llvm/llvm-project/pull/106013 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Fix misalignments of pointers in angle brackets (PR #106013)

2024-08-25 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/106013 Fixes #105898. >From a880299cd884d064e2bd03af308afa52736fa75d Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Sun, 25 Aug 2024 14:30:32 -0700 Subject: [PATCH] [clang-format] Fix misalignments of pointers in angle

[clang] [clang-format] Fix a misannotation of less/greater as angle brackets (PR #105941)

2024-08-24 Thread Owen Pan via cfe-commits
owenca wrote: /cherry-pick 0916ae49b89db6eb9eee9f6fee4f1a65fd9cdb74 https://github.com/llvm/llvm-project/pull/105941 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Fix a misannotation of less/greater as angle brackets (PR #105941)

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

[clang] [clang-format] Fix a misannotation of redundant r_paren as CastRParen (PR #105921)

2024-08-24 Thread Owen Pan via cfe-commits
owenca wrote: /cherry-pick 6bc225e0630f28e83290a43c3d9b25b057fc815a https://github.com/llvm/llvm-project/pull/105921 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Fix a misannotation of redundant r_paren as CastRParen (PR #105921)

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

[clang] [clang-format] Fix a misannotation of less/greater as angle brackets (PR #105941)

2024-08-24 Thread Owen Pan via cfe-commits
https://github.com/owenca milestoned https://github.com/llvm/llvm-project/pull/105941 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Fix a misannotation of less/greater as angle brackets (PR #105941)

2024-08-24 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/105941 Fixes #105877. >From 28983f4532df55ee31fc366fb5a945594c0baf1a Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Sat, 24 Aug 2024 07:32:08 -0700 Subject: [PATCH] [clang-format] Fix a misannotation of less/greater as

[clang] [clang-format] Revert "[clang-format][NFC] Delete TT_LambdaArrow (#70… (PR #105923)

2024-08-23 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/105923 >From dbf35d6d7e1b0ba5c80453105757baf5357169d4 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Fri, 23 Aug 2024 02:24:39 -0700 Subject: [PATCH 1/2] [clang-format] Revert "[clang-format][NFC] Delete TT_LambdaArrow

[clang] [clang-format] Revert "[clang-format][NFC] Delete TT_LambdaArrow (#70… (PR #105923)

2024-08-23 Thread Owen Pan via cfe-commits
@@ -3369,6 +3371,20 @@ TEST_F(TokenAnnotatorTest, GNULanguageStandard) { EXPECT_TOKEN(Tokens[2], tok::spaceship, TT_BinaryOperator); } +TEST_F(TokenAnnotatorTest, SplitPenalty) { + auto Style = getLLVMStyle(); + Style.ColumnLimit = 20; + + auto Tokens = annotate("class fo

[clang] [clang-format] Correctly compute SplitPenalty of TrailingReturnArrow (PR #105613)

2024-08-23 Thread Owen Pan via cfe-commits
owenca wrote: See #105923. https://github.com/llvm/llvm-project/pull/105613 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Correctly compute SplitPenalty of TrailingReturnArrow (PR #105613)

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

[clang] [clang-format] Revert "[clang-format][NFC] Delete TT_LambdaArrow (#70… (PR #105923)

2024-08-23 Thread Owen Pan via cfe-commits
https://github.com/owenca milestoned https://github.com/llvm/llvm-project/pull/105923 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Revert "[clang-format][NFC] Delete TT_LambdaArrow (#70… (PR #105923)

2024-08-23 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/105923 …519)" This reverts commit e00d32afb9d33a1eca48e2b041c9688436706c5b and adds a test for lambda arrow SplitPenalty. Fixes #105480. >From dbf35d6d7e1b0ba5c80453105757baf5357169d4 Mon Sep 17 00:00:00 2001 From: O

<    1   2   3   4   5   6   7   8   9   10   >