[clang] [clang-format] Set Change.TokenLength to ColumnWidth (PR #90378)

2024-04-28 Thread Owen Pan via cfe-commits
https://github.com/owenca closed https://github.com/llvm/llvm-project/pull/90378 ___ 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 struct braces (PR #90555)

2024-04-29 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/90555 Fixes #60040. >From 77d807d47d47ca9916edc03182e1952c27300a8a Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Mon, 29 Apr 2024 21:11:28 -0700 Subject: [PATCH] [clang-format] Fix a bug in annotating struct braces Fi

[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-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-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
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] 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 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-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] 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
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] 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] 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] 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] 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] 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 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] [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
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 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 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 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-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] [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] 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 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] [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] 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 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] [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] [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] [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 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] 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] 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] 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 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][NFC] Annotate function decl l_paren (PR #97938)

2024-07-08 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/97938 >From eb53318b3c5dec2452c4a0d5aed7944ebdd99380 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Sat, 6 Jul 2024 22:21:26 -0700 Subject: [PATCH 1/2] [clang-format][NFC] Annotate function decl l_paren --- clang/lib/F

[clang] [clang-format][NFC] Annotate function/ctor/dtor declaration l_paren (PR #97938)

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

[clang] [clang-format][NFC] Annotate function/ctor/dtor declaration l_paren (PR #97938)

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

[clang] [clang-format] Add BinPackBinaryOperations configuration (PR #95013)

2024-07-10 Thread Owen Pan via cfe-commits
@@ -146,6 +146,14 @@ static bool startsNextParameter(const FormatToken &Current, Style.BreakInheritanceList != FormatStyle::BILS_BeforeComma)); } +// Returns \c true if \c Current starts a new operand in a binary operation. owenca wrote: Did you me

[clang] [clang-format] Add BinPackBinaryOperations configuration (PR #95013)

2024-07-10 Thread Owen Pan via cfe-commits
@@ -3153,6 +3153,15 @@ class ExpressionParser { parse(Precedence + 1); int CurrentPrecedence = getCurrentPrecedence(); + if (!Style.BinPackBinaryOperations && + (CurrentPrecedence > prec::Conditional) && + (CurrentPrecedence < prec::PointerTo

[clang] [clang-format] Add BinPackBinaryOperations configuration (PR #95013)

2024-07-10 Thread Owen Pan via cfe-commits
@@ -146,6 +146,14 @@ static bool startsNextParameter(const FormatToken &Current, Style.BreakInheritanceList != FormatStyle::BILS_BeforeComma)); } +// Returns \c true if \c Current starts a new operand in a binary operation. +static bool startsNextOperand(const Forma

[clang] [clang-format] Add BinPackBinaryOperations configuration (PR #95013)

2024-07-10 Thread Owen Pan via cfe-commits
@@ -146,6 +146,14 @@ static bool startsNextParameter(const FormatToken &Current, Style.BreakInheritanceList != FormatStyle::BILS_BeforeComma)); } +// Returns \c true if \c Current starts a new operand in a binary operation. +static bool startsNextOperand(const Forma

[clang] [clang-format] Add BinPackBinaryOperations configuration (PR #95013)

2024-07-10 Thread Owen Pan via cfe-commits
@@ -27628,6 +27628,109 @@ TEST_F(FormatTest, SpaceBetweenKeywordAndLiteral) { verifyFormat("return sizeof \"5\";"); } +TEST_F(FormatTest, BinPackBinaryOperations) { + auto Style = getLLVMStyleWithColumns(60); + // Logical operations + verifyFormat("if (condition1 && condi

[clang] [clang-format] Fix a bug in TCAS_Leave using tabs for indentation (PR #98427)

2024-07-10 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/98427 Fixes #92530. >From fa1da3d06ed2207902df4911933bd40f0d514e51 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Wed, 10 Jul 2024 20:52:18 -0700 Subject: [PATCH] [clang-format] Fix a bug in TCAS_Leave using tabs for i

[clang] [clang-format] Add BinPackBinaryOperations configuration (PR #95013)

2024-07-10 Thread Owen Pan via cfe-commits
https://github.com/owenca commented: Also, we need ConfigParseTest for the new option. https://github.com/llvm/llvm-project/pull/95013 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Add BinPackBinaryOperations configuration (PR #95013)

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

[clang] [clang-format] Add BinPackBinaryOperations configuration (PR #95013)

2024-07-10 Thread Owen Pan via cfe-commits
@@ -3153,6 +3153,15 @@ class ExpressionParser { parse(Precedence + 1); int CurrentPrecedence = getCurrentPrecedence(); + if (!Style.BinPackBinaryOperations && + (CurrentPrecedence > prec::Conditional) && + (CurrentPrecedence < prec::PointerTo

[clang] [clang-format] Add BinPackBinaryOperations configuration (PR #95013)

2024-07-10 Thread Owen Pan via cfe-commits
@@ -27628,6 +27628,109 @@ TEST_F(FormatTest, SpaceBetweenKeywordAndLiteral) { verifyFormat("return sizeof \"5\";"); } +TEST_F(FormatTest, BinPackBinaryOperations) { + auto Style = getLLVMStyleWithColumns(60); + // Logical operations + verifyFormat("if (condition1 && condi

[clang] [clang-format] Fix a bug in TCAS_Leave using tabs for indentation (PR #98427)

2024-07-11 Thread Owen Pan via cfe-commits
https://github.com/owenca closed https://github.com/llvm/llvm-project/pull/98427 ___ 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 SpaceBeforeParensOptions (PR #98849)

2024-07-14 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/98849 Handle constructors/destructors for AfterFunctionDeclarationName and AfterFunctionDefinitionName. Fixes #98812. >From 24f3b4f03f217e578aa2a2585d7d1742b7d7c09b Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Sun,

[clang] [clang-format] Fix a bug in SpaceBeforeParensOptions (PR #98849)

2024-07-14 Thread Owen Pan via cfe-commits
https://github.com/owenca edited https://github.com/llvm/llvm-project/pull/98849 ___ 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 SpaceBeforeParensOptions (PR #98849)

2024-07-14 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/98849 >From 24f3b4f03f217e578aa2a2585d7d1742b7d7c09b Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Sun, 14 Jul 2024 17:52:23 -0700 Subject: [PATCH 1/2] [clang-format] Fix a bug in SpaceBeforeParensOptions Handle constr

[clang] [clang-format] Fix a bug in SpaceBeforeParensOptions (PR #98849)

2024-07-14 Thread Owen Pan via cfe-commits
owenca wrote: > Are there tests for #98820? I've added a test case. https://github.com/llvm/llvm-project/pull/98849 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Add BinPackBinaryOperations configuration (PR #95013)

2024-07-14 Thread Owen Pan via cfe-commits
@@ -27628,6 +27628,119 @@ TEST_F(FormatTest, SpaceBetweenKeywordAndLiteral) { verifyFormat("return sizeof \"5\";"); } +TEST_F(FormatTest, BinPackBinaryOperations) { + auto Style = getLLVMStyleWithColumns(60); + // Logical operations + verifyFormat("if (condition1 && condi

[clang] [clang-format] Add BinPackBinaryOperations configuration (PR #95013)

2024-07-14 Thread Owen Pan via cfe-commits
@@ -27628,6 +27628,119 @@ TEST_F(FormatTest, SpaceBetweenKeywordAndLiteral) { verifyFormat("return sizeof \"5\";"); } +TEST_F(FormatTest, BinPackBinaryOperations) { + auto Style = getLLVMStyleWithColumns(60); + // Logical operations + verifyFormat("if (condition1 && condi

[clang] [clang-format] Fix a bug in annotating struct braces (PR #90555)

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

[clang] [llvm] [z/OS] treat text files as text files so auto-conversion is done (PR #90128)

2024-05-01 Thread Owen Pan via cfe-commits
@@ -413,8 +413,9 @@ static bool format(StringRef FileName, bool ErrorOnIncompleteFormat = false) { // On Windows, overwriting a file with an open file mapping doesn't work, // so read the whole file into memory when formatting in-place. ErrorOr> CodeOrErr = - !Outpu

[clang] d2af1ea - [clang-format][NFC] Minor improvement to parseLabel()

2024-05-02 Thread Owen Pan via cfe-commits
Author: Owen Pan Date: 2024-05-02T19:42:01-07:00 New Revision: d2af1ea81dd0170133c53ebd67c9a9be125dfd31 URL: https://github.com/llvm/llvm-project/commit/d2af1ea81dd0170133c53ebd67c9a9be125dfd31 DIFF: https://github.com/llvm/llvm-project/commit/d2af1ea81dd0170133c53ebd67c9a9be125dfd31.diff LOG:

[clang] [clang-format] Don't remove parentheses of fold expressions (PR #91045)

2024-05-03 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/91045 Fixes #90966. >From 2cc5ef7cca02578262795a7f7ea840d0a1496f74 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Fri, 3 May 2024 22:15:33 -0700 Subject: [PATCH] [clang-format] Don't remove parentheses of fold expressio

[clang] [Clang] Allow raw string literals in C as an extension (PR #88265)

2024-05-03 Thread Owen Pan via cfe-commits
@@ -3850,6 +3850,7 @@ LangOptions getFormattingLangOpts(const FormatStyle &Style) { // the sequence "<::" will be unconditionally treated as "[:". // Cf. Lexer::LexTokenInternal. LangOpts.Digraphs = LexingStd >= FormatStyle::LS_Cpp11; + LangOpts.RawStringLiterals = Lexi

[clang] [clang-format] Fix a crash with AlignArrayOfStructures option (PR #86420)

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

[clang] [clang-format] Fix a crash with AlignArrayOfStructures option (PR #86420)

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

[clang] [clang-format] Don't remove parentheses of fold expressions (PR #91045)

2024-05-04 Thread Owen Pan via cfe-commits
owenca wrote: > I wouldn't worry too much about this, but, pedantically, you can be sure it's > a fold expression if the ellipsis is followed with or preceded by an operator > > https://eel.is/c++draft/expr.prim.fold#nt:fold-operator I had thought of that but decided not to bother. From https

[clang] 9154a32 - [clang-format][doc] Fix typos

2024-05-05 Thread Owen Pan via cfe-commits
Author: Owen Pan Date: 2024-05-05T00:18:55-07:00 New Revision: 9154a324bfce5dee27cb04708bd250b030d6cdd2 URL: https://github.com/llvm/llvm-project/commit/9154a324bfce5dee27cb04708bd250b030d6cdd2 DIFF: https://github.com/llvm/llvm-project/commit/9154a324bfce5dee27cb04708bd250b030d6cdd2.diff LOG:

[clang] [clang-format] Handle Java switch expressions (PR #91112)

2024-05-05 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/91112 Also adds AllowShortCaseExpressionOnASingleLine option and AlignCaseArrows suboption of AlignConsecutiveShortCaseStatements. Fixes #55903. >From be8569c3721337317635a2f0640237a2d5acd73a Mon Sep 17 00:00:00 2001

[clang] [clang-format] Handle Java switch expressions (PR #91112)

2024-05-05 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/91112 >From be8569c3721337317635a2f0640237a2d5acd73a Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Sun, 5 May 2024 00:21:55 -0700 Subject: [PATCH 1/2] [clang-format] Handle Java switch expressions Also adds AllowShortC

[clang] [clang-format] Handle Java switch expressions (PR #91112)

2024-05-05 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/91112 >From 31a45ace7d828c63b31d0ba20ed07f2a0340c41d Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Sun, 5 May 2024 00:21:55 -0700 Subject: [PATCH] [clang-format] Handle Java switch expressions Also adds AllowShortCaseE

[clang] [clang-format] Handle Java switch expressions (PR #91112)

2024-05-05 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/91112 >From beab69244ce686a1d53342979d46f269a46c79de Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Sun, 5 May 2024 00:21:55 -0700 Subject: [PATCH] [clang-format] Handle Java switch expressions Also adds AllowShortCaseE

[clang] [clang-format] Don't allow comma in front of structural enum (PR #91056)

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

[clang] [clang-format] Don't remove parentheses of fold expressions (PR #91045)

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

[clang] [clang-format] Don't remove parentheses of fold expressions (PR #91045)

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

[clang] [clang-format] Don't remove parentheses of fold expressions (PR #91045)

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

[clang] [Clang] Allow raw string literals in C as an extension (PR #88265)

2024-05-06 Thread Owen Pan via cfe-commits
@@ -3850,6 +3850,7 @@ LangOptions getFormattingLangOpts(const FormatStyle &Style) { // the sequence "<::" will be unconditionally treated as "[:". // Cf. Lexer::LexTokenInternal. LangOpts.Digraphs = LexingStd >= FormatStyle::LS_Cpp11; + LangOpts.RawStringLiterals = Lexi

[clang] [clang-format] Handle Java switch expressions (PR #91112)

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

[clang] 6ce4c4c - [clang-format][NFC] Drop a redundant clang::format::

2024-05-10 Thread Owen Pan via cfe-commits
Author: Owen Pan Date: 2024-05-10T00:05:16-07:00 New Revision: 6ce4c4ca2bb846c2b8d64dc2b3d3496785c9edff URL: https://github.com/llvm/llvm-project/commit/6ce4c4ca2bb846c2b8d64dc2b3d3496785c9edff DIFF: https://github.com/llvm/llvm-project/commit/6ce4c4ca2bb846c2b8d64dc2b3d3496785c9edff.diff LOG:

[clang] [clang-format] Fix FormatToken::isSimpleTypeSpecifier() (PR #85564)

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

[clang] [clang-format] Fix FormatToken::isSimpleTypeSpecifier() (PR #91712)

2024-05-10 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/91712 Remove FormatToken::isSimpleTypeSpecifier() and call Token::isSimpleTypeSpecifier(LangOpts) instead. >From 3e0b10020d15c102e050ad3785622bef01d1c075 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Fri, 10 May 2024

[clang] [clang-format] Add option to remove leading blank lines (PR #91221)

2024-05-10 Thread Owen Pan via cfe-commits
owenca wrote: I think this is a good time to combine the `KeepEmptyLines...` options. For example: ``` KeepEmptyLines: AtStartOfBlock: true AtStartOfFile: false AtEndOfFile: true ``` https://github.com/llvm/llvm-project/pull/91221 ___ cfe-commit

[clang] [clang-format] Add option to remove leading blank lines (PR #91221)

2024-05-10 Thread Owen Pan via cfe-commits
owenca wrote: > Should I make dropping leading blank lines the default? We should keep leading blank lines (up to `MaxEmptyLinesToKeep`) by default as before. https://github.com/llvm/llvm-project/pull/91221 ___ cfe-commits mailing list cfe-commits@li

[clang] [clang-format] Add option to remove leading blank lines (PR #91221)

2024-05-10 Thread Owen Pan via cfe-commits
https://github.com/owenca requested changes to this pull request. See https://github.com/llvm/llvm-project/pull/91221#issuecomment-2105454428. https://github.com/llvm/llvm-project/pull/91221 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https

[clang] [clang-format] Fix FormatToken::isSimpleTypeSpecifier() (PR #91712)

2024-05-10 Thread Owen Pan via cfe-commits
owenca wrote: > I think this will stop people introducing extra arguments to function > > ...isCpp,isThis,isThat) I meant to fix the FIXME after I had langded a8279a8bc541, but my previous attempts didn't quite work. Now it seems this solution will stick. https://github.com/llvm/llvm-project/

[clang] [clang-format] Fix FormatToken::isSimpleTypeSpecifier() (PR #91712)

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

[clang] 5cd2804 - [clang-format] Move QualifierFixerTest::LangOpts to IsQualifierType test

2024-05-10 Thread Owen Pan via cfe-commits
Author: Owen Pan Date: 2024-05-10T23:14:58-07:00 New Revision: 5cd280433e8e063bf3c2390eaf152e726db5b0fb URL: https://github.com/llvm/llvm-project/commit/5cd280433e8e063bf3c2390eaf152e726db5b0fb DIFF: https://github.com/llvm/llvm-project/commit/5cd280433e8e063bf3c2390eaf152e726db5b0fb.diff LOG:

[clang] 0869204 - [clang-format] Fix buildbot failures

2024-05-11 Thread Owen Pan via cfe-commits
Author: Owen Pan Date: 2024-05-11T15:23:35-07:00 New Revision: 0869204cff22831d0bb19a82c99bf85e4deb4ae3 URL: https://github.com/llvm/llvm-project/commit/0869204cff22831d0bb19a82c99bf85e4deb4ae3 DIFF: https://github.com/llvm/llvm-project/commit/0869204cff22831d0bb19a82c99bf85e4deb4ae3.diff LOG:

[clang] 626025a - Revert "[clang-format] Fix buildbot failures"

2024-05-12 Thread Owen Pan via cfe-commits
Author: Owen Pan Date: 2024-05-12T18:35:35-07:00 New Revision: 626025ac7796b70cde9fc0fd4f688c3441949d04 URL: https://github.com/llvm/llvm-project/commit/626025ac7796b70cde9fc0fd4f688c3441949d04 DIFF: https://github.com/llvm/llvm-project/commit/626025ac7796b70cde9fc0fd4f688c3441949d04.diff LOG:

[clang] de641e2 - [clang-format] Fix buildbot failures

2024-05-12 Thread Owen Pan via cfe-commits
Author: Owen Pan Date: 2024-05-12T18:56:18-07:00 New Revision: de641e289269061f8bdb138bb5c50e27ef4b354f URL: https://github.com/llvm/llvm-project/commit/de641e289269061f8bdb138bb5c50e27ef4b354f DIFF: https://github.com/llvm/llvm-project/commit/de641e289269061f8bdb138bb5c50e27ef4b354f.diff LOG:

[clang] 1fadb2b - Revert "[clang-format] Fix FormatToken::isSimpleTypeSpecifier() (#91712)"

2024-05-12 Thread Owen Pan via cfe-commits
Author: Owen Pan Date: 2024-05-12T23:15:35-07:00 New Revision: 1fadb2b0c881ced247931f442fdee6c4ed96dccb URL: https://github.com/llvm/llvm-project/commit/1fadb2b0c881ced247931f442fdee6c4ed96dccb DIFF: https://github.com/llvm/llvm-project/commit/1fadb2b0c881ced247931f442fdee6c4ed96dccb.diff LOG:

[clang] [clang-format] Fix FormatToken::isSimpleTypeSpecifier() (PR #91712)

2024-05-12 Thread Owen Pan via cfe-commits
owenca wrote: @dyung I've reverted all relevant commits in commit 1fadb2b0c881ced247931f442fdee6c4ed96dccb. https://github.com/llvm/llvm-project/pull/91712 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/

[clang] [clang-format][NFC] Move LeftRightQualifierAlignmentFixer::is...() (PR #91930)

2024-05-13 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/91930 Move static member functions LeftRightQualifierAlignmentFixer::is...() out the class so that #91712 can reland. >From 6d346a4ec253110288a806fabde093678228184b Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Mon, 1

[clang] [clang-format][NFC] Move LeftRightQualifierAlignmentFixer::is...() (PR #91930)

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

[clang] [clang-format][NFC] Move LeftRightQualifierAlignmentFixer::is...() (PR #91930)

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

[clang] e20800c - [clang-format][NFC] Test IsQualifier only needs to call the lexer

2024-05-13 Thread Owen Pan via cfe-commits
Author: Owen Pan Date: 2024-05-13T19:45:11-07:00 New Revision: e20800c16f0570562fea31e9a02d65ba56e6858a URL: https://github.com/llvm/llvm-project/commit/e20800c16f0570562fea31e9a02d65ba56e6858a DIFF: https://github.com/llvm/llvm-project/commit/e20800c16f0570562fea31e9a02d65ba56e6858a.diff LOG:

[clang] 364f988 - Reland "[clang-format] Fix FormatToken::isSimpleTypeSpecifier() (#91712)"

2024-05-13 Thread Owen Pan via cfe-commits
Author: Owen Pan Date: 2024-05-13T21:54:23-07:00 New Revision: 364f988d3feb46ead8fdb657c9eab78d93425a28 URL: https://github.com/llvm/llvm-project/commit/364f988d3feb46ead8fdb657c9eab78d93425a28 DIFF: https://github.com/llvm/llvm-project/commit/364f988d3feb46ead8fdb657c9eab78d93425a28.diff LOG:

[clang] 72b2c37 - [clang-format][NFC] Clean up TokenAnnotator::mustBreakBefore()

2024-05-14 Thread Owen Pan via cfe-commits
Author: Owen Pan Date: 2024-05-14T20:31:53-07:00 New Revision: 72b2c37de6a4bbc2b2d2cda49293684b7cc71508 URL: https://github.com/llvm/llvm-project/commit/72b2c37de6a4bbc2b2d2cda49293684b7cc71508 DIFF: https://github.com/llvm/llvm-project/commit/72b2c37de6a4bbc2b2d2cda49293684b7cc71508.diff LOG:

[clang] [clang-format] Don't always break before << between string literals (PR #92214)

2024-05-14 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/92214 Instead, leave the line wrapping as is. Fixes #43887. Fixes #44363. >From 40eeb958cef55465fdcee66ab385928c1f202e50 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Tue, 14 May 2024 19:14:15 -0700 Subject: [PATCH] [

[clang] [clang-format] Don't always break before << between string literals (PR #92214)

2024-05-14 Thread Owen Pan via cfe-commits
owenca wrote: See also the discussion in https://reviews.llvm.org/D80950. https://github.com/llvm/llvm-project/pull/92214 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] b11a660 - [clang-format][NFC] Reformat with 18.1.5

2024-05-15 Thread Owen Pan via cfe-commits
Author: Owen Pan Date: 2024-05-15T21:04:46-07:00 New Revision: b11a6607cb6522c58dfbd5f54239e7daa281368e URL: https://github.com/llvm/llvm-project/commit/b11a6607cb6522c58dfbd5f54239e7daa281368e DIFF: https://github.com/llvm/llvm-project/commit/b11a6607cb6522c58dfbd5f54239e7daa281368e.diff LOG:

[clang] [clang-format] Don't always break before << between string literals (PR #92214)

2024-05-15 Thread Owen Pan via cfe-commits
owenca wrote: > This is interesting.. I like it in that its a "Leave" ... but part of me > would like this choice of default behind an option. As with the previous > changes in this area I'm uncomfortable about us changing how it behaves, but > would like the extra capability to choose.. I'm g

<    9   10   11   12   13   14   15   16   17   18   >