[clang] [clang-format] Handle .h files for LK_C and LK_ObjC (PR #141714)

2025-05-28 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/141714 >From 2d30adbd7bcce89c157e5b3eb517854cfbd35f48 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Tue, 27 May 2025 20:50:56 -0700 Subject: [PATCH] [clang-format] Handle .h files for LK_C and LK_ObjC Fix #137792 ---

[clang] [clang-format] Handle .h files for LK_C and LK_ObjC (PR #141714)

2025-05-27 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/141714 Fix #137792 >From 0afd41acb56fced29a7f8865b19cf2da95aaa26d Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Tue, 27 May 2025 20:50:56 -0700 Subject: [PATCH] [clang-format] Handle .h files for LK_C and LK_ObjC Fix

[clang] [Format] Use llvm::count_if (NFC) (PR #141518)

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

[clang] [clang-format] Handle Java text blocks (PR #141334)

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

[clang] [clang-format] Handle Java text blocks (PR #141334)

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

[clang] [clang-format] Handle Java text blocks (PR #141334)

2025-05-24 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/141334 >From 470eca4b4d963bf5c1ba87fb2f22620eb717c848 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Fri, 23 May 2025 23:21:12 -0700 Subject: [PATCH 1/2] [clang-format] Handle Java text blocks Fix #61954 --- clang/lib/

[clang] [clang-format] Handle Java text blocks (PR #141334)

2025-05-24 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/141334 >From 470eca4b4d963bf5c1ba87fb2f22620eb717c848 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Fri, 23 May 2025 23:21:12 -0700 Subject: [PATCH 1/2] [clang-format] Handle Java text blocks Fix #61954 --- clang/lib/

[clang] [clang-format] Handle Java text blocks (PR #141334)

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

[clang] [clang-format] Add IndentPPDirectives Leave option (PR #139750)

2025-05-23 Thread Owen Pan via cfe-commits
owenca wrote: Should `Leave` apply to the hash only or also to the name after the hash? https://github.com/llvm/llvm-project/pull/139750 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Handle Java text blocks (PR #141334)

2025-05-23 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/141334 Fix #61954 >From 470eca4b4d963bf5c1ba87fb2f22620eb717c848 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Fri, 23 May 2025 23:21:12 -0700 Subject: [PATCH] [clang-format] Handle Java text blocks Fix #61954 --- cl

[clang] [clang-format][NFC] FormatTokenLexer.cpp cleanup (PR #141202)

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

[clang] [clang-format][NFC] FormatTokenLexer.cpp cleanup (PR #141202)

2025-05-22 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/141202 None >From 9f6342e8d20ebb7a55f77385f57ada832a69e441 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Thu, 22 May 2025 23:27:29 -0700 Subject: [PATCH] [clang-format][NFC] FormatTokenLexer.cpp cleanup --- clang/lib

[clang] [clang-format] Handle raw string literals containing JSON code (PR #140666)

2025-05-21 Thread Owen Pan via cfe-commits
owenca wrote: /cherry-pick 0dfdf7efbfe347517eb4c7f544043a71af4e4a25 https://github.com/llvm/llvm-project/pull/140666 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Handle raw string literals containing JSON code (PR #140666)

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

[clang] [clang-format] Merge short inline function in macro definition body (PR #140366)

2025-05-21 Thread Owen Pan via cfe-commits
owenca wrote: /cherry-pick 6da2acf8e99ec517bfbe498af2519d29834e2583 https://github.com/llvm/llvm-project/pull/140366 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Merge short inline function in macro definition body (PR #140366)

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

[clang] [clang-format] Fix the indent of StartOfName after AttributeMacro (PR #140361)

2025-05-21 Thread Owen Pan via cfe-commits
owenca wrote: /cherry-pick 0cac25bcf5a246eb8a1f02d5041731ae9a6f00e0 https://github.com/llvm/llvm-project/pull/140361 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Fix the indent of StartOfName after AttributeMacro (PR #140361)

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

[clang] ClangFormat: Insert braces & newline for Chromium (PR #140888)

2025-05-21 Thread Owen Pan via cfe-commits
@@ -1892,6 +1892,9 @@ FormatStyle getChromiumStyle(FormatStyle::LanguageKind Language) { ChromiumStyle.IncludeStyle.IncludeBlocks = tooling::IncludeStyle::IBS_Preserve; + ChromiumStyle.InsertBraces = true; owenca wrote: See https://reviews.llvm.org/

[clang] ClangFormat: Insert braces & newline for Chromium (PR #140888)

2025-05-21 Thread Owen Pan via cfe-commits
@@ -5904,7 +5904,7 @@ TEST_F(FormatTest, MacrosWithoutTrailingSemicolon) { getLLVMStyleWithColumns(60)); verifyFormat("VISIT_GL_CALL(GenBuffers, void, (GLsizei n, GLuint* buffers), " - "(n, buffers))", + "(n, buffers))\n",

[clang] [clang-format][NFC] Minor efficiency cleanup (PR #140835)

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

[clang] [clang-format][NFC] Minor efficiency cleanup (PR #140835)

2025-05-20 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/140835 None >From ca6a78c3c078fca61fe5ae60566adc4bf17503d2 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Tue, 20 May 2025 19:45:15 -0700 Subject: [PATCH] [clang-format][NFC] Minor efficiency cleanup --- clang/lib/For

[clang] [clang-format] Handle raw string literals containing JSON code (PR #140666)

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

[clang] [clang-format] Handle raw string literals containing JSON code (PR #140666)

2025-05-20 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/140666 >From 7c1c0d2ca413503d81cd71e6a005a608cdec479d Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Mon, 19 May 2025 20:18:53 -0700 Subject: [PATCH 1/2] [clang-format] Handle raw string literals containing JSON code F

[clang] [clang-format] Handle raw string literals containing JSON code (PR #140666)

2025-05-19 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/140666 Fix #65400 >From 7c1c0d2ca413503d81cd71e6a005a608cdec479d Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Mon, 19 May 2025 20:18:53 -0700 Subject: [PATCH] [clang-format] Handle raw string literals containing JSON

[clang] 65400 (PR #140661)

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

[clang] 65400 (PR #140661)

2025-05-19 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/140661 None >From 186ac09017c78cbff5a34a5b8768b6df5b8d0546 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Sun, 18 May 2025 23:23:04 -0700 Subject: [PATCH 1/2] [clang-format][NFC] Upgrade SortIncludes option to a struct

[clang] [clang-format][NFC] Upgrade SortIncludes option to a struct (PR #140497)

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

[clang] [clang-format] Fix the indent of StartOfName after AttributeMacro (PR #140361)

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

[clang] [clang-format] Merge short inline function in macro definition body (PR #140366)

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

[clang] [clang-format][NFC] Upgrade SortIncludes option to a struct (PR #140497)

2025-05-18 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/140497 This allows adding other suboptions e.g. IgnoreExtension in #137840. >From 186ac09017c78cbff5a34a5b8768b6df5b8d0546 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Sun, 18 May 2025 23:23:04 -0700 Subject: [PATCH]

[clang] [clang-format] Merge short inline function in macro definition body (PR #140366)

2025-05-17 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/140366 Fix #62356 >From f8fb158f193d0064ca3c05c081f2f96d1f882c2c Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Sat, 17 May 2025 02:39:51 -0700 Subject: [PATCH] [clang-format] Merge short inline function in macro defin

[clang] [clang-format] Fix the indent of StartOfName after AttributeMacro (PR #140361)

2025-05-17 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/140361 >From 0b1d1c67566371290715daf8c02a48262ab624ad Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Fri, 16 May 2025 22:50:35 -0700 Subject: [PATCH] [clang-format] Fix the indent of StartOfName after AttributeMacro Fi

[clang] [clang-format] Fix the indent of StartOfName after AttributeMacro (PR #140361)

2025-05-17 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/140361 Fix #139510 >From f7528c42b4c1cce3a04722d2eadca3b81305cc5e Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Fri, 16 May 2025 22:50:35 -0700 Subject: [PATCH] [clang-format] Fix the indent of StartOfName after Attri

[clang] [git-clang-format] add fallback style argument option (PR #137609)

2025-05-14 Thread Owen Pan via cfe-commits
@@ -189,6 +189,13 @@ def main(): default=config.get("clangformat.style", None), help="passed to clang-format", ), +p.add_argument( owenca wrote: Please move this to just before `--force` to keep the options sorted. (We can also move `-

[clang] [clang-format] Add --fallback-style to git-clang-format (PR #137609)

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

[clang] [clang-format] Add `--fallback-style` to git-clang-format (PR #137609)

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

[clang] [git-clang-format] add fallback style argument option (PR #137609)

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

[clang] [git-clang-format] add fallback style argument option (PR #137609)

2025-05-14 Thread Owen Pan via cfe-commits
@@ -189,6 +189,13 @@ def main(): default=config.get("clangformat.style", None), help="passed to clang-format", ), +p.add_argument( +"--fallback-style", +help="The name of the predefined style used as a " +"fallback in case clang-f

[clang] clang-format: Add IncludeSortKey option (PR #137840)

2025-05-14 Thread Owen Pan via cfe-commits
@@ -3221,15 +3223,33 @@ static void sortCppIncludes(const FormatStyle &Style, stable_sort(Indices, [&](unsigned LHSI, unsigned RHSI) { const auto LHSFilenameLower = Includes[LHSI].Filename.lower(); const auto RHSFilenameLower = Includes[RHSI].Filename.lower(); -

[clang] clang-format: Add IncludeSortKey option (PR #137840)

2025-05-14 Thread Owen Pan via cfe-commits
@@ -3221,15 +3223,33 @@ static void sortCppIncludes(const FormatStyle &Style, stable_sort(Indices, [&](unsigned LHSI, unsigned RHSI) { const auto LHSFilenameLower = Includes[LHSI].Filename.lower(); const auto RHSFilenameLower = Includes[RHSI].Filename.lower(); -

[clang] clang-format: Add IncludeSortKey option (PR #137840)

2025-05-14 Thread Owen Pan via cfe-commits
@@ -3221,15 +3223,33 @@ static void sortCppIncludes(const FormatStyle &Style, stable_sort(Indices, [&](unsigned LHSI, unsigned RHSI) { const auto LHSFilenameLower = Includes[LHSI].Filename.lower(); const auto RHSFilenameLower = Includes[RHSI].Filename.lower(); -

[clang] clang-format: Add IncludeSortKey option (PR #137840)

2025-05-14 Thread Owen Pan via cfe-commits
@@ -4226,6 +4226,19 @@ the configuration (without a prefix: ``Auto``). ``ClassImpl.hpp`` would not have the main include file put on top before any other include. +.. _IncludeSortKey: + +**IncludeSortKey** (``IncludeSortKeyDiscriminator``) :versionbadge:`clang-format 20`

[clang] [llvm] [clang-format]: Add `Custom` to `ShortFunctionStyle`; add new AllowShortFunctionsOnASingleLineOptions for granular setup (PR #134337)

2025-05-13 Thread Owen Pan via cfe-commits
@@ -293,15 +293,14 @@ class LineJoiner { auto ShouldMergeShortFunctions = [this, &I, &NextLine, PreviousLine, TheLine]() { - if (Style.AllowShortFunctionsOnASingleLine == FormatStyle::SFS_All) + if (Style.AllowShortFunctionsO

[clang] [llvm] [clang-format]: Add `Custom` to `ShortFunctionStyle`; add new AllowShortFunctionsOnASingleLineOptions for granular setup (PR #134337)

2025-05-13 Thread Owen Pan via cfe-commits
@@ -619,20 +619,39 @@ TEST(ConfigParseTest, ParsesConfiguration) { CHECK_PARSE("AllowShortBlocksOnASingleLine: true", AllowShortBlocksOnASingleLine, FormatStyle::SBS_Always); - Style.AllowShortFunctionsOnASingleLine = FormatStyle::SFS_Inline; CHECK_PARSE("A

[clang] [llvm] [clang-format]: Add `Custom` to `ShortFunctionStyle`; add new AllowShortFunctionsOnASingleLineOptions for granular setup (PR #134337)

2025-05-13 Thread Owen Pan via cfe-commits
@@ -622,15 +622,38 @@ template <> struct ScalarEnumerationTraits { } }; -template <> struct ScalarEnumerationTraits { - static void enumeration(IO &IO, FormatStyle::ShortFunctionStyle &Value) { -IO.enumCase(Value, "None", FormatStyle::SFS_None); -IO.enumCase(Value,

[clang] [llvm] [clang-format]: Add `Custom` to `ShortFunctionStyle`; add new AllowShortFunctionsOnASingleLineOptions for granular setup (PR #134337)

2025-05-13 Thread Owen Pan via cfe-commits
@@ -1500,7 +1523,10 @@ FormatStyle getLLVMStyle(FormatStyle::LanguageKind Language) { LLVMStyle.AllowShortCaseLabelsOnASingleLine = false; LLVMStyle.AllowShortCompoundRequirementOnASingleLine = true; LLVMStyle.AllowShortEnumsOnASingleLine = true; - LLVMStyle.AllowShortF

[clang] [llvm] [clang-format]: Add `Custom` to `ShortFunctionStyle`; add new AllowShortFunctionsOnASingleLineOptions for granular setup (PR #134337)

2025-05-13 Thread Owen Pan via cfe-commits
@@ -73,3 +73,4 @@ pythonenv* /clang/utils/analyzer/projects/*/RefScanBuildResults # automodapi puts generated documentation files here. /lldb/docs/python_api/ +clang-build/ owenca wrote: Why this? https://github.com/llvm/llvm-project/pull/134337 _

[clang] clang-format: Add IncludeSortKey option (PR #137840)

2025-05-13 Thread Owen Pan via cfe-commits
owenca wrote: I would expect that file extensions be sorted regardless. For example: ``` #include "a.h" #include "a.inc" #include "a-util.def" #include "a-util.h" ``` https://github.com/llvm/llvm-project/pull/137840 ___ cfe-commits mailing list cfe-com

[clang] [clang-format]: Add `Custom` to `ShortFunctionStyle`; add new AllowShortFunctionsOnASingleLineOptions for granular setup (PR #134337)

2025-05-12 Thread Owen Pan via cfe-commits
@@ -291,54 +291,59 @@ class LineJoiner { auto ShouldMergeShortFunctions = [this, &I, &NextLine, PreviousLine, TheLine]() { - if (Style.AllowShortFunctionsOnASingleLine == FormatStyle::SFS_All) + if (Style.AllowShortFunctionsO

[clang] [clang-format]: Add `Custom` to `ShortFunctionStyle`; add new AllowShortFunctionsOnASingleLineOptions for granular setup (PR #134337)

2025-05-12 Thread Owen Pan via cfe-commits
@@ -5685,11 +5685,27 @@ bool TokenAnnotator::mustBreakBefore(const AnnotatedLine &Line, if (Right.is(tok::r_brace) && Left.is(tok::l_brace) && !Left.Children.empty()) { // Support AllowShortFunctionsOnASingleLine for JavaScript. - return Style.AllowShort

[clang] [clang-format]: Add `Custom` to `ShortFunctionStyle`; add new AllowShortFunctionsOnASingleLineOptions for granular setup (PR #134337)

2025-05-12 Thread Owen Pan via cfe-commits
https://github.com/owenca commented: If there are any new test cases including those for only `Other == true`, can you move them to a future patch? https://github.com/llvm/llvm-project/pull/134337 ___ cfe-commits mailing list cfe-commits@lists.llvm.or

[clang] [clang-format]: Add `Custom` to `ShortFunctionStyle`; add new AllowShortFunctionsOnASingleLineOptions for granular setup (PR #134337)

2025-05-12 Thread Owen Pan via cfe-commits
https://github.com/owenca edited https://github.com/llvm/llvm-project/pull/134337 ___ 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 binary operator && (PR #138633)

2025-05-10 Thread Owen Pan via cfe-commits
owenca wrote: > @owenca, I actually think that this introduced a regression that was > previously fixed in the nightly snapshot of `clang-format-21`. It was an incidental "fix" by 91328dbae986dfa93cf2acef0a93361fd5ced66d, which caused a regression that's fixed by this patch. > ``` > $ cat foo

[clang] [clang-format][NFC] Delete duplicates in CSharpExtraKeywords (PR #139199)

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

[clang] [clang-format] Handle Java record (PR #139215)

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

[clang] [clang-format] Handle Java record (PR #139215)

2025-05-09 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/139215 Fix #62089 Rate limit · GitHub body { background-color: #f6f8fa; color: #24292e; font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,A

[clang] [clang-format][NFC] Delete duplicates in CSharpExtraKeywords (PR #139199)

2025-05-08 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/139199 None >From 8ff5e366318162dc4e429abd8e41c339ba22ed41 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Thu, 8 May 2025 19:59:20 -0700 Subject: [PATCH] [clang-format][NFC] Delete duplicates in CSharpExtraKeywords ---

[clang] [clang-format] Handle C# where clause in SeparateDefinitionBlocks (PR #139034)

2025-05-08 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/139034 >From 11a3f6f44914e40b49f9ce00256724ce1fb82fa1 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Thu, 8 May 2025 00:12:44 -0700 Subject: [PATCH 1/2] [clang-format] Handle C# where clause in SeparateDefinitionBlocks

[clang] [clang-format] Handle C# where clause in SeparateDefinitionBlocks (PR #139034)

2025-05-08 Thread Owen Pan via cfe-commits
@@ -137,6 +137,12 @@ void DefinitionBlockSeparator::separateBlocks( const auto MayPrecedeDefinition = [&](const int Direction = -1) { assert(Direction >= -1); assert(Direction <= 1); + + if (Style.isCSharp() && + Lines[OpeningLineIndex]->First->is(

[clang] [clang-format] Handle C# where clause in SeparateDefinitionBlocks (PR #139034)

2025-05-08 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/139034 Fix #61956 >From 11a3f6f44914e40b49f9ce00256724ce1fb82fa1 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Thu, 8 May 2025 00:12:44 -0700 Subject: [PATCH] [clang-format] Handle C# where clause in SeparateDefinitio

[clang] [clang-format] Add SpaceAfterOperatorKeyword option (PR #137610)

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

[clang] [clang-format] Correctly annotate ObjC `* __autoreleasing *` (PR #138799)

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

[clang] [clang-format] Correctly annotate ObjC `* __autoreleasing *` (PR #138799)

2025-05-06 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/138799 Fix #138484 >From ec9f832cedf7abd4d90d8cf3dca45ee128b922a9 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Tue, 6 May 2025 20:13:26 -0700 Subject: [PATCH] [clang-format] Correctly annotate ObjC `* __autoreleasing

[clang] [clang][NFC] Regroup declarations in `Parser` (PR #138511)

2025-05-06 Thread Owen Pan via cfe-commits
owenca wrote: > > 3. File has been formatted with clang-format, except for the grammar, > > because clang-format butchers it. > > Yeah, this problem comes up rather frequently, I wonder if clang-format can > get some additional smarts to make that less of a challenge? CC > @mydeveloperday @ow

[clang] [clang-format] Add SpaceAfterOperatorKeyword option (PR #137610)

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

[clang] [clang-format] Don't annotate enum colon as InheritanceColon (PR #138440)

2025-05-05 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/138440 >From 90803c382ecb040e016034d5798d739739ece03a Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Sat, 3 May 2025 23:38:18 -0700 Subject: [PATCH 1/4] [clang-format] Don't annotate enum colon as InheritanceColon Fix

[clang] [clang-format] Don't annotate enum colon as InheritanceColon (PR #138440)

2025-05-05 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/138440 >From 90803c382ecb040e016034d5798d739739ece03a Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Sat, 3 May 2025 23:38:18 -0700 Subject: [PATCH 1/3] [clang-format] Don't annotate enum colon as InheritanceColon Fix

[clang] [clang-format] Fix a bug in annotating binary operator && (PR #138633)

2025-05-05 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/138633 Fix #138485 >From e72f081f3a1f06ec9e868042cbe7db0a3c18796d Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Mon, 5 May 2025 22:35:40 -0700 Subject: [PATCH] [clang-format] Fix a bug in annotating binary operator &&

[clang] [clang-format] Correctly annotate C# nullable value type `?` (PR #138631)

2025-05-05 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/138631 Fix #78666 Rate limit · GitHub body { background-color: #f6f8fa; color: #24292e; font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,A

[clang] [clang-format] Don't annotate enum colon as InheritanceColon (PR #138440)

2025-05-05 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/138440 >From 90803c382ecb040e016034d5798d739739ece03a Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Sat, 3 May 2025 23:38:18 -0700 Subject: [PATCH 1/2] [clang-format] Don't annotate enum colon as InheritanceColon Fix

[clang] [clang-format] Don't annotate enum colon as InheritanceColon (PR #138440)

2025-05-03 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/138440 Fix #61156 >From 90803c382ecb040e016034d5798d739739ece03a Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Sat, 3 May 2025 23:38:18 -0700 Subject: [PATCH] [clang-format] Don't annotate enum colon as InheritanceColo

[clang] [clang-format] Correctly annotate tok::star in braced list (PR #138389)

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

[clang] [clang-format] Correctly annotate tok::star in braced list (PR #138389)

2025-05-03 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/138389 Fix #138382 >From 36e7e2002439dcdb084e949a265a280551597800 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Sat, 3 May 2025 01:21:03 -0700 Subject: [PATCH] [clang-format] Correctly annotate tok::star in braced list

[clang] [clang-format] RemoveParentheses shouldn't remove empty parentheses (PR #138229)

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

[clang] [clang-format] RemoveParentheses shouldn't remove empty parentheses (PR #138229)

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

[clang] [clang-format] RemoveParentheses shouldn't remove empty parentheses (PR #138229)

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

[clang] [clang-format] RemoveParentheses shouldn't remove empty parentheses (PR #138229)

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

[clang] [clang-format] RemoveParentheses shouldn't remove empty parentheses (PR #138229)

2025-05-02 Thread Owen Pan via cfe-commits
https://github.com/owenca milestoned https://github.com/llvm/llvm-project/pull/138229 ___ 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 on formatting missing r_paren/r_brace (PR #138230)

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

[clang] [clang-format] RemoveParentheses shouldn't remove empty parentheses (PR #138229)

2025-05-02 Thread Owen Pan via cfe-commits
https://github.com/owenca closed https://github.com/llvm/llvm-project/pull/138229 ___ 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 on formatting missing r_paren/r_brace (PR #138230)

2025-05-01 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/138230 Fix #138097 >From 3c10436ed455de5c2046b259c0c75744a75e1e4a Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Thu, 1 May 2025 21:20:34 -0700 Subject: [PATCH] [clang-format] Fix a crash on formatting missing r_paren/

[clang] [clang-format] RemoveParentheses shouldn't remove empty parentheses (PR #138229)

2025-05-01 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/138229 Fix #138124 >From 9ba504b25f9afa79a155004c635d618a141c8c39 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Thu, 1 May 2025 21:07:39 -0700 Subject: [PATCH] [clang-format] RemoveParentheses shouldn't remove empty p

[clang] [clang] Merge gtest binaries into AllClangUnitTests (PR #134196)

2025-05-01 Thread Owen Pan via cfe-commits
owenca wrote: @rnk see https://github.com/llvm/llvm-project/pull/137577#issuecomment-2843963228 for some of the bots that got the assertion failure. > Update: Back to normal after > [afd738c](https://github.com/llvm/llvm-project/commit/afd738cd9016ddef4e26b309770ba35fd017a178). I meant the

[clang] [clang-format] Add AlignAfterOpenBracketOptions (PR #108332)

2025-05-01 Thread Owen Pan via cfe-commits
https://github.com/owenca commented: You need to run `ninja clang-format-style` to update the documentation. https://github.com/llvm/llvm-project/pull/108332 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman

[clang] [clang-format] Add AlignAfterOpenBracketOptions (PR #108332)

2025-05-01 Thread Owen Pan via cfe-commits
owenca wrote: > > > > I prefer that we limit this to breaking after the left parenthesis of a > > > > control statement, with true/false or Always, Never, Multiline, > > > > BlockIndent, etc. > > > > > > > > > if I understand you correctly, you would like a new style option added > > > for s

[clang] [git-clang-format] add fallback style argument option (PR #137609)

2025-05-01 Thread Owen Pan via cfe-commits
owenca wrote: Please add a description so that we'll understand why you need this new option. https://github.com/llvm/llvm-project/pull/137609 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-c

[clang] [clang-format] Add AlignAfterOpenBracketOptions (PR #108332)

2025-05-01 Thread Owen Pan via cfe-commits
@@ -9694,6 +9694,304 @@ TEST_F(FormatTest, ParenthesesAndOperandAlignment) { Style); } +TEST_F(FormatTest, AlignAfterConditionalStatements) { owenca wrote: ```suggestion TEST_F(FormatTest, AlignAfterControlStatements) { ``` Can you move this to

[clang] clang-format: Sort includes by stem rather than full filename (PR #137840)

2025-05-01 Thread Owen Pan via cfe-commits
owenca wrote: IMO, unless it's a bug, we need a new option to ensure it's a non-breaking change. https://github.com/llvm/llvm-project/pull/137840 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/c

[clang] [clang-format] Add ApplyAlwaysOnePerLineToTemplateArguments option (PR #137544)

2025-05-01 Thread Owen Pan via cfe-commits
owenca wrote: I don't like new options for bug fixes. WDYT @mydeveloperday? https://github.com/llvm/llvm-project/pull/137544 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Add AlignAfterOpenBracketOptions (PR #108332)

2025-05-01 Thread Owen Pan via cfe-commits
@@ -62,6 +62,22 @@ struct FormatStyle { /// \version 3.3 int AccessModifierOffset; + /// Different styles for breaking the parenthesis after a control statement + /// (``if/switch/while/for ...``). + /// \version 21 + enum BreakAfterControlStatementStyle : int8_t { +

[clang] [clang-format] Add AlignAfterOpenBracketOptions (PR #108332)

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

[clang] [clang-format] Add AlignAfterOpenBracketOptions (PR #108332)

2025-04-30 Thread Owen Pan via cfe-commits
owenca wrote: > When I updated, my build target for `FormatTests` stopped working. > > ``` > ninja -C build clang-format FormatTests > ninja: Entering directory `build' > ninja: error: unknown target 'FormatTests' > ``` > > I'm trying to figure out what changed or how to modify my workflow. I t

[clang] [clang-format] Correctly annotate user-defined conversion function call (PR #137914)

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

[clang] 8effc8d - Reland [clang-format] Add OneLineFormatOffRegex option (#137577)

2025-04-30 Thread Owen Pan via cfe-commits
Author: Owen Pan Date: 2025-04-30T19:58:59-07:00 New Revision: 8effc8da292bfacb823a7e3c4134296da481fedc URL: https://github.com/llvm/llvm-project/commit/8effc8da292bfacb823a7e3c4134296da481fedc DIFF: https://github.com/llvm/llvm-project/commit/8effc8da292bfacb823a7e3c4134296da481fedc.diff LOG:

[clang] [clang-format] Add OneLineFormatOffRegex option (PR #137577)

2025-04-30 Thread Owen Pan via cfe-commits
owenca wrote: > > @dyung I don't see anything in this patch could cause a failure in CodGen > > tests. Have you verified it e.g. by running the tests on > > [f175030](https://github.com/llvm/llvm-project/commit/f1750300aad0e49383cd4b206e2354f1300a40a8)? > > It seems several of the listed faili

[clang] [clang-format] Add SpaceAfterOperatorKeyword option (PR #137610)

2025-04-30 Thread Owen Pan via cfe-commits
https://github.com/owenca commented: Please also update the release notes. https://github.com/llvm/llvm-project/pull/137610 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Add SpaceAfterOperatorKeyword option (PR #137610)

2025-04-30 Thread Owen Pan via cfe-commits
@@ -17630,6 +17630,10 @@ TEST_F(FormatTest, ConfigurableSpaceBeforeParens) { verifyFormat("int x = int (y);", SomeSpace2); verifyFormat("auto lambda = []() { return 0; };", SomeSpace2); + FormatStyle SpaceAfterOperatorKeyword = getLLVMStyle(); + SpaceAfterOperatorKeyword

[clang] [clang-format] Add SpaceAfterOperatorKeyword option (PR #137610)

2025-04-30 Thread Owen Pan via cfe-commits
@@ -4463,6 +4463,14 @@ struct FormatStyle { /// \version 9 bool SpaceAfterLogicalNot; + /// If \c true, a space will be inserted after the ``operator`` keyword. + /// \code + ///true:false: + ///bool operator == (int a) vs.

[clang] [clang-format] Add SpaceAfterOperatorKeyword option (PR #137610)

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

  1   2   3   4   5   6   7   8   9   10   >