[clang] [clang-format] Fix a bug in indenting lambda trailing arrows (PR #94560)

2024-06-10 Thread Owen Pan via cfe-commits
https://github.com/owenca closed https://github.com/llvm/llvm-project/pull/94560 ___ 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 lambda l_square (PR #95084)

2024-06-11 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/95084 Fixes #95072. >From b89f8a5bcbf525d779565219951359162655929e Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Tue, 11 Jun 2024 01:32:32 -0700 Subject: [PATCH] [clang-format] Fix a bug in annotating lambda l_square

[clang] [clang-format] Add DiagHandler for getStyle function (PR #91317)

2024-06-11 Thread Owen Pan via cfe-commits
owenca wrote: > Am I right that no one has a major issue with the patch? So fixing the > "const" issue and adding a unit test will let that in? Can you add a unit test? https://github.com/llvm/llvm-project/pull/91317 ___ cfe-commits mailing list cfe-

[clang] [clang-format] Add DiagHandler for getStyle function (PR #91317)

2024-06-11 Thread Owen Pan via cfe-commits
owenca wrote: @mydeveloperday requested it. See https://github.com/llvm/llvm-project/pull/91317#pullrequestreview-2095010527. There are calls to `getStyle()` in `ConfigParseTest.cpp`. Maybe add a test there? https://github.com/llvm/llvm-project/pull/91317 _

[clang] [clang-format] Don't count template template parameter as declaration (PR #95025)

2024-06-11 Thread Owen Pan via cfe-commits
@@ -584,6 +584,23 @@ TEST_F(TokenAnnotatorTest, UnderstandsNonTemplateAngleBrackets) { EXPECT_TOKEN(Tokens[20], tok::greater, TT_BinaryOperator); } +TEST_F(TokenAnnotatorTest, UnderstandsTemplateTemplateParameters) { + auto Tokens = annotate("template typename X,\n" +

[clang] [clang-format] Don't count template template parameter as declaration (PR #95025)

2024-06-11 Thread Owen Pan via cfe-commits
@@ -127,7 +127,7 @@ class AnnotatingParser { SmallVector &Scopes) : Style(Style), Line(Line), CurrentToken(Line.First), AutoFound(false), IsCpp(Style.isCpp()), LangOpts(getFormattingLangOpts(Style)), -Keywords(Keywords), Scopes(Scopes) {

[clang] [clang-format] Don't count template template parameter as declaration (PR #95025)

2024-06-11 Thread Owen Pan via cfe-commits
@@ -1269,10 +1269,17 @@ class AnnotatingParser { if (CurrentToken && CurrentToken->is(tok::less)) { CurrentToken->setType(TT_TemplateOpener); next(); - if (!parseAngle()) + TemplateDeclarationDepth++; + if (!parseAngle()) { +TemplateDeclar

[clang] [clang-format] Don't count template template parameter as declaration (PR #95025)

2024-06-11 Thread Owen Pan via cfe-commits
@@ -1269,10 +1269,17 @@ class AnnotatingParser { if (CurrentToken && CurrentToken->is(tok::less)) { CurrentToken->setType(TT_TemplateOpener); next(); - if (!parseAngle()) + TemplateDeclarationDepth++; + if (!parseAngle()) { +TemplateDeclar

[clang] [clang-format] Don't count template template parameter as declaration (PR #95025)

2024-06-11 Thread Owen Pan via cfe-commits
@@ -584,6 +584,23 @@ TEST_F(TokenAnnotatorTest, UnderstandsNonTemplateAngleBrackets) { EXPECT_TOKEN(Tokens[20], tok::greater, TT_BinaryOperator); } +TEST_F(TokenAnnotatorTest, UnderstandsTemplateTemplateParameters) { + auto Tokens = annotate("template typename X,\n" +

[clang] [clang-format] Don't count template template parameter as declaration (PR #95025)

2024-06-11 Thread Owen Pan via cfe-commits
@@ -584,6 +584,23 @@ TEST_F(TokenAnnotatorTest, UnderstandsNonTemplateAngleBrackets) { EXPECT_TOKEN(Tokens[20], tok::greater, TT_BinaryOperator); } +TEST_F(TokenAnnotatorTest, UnderstandsTemplateTemplateParameters) { + auto Tokens = annotate("template typename X,\n" +

[clang] [clang-format] Don't count template template parameter as declaration (PR #95025)

2024-06-11 Thread Owen Pan via cfe-commits
@@ -584,6 +584,23 @@ TEST_F(TokenAnnotatorTest, UnderstandsNonTemplateAngleBrackets) { EXPECT_TOKEN(Tokens[20], tok::greater, TT_BinaryOperator); } +TEST_F(TokenAnnotatorTest, UnderstandsTemplateTemplateParameters) { + auto Tokens = annotate("template typename X,\n" +

[clang] [clang-format] Don't count template template parameter as declaration (PR #95025)

2024-06-11 Thread Owen Pan via cfe-commits
https://github.com/owenca deleted https://github.com/llvm/llvm-project/pull/95025 ___ 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 lambda l_square (PR #95084)

2024-06-11 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/95084 >From b89f8a5bcbf525d779565219951359162655929e Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Tue, 11 Jun 2024 01:32:32 -0700 Subject: [PATCH 1/2] [clang-format] Fix a bug in annotating lambda l_square Fixes #9507

[clang] [clang-format] Fix a bug in annotating lambda l_square (PR #95084)

2024-06-11 Thread Owen Pan via cfe-commits
@@ -1591,6 +1591,12 @@ TEST_F(TokenAnnotatorTest, UnderstandsLambdas) { EXPECT_TOKEN(Tokens[15], tok::arrow, TT_TrailingReturnArrow); EXPECT_TOKEN(Tokens[17], tok::l_brace, TT_LambdaLBrace); + Tokens = annotate("auto l = [] -> struct S { return {}; };");

[clang] [clang-format] Fix a bug in annotating lambda l_square (PR #95084)

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

[clang] [clang-format] Don't count template template parameter as declaration (PR #95025)

2024-06-12 Thread Owen Pan via cfe-commits
@@ -1269,10 +1269,17 @@ class AnnotatingParser { if (CurrentToken && CurrentToken->is(tok::less)) { CurrentToken->setType(TT_TemplateOpener); next(); - if (!parseAngle()) + TemplateDeclarationDepth++; + if (!parseAngle()) { +TemplateDeclar

[clang] [clang-format] Don't over-indent comment below unbraced body (PR #95354)

2024-06-12 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/95354 Fixes #45002. >From 02f1731d57d40e51605f667c8a0b1223b159e645 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Wed, 12 Jun 2024 22:04:17 -0700 Subject: [PATCH] [clang-format] Don't overindent comment below unbraced b

[clang] [clang-format] Fix bad comment indentation before ifdef after braceless if (PR #94776)

2024-06-12 Thread Owen Pan via cfe-commits
owenca wrote: @Erich-Reitz you were on the right track. See #95354. https://github.com/llvm/llvm-project/pull/94776 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Handle AttributeMacro before access modifiers (PR #95503)

2024-06-13 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/95503 Closes #95094. >From 6684ed759ce118bb28e9da22be51bcfece2a1909 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Thu, 13 Jun 2024 21:25:08 -0700 Subject: [PATCH] [clang-format] Handle AttributeMacro before access modi

[clang] [clang-format] Don't count template template parameter as declaration (PR #95025)

2024-06-13 Thread Owen Pan via cfe-commits
@@ -1269,10 +1269,17 @@ class AnnotatingParser { if (CurrentToken && CurrentToken->is(tok::less)) { CurrentToken->setType(TT_TemplateOpener); next(); - if (!parseAngle()) + TemplateDeclarationDepth++; + if (!parseAngle()) { +TemplateDeclar

[clang] [clang-format] Add DiagHandler for getStyle function (PR #91317)

2024-06-14 Thread Owen Pan via cfe-commits
@@ -4027,12 +4031,10 @@ Expected getStyle(StringRef StyleName, StringRef FileName, // Reset possible inheritance Style.InheritsParentConfig = false; - auto dropDiagnosticHandler = [](const llvm::SMDiagnostic &, void *) {}; - auto applyChildFormatTexts = [&](FormatStyl

[clang] [clang-format] Add DiagHandler for getStyle function (PR #91317)

2024-06-14 Thread Owen Pan via cfe-commits
@@ -4027,12 +4031,10 @@ Expected getStyle(StringRef StyleName, StringRef FileName, // Reset possible inheritance Style.InheritsParentConfig = false; - auto dropDiagnosticHandler = [](const llvm::SMDiagnostic &, void *) {}; - owenca wrote: Sorry! We do n

[clang] [clang-format] Add DiagHandler for getStyle function (PR #91317)

2024-06-14 Thread Owen Pan via cfe-commits
@@ -1452,6 +1452,35 @@ TEST(ConfigParseTest, GetStyleOfSpecificFile) { ASSERT_EQ(*Style, getGoogleStyle()); } +TEST(ConfigParseTest, GetStyleOutput) { +// With output +::testing::internal::CaptureStderr(); +llvm::vfs::InMemoryFileSystem FS; +auto Style = getS

[clang] [clang-format] Add DiagHandler for getStyle function (PR #91317)

2024-06-14 Thread Owen Pan via cfe-commits
@@ -1452,6 +1452,35 @@ TEST(ConfigParseTest, GetStyleOfSpecificFile) { ASSERT_EQ(*Style, getGoogleStyle()); } +TEST(ConfigParseTest, GetStyleOutput) { +// With output +::testing::internal::CaptureStderr(); +llvm::vfs::InMemoryFileSystem FS; +auto Style = getS

[clang] [clang-format] Add DiagHandler for getStyle function (PR #91317)

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

[clang] [clang-format] Add DiagHandler for getStyle function (PR #91317)

2024-06-14 Thread Owen Pan via cfe-commits
@@ -1452,6 +1452,35 @@ TEST(ConfigParseTest, GetStyleOfSpecificFile) { ASSERT_EQ(*Style, getGoogleStyle()); } +TEST(ConfigParseTest, GetStyleOutput) { +// With output +::testing::internal::CaptureStderr(); +llvm::vfs::InMemoryFileSystem FS; +auto Style = getS

[clang] [clang-format] Don't over-indent comment below unbraced body (PR #95354)

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

[clang] [clang-format] Add DiagHandler for getStyle function (PR #91317)

2024-06-14 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/91317 >From c1e0ad6ee57a95fa4321bbe91aa754167da9fb3b Mon Sep 17 00:00:00 2001 From: Artem Sokolovskii Date: Tue, 7 May 2024 12:27:29 +0200 Subject: [PATCH 1/2] [clang-format] Add DiagHandler for getStyle function It al

[clang] [clang-format] Add DiagHandler for getStyle function (PR #91317)

2024-06-14 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/91317 >From c1e0ad6ee57a95fa4321bbe91aa754167da9fb3b Mon Sep 17 00:00:00 2001 From: Artem Sokolovskii Date: Tue, 7 May 2024 12:27:29 +0200 Subject: [PATCH 1/3] [clang-format] Add DiagHandler for getStyle function It al

[clang] [clang-format] Add DiagHandler parameter to format::getStyle() (PR #91317)

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

[clang] [clang-format] Add DiagHandler parameter to format::getStyle() (PR #91317)

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

[clang] [clang-format] Add DiagHandler parameter to format::getStyle() (PR #91317)

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

[clang] [clang-format] Handle AttributeMacro before access modifiers (PR #95634)

2024-06-14 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/95634 Closes #95094. >From 1c4ab4a5fd869de44795abd48bbaa43176e7275e Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Fri, 14 Jun 2024 23:36:58 -0700 Subject: [PATCH] [clang-format] Handle AttributeMacro before access modi

[clang] [clang-format] Handle AttributeMacro before access modifiers (PR #95503)

2024-06-14 Thread Owen Pan via cfe-commits
@@ -57,7 +57,10 @@ class LevelIndentTracker { /// Update the indent state given that \p Line is going to be formatted /// next. void nextLine(const AnnotatedLine &Line) { -Offset = getIndentOffset(*Line.First); +const auto *Tok = Line.First; +if (Tok->is(TT_At

[clang] [clang-format] Handle AttributeMacro before access modifiers (PR #95634)

2024-06-15 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/95634 >From 1c4ab4a5fd869de44795abd48bbaa43176e7275e Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Fri, 14 Jun 2024 23:36:58 -0700 Subject: [PATCH 1/2] [clang-format] Handle AttributeMacro before access modifiers Clos

[clang] [clang-format] Handle AttributeMacro before access modifiers (PR #95634)

2024-06-16 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/95634 >From 1c4ab4a5fd869de44795abd48bbaa43176e7275e Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Fri, 14 Jun 2024 23:36:58 -0700 Subject: [PATCH 1/3] [clang-format] Handle AttributeMacro before access modifiers Clos

[clang] [clang-format] Handle AttributeMacro before access modifiers (PR #95634)

2024-06-16 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/95634 >From 1c4ab4a5fd869de44795abd48bbaa43176e7275e Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Fri, 14 Jun 2024 23:36:58 -0700 Subject: [PATCH 1/4] [clang-format] Handle AttributeMacro before access modifiers Clos

[clang] [clang-format] Handle AttributeMacro before access modifiers (PR #95634)

2024-06-16 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/95634 >From 1c4ab4a5fd869de44795abd48bbaa43176e7275e Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Fri, 14 Jun 2024 23:36:58 -0700 Subject: [PATCH 1/5] [clang-format] Handle AttributeMacro before access modifiers Clos

[clang] [clang-format] Handle AttributeMacro before access modifiers (PR #95503)

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

[clang] [clang-format] Handle Verilog delay control (PR #95703)

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

[clang] [clang-format] Handle AttributeMacro before access modifiers (PR #95634)

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

[clang] [clang-format] Add DiagHandler parameter to format::getStyle() (PR #91317)

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

[clang] 527e732 - [clang-format][NFC] Suppress diagnostic noise in GetStyleOfFile test

2024-06-16 Thread Owen Pan via cfe-commits
Author: Owen Pan Date: 2024-06-16T14:56:02-07:00 New Revision: 527e7328607ea0a55855e53a59c5030a7d07a554 URL: https://github.com/llvm/llvm-project/commit/527e7328607ea0a55855e53a59c5030a7d07a554 DIFF: https://github.com/llvm/llvm-project/commit/527e7328607ea0a55855e53a59c5030a7d07a554.diff LOG:

[clang] [clang-format][NFC] Add FormatToken::isAccessSpecifierKeyword() (PR #95727)

2024-06-16 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/95727 None >From ec9b902518ef09d77e8b32777032a852d33476fd Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Sun, 16 Jun 2024 17:47:56 -0700 Subject: [PATCH] [clang-format][NFC] Add FormatToken::isAccessSpecifierKeyword()

[clang] [clang-format][NFC] Add FormatToken::isAccessSpecifierKeyword() (PR #95727)

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

[clang] [clang-format][NFC] Add CMake target clang-format-check-format (PR #95873)

2024-06-17 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/95873 Adpated from polly-check-format. >From ab2a61d1939f4be4551949e979fd43b9e11c5c49 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Mon, 17 Jun 2024 18:49:22 -0700 Subject: [PATCH] [clang-format][NFC] Add CMake target

[clang] [clang-format][NFC] Add CMake target clang-format-check-format (PR #95873)

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

[clang] [clang-format] Handle function try block with ctor-initializer (PR #95878)

2024-06-17 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/95878 Fixes #58987. Fixes #95679. >From 299924c9f9485e7a784ffedcb6ec4fbccf5ad6f7 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Mon, 17 Jun 2024 21:13:10 -0700 Subject: [PATCH] [clang-format] Handle function try block w

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

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

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

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

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

2024-06-18 Thread Owen Pan via cfe-commits
@@ -21947,6 +21950,10 @@ TEST_F(FormatTest, HandlesUTF8BOM) { verifyFormat("\xef\xbb\xbf"); verifyFormat("\xef\xbb\xbf#include "); verifyFormat("\xef\xbb\xbf\n#include "); + auto Style = getLLVMStyle(); owenca wrote: Ditto. https://github.com/llvm/llvm

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

2024-06-18 Thread Owen Pan via cfe-commits
@@ -45,6 +45,9 @@ TEST_F(FormatTest, FormatsGlobalStatementsAt0) { verifyFormat("\nint i;", " \n\t \v \f int i;"); verifyFormat("int i;\nint j;", "int i; int j;"); verifyFormat("int i;\nint j;", "int i;\n int j;"); + auto Style = getLLVMStyle(); ---

[clang] [clang-format] Skip block commented out includes when sorting them (PR #97787)

2024-07-05 Thread Owen Pan via cfe-commits
https://github.com/owenca closed https://github.com/llvm/llvm-project/pull/97787 ___ 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 decl l_paren (PR #97938)

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

[clang] [clang-format] Improve BlockIndent at ColumnLimit (PR #93140)

2024-07-06 Thread Owen Pan via cfe-commits
@@ -803,6 +803,60 @@ void ContinuationIndenter::addTokenOnCurrentLine(LineState &State, bool DryRun, return !Tok.Previous->isOneOf(TT_CastRParen, tok::kw_for, tok::kw_while, tok::kw_switch); }; + // Detecting functions is brittle. It wo

[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] [polly] [clang-format] Revert breaking stream operators to previous default (PR #89016)

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

[clang] [polly] [clang-format] Revert breaking stream operators to previous default (PR #89016)

2024-04-16 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/89016 Reverts commit d68826dfbd98, which changes the previous default behavior of always breaking before a stream insertion operator `<<` if both operands are string literals. Also reverts the related commits 27f54796

[clang] [clang-format] Annotate ampamp after new/delete as BinaryOperator (PR #89033)

2024-04-17 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/89033 Fixes #78789. >From 0e2d91d20a1c318868f2e791d859a047b83f0277 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Wed, 17 Apr 2024 00:39:36 -0700 Subject: [PATCH] [clang-format] Annotate ampamp after new/delete as Bina

[clang] [polly] [clang-format] Revert breaking stream operators to previous default (PR #89016)

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

[clang] [clang-format] Annotate ampamp after new/delete as BinaryOperator (PR #89033)

2024-04-17 Thread Owen Pan via cfe-commits
https://github.com/owenca closed https://github.com/llvm/llvm-project/pull/89033 ___ 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 CastRParen before unary && (PR #89346)

2024-04-18 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/89346 Also fix a bug in annotating TrailingAnnotation. Closes #61233. >From 53b2846e35e0e8541ca0c3c6f63d31821dc9441c Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Thu, 18 Apr 2024 21:21:47 -0700 Subject: [PATCH] [clan

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

2024-04-18 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/77456 >From d4fd95374a82361e3dbfcd7a5d87c37da4542d2b Mon Sep 17 00:00:00 2001 From: NorthBlue333 Date: Tue, 9 Jan 2024 14:01:14 +0100 Subject: [PATCH 1/3] [clang-format] Do not update cursor pos if no includes replacem

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

2024-04-18 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/77456 >From d4fd95374a82361e3dbfcd7a5d87c37da4542d2b Mon Sep 17 00:00:00 2001 From: NorthBlue333 Date: Tue, 9 Jan 2024 14:01:14 +0100 Subject: [PATCH 1/4] [clang-format] Do not update cursor pos if no includes replacem

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

2024-04-18 Thread Owen Pan via cfe-commits
owenca wrote: > I've done all your changes in a second commit just to be able to keep track > of my previous changes; but I am actually not sure how your suggested > modifications are any different from mine? Well, I admit it looks a bit > better, but it works the same? Or am I missing somethi

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

2024-04-18 Thread Owen Pan via cfe-commits
https://github.com/owenca approved this pull request. 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] [polly] [clang-format] Correctly annotate braces in macros (PR #87953)

2024-04-18 Thread Owen Pan via cfe-commits
owenca wrote: @tstellar somehow this is not in 18.1.4, but the LLVM Release Status in the Projects box says "Status: Done". Did I miss something here? https://github.com/llvm/llvm-project/pull/87953 ___ cfe-commits mailing list cfe-commits@lists.llvm.

[clang] [polly] [clang-format] Correctly annotate braces in macros (PR #87953)

2024-04-19 Thread Owen Pan via cfe-commits
owenca wrote: Ah, I still need to do that. https://github.com/llvm/llvm-project/pull/87953 ___ 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 braces in macros (PR #87953)

2024-04-19 Thread Owen Pan via cfe-commits
owenca wrote: /cherry-pick 58323de2e5ed https://github.com/llvm/llvm-project/pull/87953 ___ 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 BK_BracedInit (PR #87450)

2024-04-19 Thread Owen Pan via cfe-commits
owenca wrote: /cherry-pick 7c9c38eaa9b7 https://github.com/llvm/llvm-project/pull/87450 ___ 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 ContinuationIndenter (PR #88414)

2024-04-19 Thread Owen Pan via cfe-commits
owenca wrote: /cherry-pick d61edecbfd09 https://github.com/llvm/llvm-project/pull/88414 ___ 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 TrailingReturnArrow (PR #86624)

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

[clang] [polly] [clang-format] Revert breaking stream operators to previous default (PR #89016)

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

[clang] [polly] [clang-format] Revert breaking stream operators to previous default (PR #89016)

2024-04-19 Thread Owen Pan via cfe-commits
owenca wrote: /cherry-pick 29ecd6d50f14 https://github.com/llvm/llvm-project/pull/89016 ___ 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 CastRParen before unary && (PR #89346)

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

[clang] [clang-format] Correctly annotate list init braces of class types (PR #89706)

2024-04-22 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/89706 Fixes #71939. >From 0fab05c4ab7ac95d7c08dd23a0441dc28c2ef813 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Mon, 22 Apr 2024 21:56:31 -0700 Subject: [PATCH] [clang-format] Correctly annotate list init braces of cl

[clang] [clang-format] Correctly annotate list init braces of class types (PR #89706)

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

[clang] [clang-format] Annotate enum braces as BK_Block (PR #89871)

2024-04-23 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/89871 Fixes #89759. >From dfd275f3d2f89e2cabffcc0d573f2b4571c0ead4 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Tue, 23 Apr 2024 21:59:43 -0700 Subject: [PATCH] [clang-format] Annotate enum braces as BK_Block Fixes #

[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:

<    4   5   6   7   8   9   10   11   >