[clang] [clang-format] Optimize processing .clang-format-ignore files (PR #76733)

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

[clang] [clang-format] Optimize processing .clang-format-ignore files (PR #76733)

2024-01-04 Thread Owen Pan via cfe-commits
owenca wrote: It had passed my local tests (x64 Native Tools Command Prompt for VS 2022) and the buildkite win build, so I wonder if it has something to do with the grep in the failed buildbot (only https://lab.llvm.org/buildbot/#/builders/123/builds/23808 so far) as I only used the POSIX opt

[clang] [clang-format] Add .clang-format-ignore for ignoring files (PR #76327)

2024-01-04 Thread Owen Pan via cfe-commits
owenca wrote: Actually, it's commit 42ec976184ac. Please see [here](https://github.com/llvm/llvm-project/pull/76733#issuecomment-1876707005). https://github.com/llvm/llvm-project/pull/76327 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https

[clang] [clang-format] Fix crash involving array designators and dangling comma (PR #77045)

2024-01-05 Thread Owen Pan via cfe-commits
@@ -21084,6 +21084,12 @@ TEST_F(FormatTest, CatchAlignArrayOfStructuresLeftAlignment) { "};", Style); + verifyNoCrash("Foo f[] = {\n" +"[0] = { 1, },\n" +"[1] { 1, },\n" +"};", +Style); -

[clang] [clang-format] Fix crash involving array designators and dangling comma (PR #77045)

2024-01-05 Thread Owen Pan via cfe-commits
@@ -1444,7 +1444,8 @@ WhitespaceManager::CellDescriptions WhitespaceManager::getCells(unsigned Start, } else if (C.Tok->is(tok::comma)) { if (!Cells.empty()) Cells.back().EndIndex = i; -if (C.Tok->getNextNonComment()->isNot(tok::r_brace)) // dan

[clang] [clang-format] Break after string literals with trailing line breaks (PR #76795)

2024-01-05 Thread Owen Pan via cfe-commits
@@ -5151,6 +5151,14 @@ bool TokenAnnotator::mustBreakBefore(const AnnotatedLine &Line, return true; if (Left.IsUnterminatedLiteral) return true; + // FIXME: Breaking after newlines seems useful in general. Turn this into an + // option and Recognize more cases like

[clang] [clang-format] Break after string literals with trailing line breaks (PR #76795)

2024-01-05 Thread Owen Pan via cfe-commits
@@ -2499,6 +2499,15 @@ TEST_F(TokenAnnotatorTest, BraceKind) { EXPECT_BRACE_KIND(Tokens[6], BK_Block); } +TEST_F(TokenAnnotatorTest, StreamOperator) { + auto Tokens = annotate("\"foo\\n\" << aux << \"foo\\n\" << \"foo\";"); + ASSERT_EQ(Tokens.size(), 9u) << Tokens; + EXPE

patch for formatter bug 38525

2018-08-10 Thread Owen Pan via cfe-commits
Hi, Please see the attached patch file and test case for Bug 38525 in Formatter. Thanks, Owen Index: lib/Format/ContinuationIndenter.cpp === --- lib/Format/ContinuationIndenter.cpp (revis

Fwd: patch file for bug 38557

2018-08-14 Thread Owen Pan via cfe-commits
Hi, Attached is the patch file for Bug 38557 ( https://bugs.llvm.org/show_bug.cgi?id=38557). Thanks, Owen Index: UnwrappedLineParser.cpp === --- UnwrappedLineParser.cpp (revision 339102) +++ UnwrappedLineParser.cpp (working copy) @@

Re: Fwd: patch file for bug 38557

2018-08-14 Thread Owen Pan via cfe-commits
t you can take over, otherwise we can > get it into trunk for you :) > > All the best, Jonas > > Am 14.08.2018 um 12:30 schrieb Owen Pan via cfe-commits: > > Hi, > > Attached is the patch file for Bug 38557 ( > h

[clang] [clang-format][NFC] Make LangOpts global in namespace Format (PR #81390)

2024-02-10 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/81390 None >From 37a6723b2c9b95c0556ca53992192795e74c27ce Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Sat, 10 Feb 2024 17:14:19 -0800 Subject: [PATCH] [clang-format][NFC] Make LangOpts global in namespace Format ---

[clang] [clang-format][NFC] Make LangOpts global in namespace Format (PR #81390)

2024-02-10 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/81390 >From 37a6723b2c9b95c0556ca53992192795e74c27ce Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Sat, 10 Feb 2024 17:14:19 -0800 Subject: [PATCH 1/2] [clang-format][NFC] Make LangOpts global in namespace Format ---

[clang] [clang-format][NFC] Make LangOpts global in namespace Format (PR #81390)

2024-02-10 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/81390 >From 37a6723b2c9b95c0556ca53992192795e74c27ce Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Sat, 10 Feb 2024 17:14:19 -0800 Subject: [PATCH 1/3] [clang-format][NFC] Make LangOpts global in namespace Format ---

[clang] 5aec939 - [clang-format][NFC] Keep Operator== sorted in Format.h

2024-02-11 Thread Owen Pan via cfe-commits
Author: Owen Pan Date: 2024-02-11T02:15:57-08:00 New Revision: 5aec9392674572fa5a06283173a6a739742d261d URL: https://github.com/llvm/llvm-project/commit/5aec9392674572fa5a06283173a6a739742d261d DIFF: https://github.com/llvm/llvm-project/commit/5aec9392674572fa5a06283173a6a739742d261d.diff LOG:

[clang] [clang-format][NFC] Make LangOpts global in namespace Format (PR #81390)

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

[clang] 3dc8ef6 - Revert "[clang-format][NFC] Make LangOpts global in namespace Format (#81390)"

2024-02-11 Thread Owen Pan via cfe-commits
Author: Owen Pan Date: 2024-02-11T13:08:28-08:00 New Revision: 3dc8ef677d7d05116a0bf6524eb38b02ca6ba042 URL: https://github.com/llvm/llvm-project/commit/3dc8ef677d7d05116a0bf6524eb38b02ca6ba042 DIFF: https://github.com/llvm/llvm-project/commit/3dc8ef677d7d05116a0bf6524eb38b02ca6ba042.diff LOG:

[clang] 32e65b0 - Reland "[clang-format][NFC] Make LangOpts global in namespace Format (#81390)"

2024-02-11 Thread Owen Pan via cfe-commits
Author: Owen Pan Date: 2024-02-11T22:01:23-08:00 New Revision: 32e65b0b8a743678974c7ca7913c1d6c41bb0772 URL: https://github.com/llvm/llvm-project/commit/32e65b0b8a743678974c7ca7913c1d6c41bb0772 DIFF: https://github.com/llvm/llvm-project/commit/32e65b0b8a743678974c7ca7913c1d6c41bb0772.diff LOG:

[clang] 0091893 - [clang-format] Undo the change to TestLexer() in commit 32e65b0b8a74

2024-02-11 Thread Owen Pan via cfe-commits
Author: Owen Pan Date: 2024-02-11T22:51:18-08:00 New Revision: 00918933fc4e181fe3c74006d81d7a598c2227b3 URL: https://github.com/llvm/llvm-project/commit/00918933fc4e181fe3c74006d81d7a598c2227b3 DIFF: https://github.com/llvm/llvm-project/commit/00918933fc4e181fe3c74006d81d7a598c2227b3.diff LOG:

[clang] [clang-format] Don't remove parentheses in macro definitions (PR #81444)

2024-02-11 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/81444 Closes #81399. >From 9d91878e9cb65ab67de8251976ee748ed03fc2b6 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Sun, 11 Feb 2024 23:28:25 -0800 Subject: [PATCH] [clang-format] Don't remove parentheses in macro defini

[clang] f5d71b7 - Reland "[clang-format][NFC] Make LangOpts global in namespace Format (#81390)"

2024-02-12 Thread Owen Pan via cfe-commits
Author: Owen Pan Date: 2024-02-12T00:04:34-08:00 New Revision: f5d71b79fe978f1e70f4a41adfd15f65dec6e210 URL: https://github.com/llvm/llvm-project/commit/f5d71b79fe978f1e70f4a41adfd15f65dec6e210 DIFF: https://github.com/llvm/llvm-project/commit/f5d71b79fe978f1e70f4a41adfd15f65dec6e210.diff LOG:

[clang] 33108fa - Reverted due to wrong commit message

2024-02-12 Thread Owen Pan via cfe-commits
Author: Owen Pan Date: 2024-02-12T00:07:47-08:00 New Revision: 33108fae9020cb49577fc3ee0aed219cc581f82a URL: https://github.com/llvm/llvm-project/commit/33108fae9020cb49577fc3ee0aed219cc581f82a DIFF: https://github.com/llvm/llvm-project/commit/33108fae9020cb49577fc3ee0aed219cc581f82a.diff LOG:

[clang] 7f40c5c - Reland "[clang-format] Update FormatToken::isSimpleTypeSpecifier() (#80241)"

2024-02-12 Thread Owen Pan via cfe-commits
Author: Owen Pan Date: 2024-02-12T00:10:24-08:00 New Revision: 7f40c5cc4e15a0a67b031f13370afc342a5dc14b URL: https://github.com/llvm/llvm-project/commit/7f40c5cc4e15a0a67b031f13370afc342a5dc14b DIFF: https://github.com/llvm/llvm-project/commit/7f40c5cc4e15a0a67b031f13370afc342a5dc14b.diff LOG:

[clang] [clang-format] Rename option AlwaysBreakAfterReturnType. (PR #80827)

2024-02-12 Thread Owen Pan via cfe-commits
@@ -677,6 +677,23 @@ TEST(ConfigParseTest, ParsesConfiguration) { " AfterControlStatement: false", BraceWrapping.AfterControlStatement, FormatStyle::BWACS_Never); + Style.AlwaysBreakAfterReturnType = FormatStyle::RTBS_All; + CHECK_PARSE("BreakAft

[clang] [clang-format] Don't remove parentheses in macro definitions (PR #81444)

2024-02-12 Thread Owen Pan via cfe-commits
https://github.com/owenca closed https://github.com/llvm/llvm-project/pull/81444 ___ 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 in macro definitions (PR #81444)

2024-02-12 Thread Owen Pan via cfe-commits
https://github.com/owenca milestoned https://github.com/llvm/llvm-project/pull/81444 ___ 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 in macro definitions (PR #81444)

2024-02-12 Thread Owen Pan via cfe-commits
owenca wrote: /cherry-pick 4af24d4ab765 https://github.com/llvm/llvm-project/pull/81444 ___ 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 in macro definitions (PR #81444)

2024-02-12 Thread Owen Pan via cfe-commits
owenca wrote: > Any hope that this lands in 18.1? Thanks anyway! Most likely. https://github.com/llvm/llvm-project/pull/81444 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Rename option AlwaysBreakAfterReturnType. (PR #80827)

2024-02-12 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/80827 >From 3c3e167711dccfcc0a56c5b465b20c17854451a4 Mon Sep 17 00:00:00 2001 From: rmarker Date: Tue, 6 Feb 2024 21:53:20 +1030 Subject: [PATCH 1/2] [clang-format] Rename option AlwaysBreakAfterReturnType. --- clang/

[clang] [clang-format] Rename option AlwaysBreakAfterReturnType. (PR #80827)

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

[clang] [clang-format] Rename option AlwaysBreakAfterReturnType. (PR #80827)

2024-02-12 Thread Owen Pan via cfe-commits
owenca wrote: Feel free to open another PR if you're interested. 🙂 https://github.com/llvm/llvm-project/pull/80827 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Always insert a space between #if and l_paren (PR #81578)

2024-02-13 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/81578 Fixes #81569. >From 2292ccb78839a90a15215b11c473fcbfc47aa00c Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Tue, 13 Feb 2024 00:03:19 -0800 Subject: [PATCH] [clang-format] Always insert a space between #if and l_p

[clang] [clang-format] Always insert a space between #if and l_paren (PR #81578)

2024-02-13 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/81578 >From 02d2d44046a4cf6ca8c5bb1897b6677c01d81974 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Tue, 13 Feb 2024 00:03:19 -0800 Subject: [PATCH] [clang-format] Always add a space after #if and #elif Fixes #81569. --

[clang] [clang-format] Always add a space after #if and #elif (PR #81578)

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

[clang] 61c83e9 - Revert "[clang-format][NFC] Make LangOpts global in namespace Format"

2024-02-13 Thread Owen Pan via cfe-commits
Author: Owen Pan Date: 2024-02-13T21:02:14-08:00 New Revision: 61c83e9491b2be71a54b255cdb11f65365245953 URL: https://github.com/llvm/llvm-project/commit/61c83e9491b2be71a54b255cdb11f65365245953 DIFF: https://github.com/llvm/llvm-project/commit/61c83e9491b2be71a54b255cdb11f65365245953.diff LOG:

[clang] [clang-format] Always add a space after #if and #elif (PR #81578)

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

[clang] [clang-format][NFC] Drop "Always" in "AlwaysBreakAfterReturnType". (PR #81591)

2024-02-13 Thread Owen Pan via cfe-commits
@@ -1871,10 +1869,10 @@ FormatStyle getWebKitStyle() { FormatStyle getGNUStyle() { FormatStyle Style = getLLVMStyle(); Style.AlwaysBreakAfterDefinitionReturnType = FormatStyle::DRTBS_All; - Style.AlwaysBreakAfterReturnType = FormatStyle::RTBS_AllDefinitions; Style.Break

[clang] [clang-format][NFC] Drop "Always" in "AlwaysBreakAfterReturnType". (PR #81591)

2024-02-13 Thread Owen Pan via cfe-commits
@@ -1130,14 +1129,13 @@ template <> struct MappingTraits { // AlwaysBreakAfterReturnType was not, initialize the latter from the // former for backwards compatibility. owenca wrote: ```suggestion // BreakAfterReturnType was not, initialize the latte

[clang] [clang-format][NFC] Drop "Always" in "AlwaysBreakAfterReturnType". (PR #81591)

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

[clang] [clang-format][NFC] Drop "Always" in "AlwaysBreakAfterReturnType". (PR #81591)

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

[clang] 6087d7b - [clang-format][NFC] Sort options in Format.cpp

2024-02-14 Thread Owen Pan via cfe-commits
Author: Owen Pan Date: 2024-02-14T21:40:07-08:00 New Revision: 6087d7bc0a9d7d4ad2c94a131c2bc427b767c9d7 URL: https://github.com/llvm/llvm-project/commit/6087d7bc0a9d7d4ad2c94a131c2bc427b767c9d7 DIFF: https://github.com/llvm/llvm-project/commit/6087d7bc0a9d7d4ad2c94a131c2bc427b767c9d7.diff LOG:

[clang] [clang-format] Don't sort qualifiers across preprocessor directives (PR #81958)

2024-02-15 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/81958 Fixes #80579. >From 13614f5760a26ba6134abdd555176a1aa2ed3974 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Thu, 15 Feb 2024 17:37:44 -0800 Subject: [PATCH] [clang-format] Don't sort qualifiers across preprocessor

[clang] 92ef408 - [clang-format] Delete a redundant newline at the end of a test case

2024-02-16 Thread Owen Pan via cfe-commits
Author: Owen Pan Date: 2024-02-16T01:47:49-08:00 New Revision: 92ef40874d58d4fca4b7657c31ab2538e1301f26 URL: https://github.com/llvm/llvm-project/commit/92ef40874d58d4fca4b7657c31ab2538e1301f26 DIFF: https://github.com/llvm/llvm-project/commit/92ef40874d58d4fca4b7657c31ab2538e1301f26.diff LOG:

[clang] [clang-format] Fix AllowShortLambdasOnASingleLine interfering with lambda brace wrapping. (PR #81848)

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

[clang] [clang-format] Fix AllowShortLambdasOnASingleLine interfering with lambda brace wrapping. (PR #81848)

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

[clang] [clang-format] Fix AllowShortLambdasOnASingleLine interfering with lambda brace wrapping. (PR #81848)

2024-02-16 Thread Owen Pan via cfe-commits
@@ -22893,6 +22893,19 @@ TEST_F(FormatTest, FormatsLambdas) { LLVMWithBeforeLambdaBody); verifyFormat("FctWithTwoParams_SLS_All([]() { return 43; }, 87);", LLVMWithBeforeLambdaBody); + verifyFormat( + "FctWithTwoParams_SLS_All(\n" + "

[clang] [clang-format] Don't sort qualifiers across preprocessor directives (PR #81958)

2024-02-16 Thread Owen Pan via cfe-commits
owenca wrote: > LGTM, as long as someone doesn't say it should be > > ```c++ > #if FOO >constexpr > #endif >inline >int i = 0; > ``` > > but I think this change is fine..I would rather we didn't try and support > that.. thank you. Yep! Otherwise, you would have to handle the follo

[clang] [clang-format] Don't sort qualifiers across preprocessor directives (PR #81958)

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

[clang] [polly] [clang-format] Correctly annotate block braces of empty ctors/dtors (PR #82097)

2024-02-16 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/82097 Also reformat polly. Fixes #79834. >From f02c1acefe642065cae01ced98b168ce33b98d47 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Fri, 16 Feb 2024 23:27:12 -0800 Subject: [PATCH] [clang-format] Correctly annotate

[clang] [polly] [clang-format] Correctly annotate block braces of empty ctors/dtors (PR #82097)

2024-02-16 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/82097 >From f02c1acefe642065cae01ced98b168ce33b98d47 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Fri, 16 Feb 2024 23:27:12 -0800 Subject: [PATCH 1/2] [clang-format] Correctly annotate block braces of empty ctors/dtor

[clang] [polly] [clang-format] Correctly annotate block braces of empty ctors/dtors (PR #82097)

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

[clang] [clang-format] Fix RemoveSemicolon for empty ctors/dtors (PR #82278)

2024-02-19 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/82278 Fixes #79833. >From 4bcf6dba8b97096801be550c4a8d1626ed57e475 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Mon, 19 Feb 2024 13:11:29 -0800 Subject: [PATCH] [clang-format] Fix RemoveSemicolon for empty ctors/dtors

[clang] [clang-format] Fix RemoveSemicolon for empty functions (PR #82278)

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

[clang] [clang-format] Fix AllowShortLambdasOnASingleLine interfering with lambda brace wrapping. (PR #81848)

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

[clang] 119a728 - [clang-format][NFC] Remove redundant calls to guessIsObjC()

2024-02-20 Thread Owen Pan via cfe-commits
Author: Owen Pan Date: 2024-02-20T00:28:26-08:00 New Revision: 119a72866f0e143127355fe6e03f57c4f8bab1ae URL: https://github.com/llvm/llvm-project/commit/119a72866f0e143127355fe6e03f57c4f8bab1ae DIFF: https://github.com/llvm/llvm-project/commit/119a72866f0e143127355fe6e03f57c4f8bab1ae.diff LOG:

[clang] [clang-format] Limit how much work guessLanguage() can do (PR #78925)

2024-02-20 Thread Owen Pan via cfe-commits
owenca wrote: > > couldn't we just use the .clang-format-ignore file to say... hey don't > > bother with this file, we can't do it... > > I think that's a good solution for avoiding the OOM when actually trying to > format the file, in combination with this patch for avoiding the OOM in > `gu

[clang] [clang-format][NFC] Eliminate the IsCpp parameter in all functions (PR #84599)

2024-03-13 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/84599 >From 43238d58ff490073c13ff621faddceb89b05b22e Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Fri, 8 Mar 2024 19:47:54 -0800 Subject: [PATCH 1/2] [clang-format][NFC] Eliminate the IsCpp parameter in all functions

[clang] [clang-format][NFC] Eliminate the IsCpp parameter in all functions (PR #84599)

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

[clang] c3a1eb6 - Reland [clang-format][NFC] Eliminate the IsCpp parameter in all functions (#84599)

2024-03-14 Thread Owen Pan via cfe-commits
Author: Owen Pan Date: 2024-03-14T19:44:40-07:00 New Revision: c3a1eb6207d85cb37ea29306481b40c9f6402309 URL: https://github.com/llvm/llvm-project/commit/c3a1eb6207d85cb37ea29306481b40c9f6402309 DIFF: https://github.com/llvm/llvm-project/commit/c3a1eb6207d85cb37ea29306481b40c9f6402309.diff LOG:

[clang] [clang-format] Add --fail-on-incomplete-format. (PR #84346)

2024-03-14 Thread Owen Pan via cfe-commits
owenca wrote: Can you add lit test cases? https://github.com/llvm/llvm-project/pull/84346 ___ 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 FunctionDeclarationName (PR #85361)

2024-03-14 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/85361 A name is not a FunctionDeclarationName if it's preceded by an Objective-C keyword. >From fa46932f5f0c0281d75907a3da795b2f343a8e70 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Thu, 14 Mar 2024 20:16:39 -0700 Su

[clang] [clang-format] Fix a bug in annotating FunctionDeclarationName (PR #85361)

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

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

[clang] 426e694 - [clang-format][NFC] Delete redundant and extraneous #include lines

2024-03-15 Thread Owen Pan via cfe-commits
Author: Owen Pan Date: 2024-03-15T20:51:57-07:00 New Revision: 426e6945897afbec01c042bec4771522a2aac176 URL: https://github.com/llvm/llvm-project/commit/426e6945897afbec01c042bec4771522a2aac176 DIFF: https://github.com/llvm/llvm-project/commit/426e6945897afbec01c042bec4771522a2aac176.diff LOG:

[clang] Revert "[clang-format][NFC] Eliminate the IsCpp parameter in all functions" (PR #85353)

2024-03-15 Thread Owen Pan via cfe-commits
owenca wrote: See e.g. https://lab.llvm.org/buildbot/#/builders/272/builds/11332. https://github.com/llvm/llvm-project/pull/85353 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Correctly parse C++11 attributes in enum specifiers (PR #85498)

2024-03-15 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/85498 Fixes #85476. >From 89c06a9acfebffa4f9e65c6d683c3c46774edc88 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Fri, 15 Mar 2024 22:14:01 -0700 Subject: [PATCH] [clang-format] Correctly parse C++11 attributes in enum

[clang] [clang-format] Fix a bug in SpaceInEmptyBlock option (PR #85508)

2024-03-16 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/85508 Fixes #84695. >From d15f3ddd2f9aef02f1706e7af64e76359a89 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Sat, 16 Mar 2024 02:18:33 -0700 Subject: [PATCH] [clang-format] Fix a bug in SpaceInEmptyBlock option Fi

[clang] 5ac784d - Revert "[clang-format][NFC] Don't use clang-format style in config files"

2024-03-16 Thread Owen Pan via cfe-commits
Author: Owen Pan Date: 2024-03-16T02:39:37-07:00 New Revision: 5ac784d1d00ce4733d07c3432ff946497a249e51 URL: https://github.com/llvm/llvm-project/commit/5ac784d1d00ce4733d07c3432ff946497a249e51 DIFF: https://github.com/llvm/llvm-project/commit/5ac784d1d00ce4733d07c3432ff946497a249e51.diff LOG:

[clang] [clang-format] Correctly parse C++11 attributes in enum specifiers (PR #85498)

2024-03-16 Thread Owen Pan via cfe-commits
https://github.com/owenca closed https://github.com/llvm/llvm-project/pull/85498 ___ 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 SpaceInEmptyBlock option (PR #85508)

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

[clang] b92d6dd - [clang-format][NFC] Delete 100+ redundant #include lines in .cpp files

2024-03-16 Thread Owen Pan via cfe-commits
Author: Owen Pan Date: 2024-03-16T22:24:11-07:00 New Revision: b92d6dd704d789240685a336ad8b25a9f381b4cc URL: https://github.com/llvm/llvm-project/commit/b92d6dd704d789240685a336ad8b25a9f381b4cc DIFF: https://github.com/llvm/llvm-project/commit/b92d6dd704d789240685a336ad8b25a9f381b4cc.diff LOG:

[clang] f3c5278 - [clang-format][NFC] Don't export IsCpp in Format.h

2024-03-17 Thread Owen Pan via cfe-commits
Author: Owen Pan Date: 2024-03-17T00:36:12-07:00 New Revision: f3c5278efa3b783ada9e7a34b751cf4c5b864535 URL: https://github.com/llvm/llvm-project/commit/f3c5278efa3b783ada9e7a34b751cf4c5b864535 DIFF: https://github.com/llvm/llvm-project/commit/f3c5278efa3b783ada9e7a34b751cf4c5b864535.diff LOG:

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

2024-03-17 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/85564 None >From 3b9e25b8509aa6847838148fd2959569c94c4a0f Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Sun, 17 Mar 2024 01:08:07 -0700 Subject: [PATCH] [clang-format] Fix FormatToken::isSimpleTypeSpecifier() --- cla

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

2024-03-17 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/85564 >From 3b9e25b8509aa6847838148fd2959569c94c4a0f Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Sun, 17 Mar 2024 01:08:07 -0700 Subject: [PATCH 1/2] [clang-format] Fix FormatToken::isSimpleTypeSpecifier() --- clang

[clang] [clang-format] Fix clang-format issue with 'new' and 'delete' keywords in C files (PR #85470)

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

[clang] [clang-format] Fix clang-format issue with 'new' and 'delete' keywords in C files (PR #85470)

2024-03-17 Thread Owen Pan via cfe-commits
@@ -11450,6 +11450,11 @@ TEST_F(FormatTest, UnderstandsNewAndDelete) { "void new (link p);\n" "void delete (link p);"); + verifyFormat("{ p->delete(); }\n" + "{ p->new(); }", + "{ p->delete (); }\n" + "{

[clang] [clang-format] Fix clang-format issue with 'new' and 'delete' keywords in C files (PR #85470)

2024-03-17 Thread Owen Pan via cfe-commits
https://github.com/owenca commented: I forgot to submit my review. https://github.com/llvm/llvm-project/pull/85470 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 55a02d1 - [clang-format][NFC] Minor changes to a unit test in 8e5de66af3da

2024-03-17 Thread Owen Pan via cfe-commits
Author: Owen Pan Date: 2024-03-17T21:37:32-07:00 New Revision: 55a02d10d9819b485f67546c6c1aee856a3cd62c URL: https://github.com/llvm/llvm-project/commit/55a02d10d9819b485f67546c6c1aee856a3cd62c DIFF: https://github.com/llvm/llvm-project/commit/55a02d10d9819b485f67546c6c1aee856a3cd62c.diff LOG:

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

2024-03-17 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/85564 >From 3b9e25b8509aa6847838148fd2959569c94c4a0f Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Sun, 17 Mar 2024 01:08:07 -0700 Subject: [PATCH 1/3] [clang-format] Fix FormatToken::isSimpleTypeSpecifier() --- clang

[clang] a2527e0 - [clang-format] Put erroneously removed braces back into a unit test

2024-03-18 Thread Owen Pan via cfe-commits
Author: Owen Pan Date: 2024-03-18T20:22:42-07:00 New Revision: a2527e06d77766d00e83ecb7988844aae7088bb1 URL: https://github.com/llvm/llvm-project/commit/a2527e06d77766d00e83ecb7988844aae7088bb1 DIFF: https://github.com/llvm/llvm-project/commit/a2527e06d77766d00e83ecb7988844aae7088bb1.diff LOG:

[clang] [clang-format] Fix clang-format issue with 'new' and 'delete' keywords in C files (PR #85470)

2024-03-18 Thread Owen Pan via cfe-commits
@@ -11450,6 +11450,11 @@ TEST_F(FormatTest, UnderstandsNewAndDelete) { "void new (link p);\n" "void delete (link p);"); + verifyFormat("{ p->delete(); }\n" + "{ p->new(); }", + "{ p->delete (); }\n" + "{

[clang] [clang-format][NFC] Eliminate the IsCpp parameter in all functions (PR #84599)

2024-03-18 Thread Owen Pan via cfe-commits
owenca wrote: Can you provide more info about the failed use cases? https://github.com/llvm/llvm-project/pull/84599 ___ 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 #85564)

2024-03-19 Thread Owen Pan via cfe-commits
https://github.com/owenca converted_to_draft 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] 6f31cf5 - Revert "[clang-format][NFC] Eliminate the IsCpp parameter in all functions (#84599)"

2024-03-19 Thread Owen Pan via cfe-commits
Author: Owen Pan Date: 2024-03-19T18:06:59-07:00 New Revision: 6f31cf51dfdc2c317ba8149d57d2ffb583403833 URL: https://github.com/llvm/llvm-project/commit/6f31cf51dfdc2c317ba8149d57d2ffb583403833 DIFF: https://github.com/llvm/llvm-project/commit/6f31cf51dfdc2c317ba8149d57d2ffb583403833.diff LOG:

[clang] [clang-format] Add --fail-on-incomplete-format. (PR #84346)

2024-03-20 Thread Owen Pan via cfe-commits
@@ -0,0 +1,5 @@ +// RUN: cat %s | not clang-format --fail-on-incomplete-format | FileCheck %s +// RUN: cat %s | clang-format | FileCheck %s +int a([) {} + +// CHECK: int a([) {} owenca wrote: It's missing the EOF. Also, use a single hyphen for the option like oth

[clang] [clang-format] Add --fail-on-incomplete-format. (PR #84346)

2024-03-20 Thread Owen Pan via cfe-commits
@@ -0,0 +1,5 @@ +// RUN: cat %s | not clang-format --fail-on-incomplete-format | FileCheck %s +// RUN: cat %s | clang-format | FileCheck %s +int a([) {} + +// CHECK: int a([) {} owenca wrote: > Done. It took me quite a while but `-style=LLVM` is also required as

[clang] [clang-format] Add --fail-on-incomplete-format. (PR #84346)

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

[clang] [clang-format] Add --fail-on-incomplete-format. (PR #84346)

2024-03-20 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/84346 >From e19f49ca2660cbcd64fb81aae0428e899d61cac6 Mon Sep 17 00:00:00 2001 From: Roberto Bampi Date: Thu, 7 Mar 2024 18:10:56 +0100 Subject: [PATCH 1/3] [clang-format] Add --fail-on-incomplete-format. At the moment

[clang] [clang-format] Add --fail-on-incomplete-format. (PR #84346)

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

[clang] [clang-format] Fix RemoveSemicolon for empty functions (PR #82278)

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

[clang] [clang-format] Fix crash in TokenAnnotator (PR #82349)

2024-02-20 Thread Owen Pan via cfe-commits
@@ -3817,7 +3817,7 @@ void TokenAnnotator::calculateFormattingInformation(AnnotatedLine &Line) const { do { Tok = Tok->Next; } while (Tok && Tok->isNot(TT_OverloadedOperatorLParen)); -if (!Tok) +if (!Tok || !Tok->Next)

[clang] [clang-format] Fix crash in TokenAnnotator (PR #82349)

2024-02-20 Thread Owen Pan via cfe-commits
@@ -13503,6 +13503,9 @@ TEST_F(FormatTest, IncorrectCodeUnbalancedBraces) { verifyFormat("{"); verifyFormat("#})"); verifyNoCrash("(/**/[:!] ?[)."); + verifyNoCrash("struct X{" +" operator iunt(" owenca wrote: ```suggestion verifyNoCr

[clang] [clang-format] Limit how much work guessLanguage() can do (PR #78925)

2024-02-21 Thread Owen Pan via cfe-commits
owenca wrote: > However, for clangd users, a crucial difference between `guessLanguage()` vs. > other code in libFormat that uses `UnwrappedLineParser`, is that > `guessLanguage()` gets called as soon as a file is opened in the editor, > while the other code is only called if the user explicit

[clang] [clang-format] Do not update cursor pos if no includes replacement (PR #77456)

2024-02-22 Thread Owen Pan via cfe-commits
@@ -3123,6 +3123,7 @@ static void sortCppIncludes(const FormatStyle &Style, } std::string result; + unsigned NewCursor = UINT_MAX; owenca wrote: ```suggestion const auto OldCursor = Cursor ? *Cursor : 0; ``` https://github.com/llvm/llvm-project/pull/7

[clang] [clang-format] Do not update cursor pos if no includes replacement (PR #77456)

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

[clang] [clang-format] Do not update cursor pos if no includes replacement (PR #77456)

2024-02-22 Thread Owen Pan via cfe-commits
@@ -3134,20 +3135,24 @@ static void sortCppIncludes(const FormatStyle &Style, } result += Includes[Index].Text; if (Cursor && CursorIndex == Index) - *Cursor = IncludesBeginOffset + result.size() - CursorToEOLOffset; + NewCursor = IncludesBeginOffset + res

[clang] [clang-format] Do not update cursor pos if no includes replacement (PR #77456)

2024-02-22 Thread Owen Pan via cfe-commits
@@ -3134,20 +3135,24 @@ static void sortCppIncludes(const FormatStyle &Style, } result += Includes[Index].Text; if (Cursor && CursorIndex == Index) - *Cursor = IncludesBeginOffset + result.size() - CursorToEOLOffset; + NewCursor = IncludesBeginOffset + res

[clang] [clang-format] Do not update cursor pos if no includes replacement (PR #77456)

2024-02-22 Thread Owen Pan via cfe-commits
https://github.com/owenca commented: `git diff Format.cpp` output: ``` --- a/clang/lib/Format/Format.cpp +++ b/clang/lib/Format/Format.cpp @@ -3116,6 +3116,7 @@ static void sortCppIncludes(const FormatStyle &Style, return; } + const auto OldCursor = Cursor ? *Cursor : 0; std::string

[clang] [clang-format] Do not update cursor pos if no includes replacement (PR #77456)

2024-02-22 Thread Owen Pan via cfe-commits
@@ -3134,20 +3135,24 @@ static void sortCppIncludes(const FormatStyle &Style, } result += Includes[Index].Text; if (Cursor && CursorIndex == Index) - *Cursor = IncludesBeginOffset + result.size() - CursorToEOLOffset; + NewCursor = IncludesBeginOffset + res

[clang] [clang-format] Do not update cursor pos if no includes replacement (PR #77456)

2024-02-22 Thread Owen Pan via cfe-commits
owenca wrote: > As a side note, I tried adding these two tests but they fail, meaning the > cursor is still incorrectly computed with CRLF when replacing lines. > > This is due to adding lines between the include groups (with Regroup option), > as this new line is added with only the character

[clang] [clang-format] Fix crash in TokenAnnotator (PR #82349)

2024-02-22 Thread Owen Pan via cfe-commits
https://github.com/owenca approved this pull request. https://github.com/llvm/llvm-project/pull/82349 ___ 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   >