[clang] [clang-format] unexpected break after binOp '<<' (PR #69859)

2023-10-23 Thread Owen Pan via cfe-commits
owenca wrote: Please add unit tests in `clang/unittests/Format/`. https://github.com/llvm/llvm-project/pull/69859 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Don't alter SpacesRequiredBefore of finalized tokens (PR #69897)

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

[clang] [clang-format] Don't alter SpacesRequiredBefore of finalized tokens (PR #69897)

2023-10-23 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/69897 Fixes #69237. >From 69e39f7e19e7f2538df0b8c6ba89d5efa493dd7b Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Sun, 22 Oct 2023 23:15:08 -0700 Subject: [PATCH] [clang-format] Don't alter SpacesRequiredBefore of

[clang] [clang-format] Add a new style for the clang-format source code (PR #69814)

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

[clang] [clang-format] Don't align comments over scopes (PR #68743)

2023-10-22 Thread Owen Pan via cfe-commits
@@ -3191,20 +3198,150 @@ TEST_F(FormatTestComments, DontAlignNamespaceComments) { "}\n" "// Comment"; -#if 0 - // FIXME: The following comment is aligned with the namespace comment. verifyFormat("namespace A {\n" " int Foo;\n"

[clang] [clang-format] Don't align comments over scopes (PR #68743)

2023-10-22 Thread Owen Pan via cfe-commits
@@ -1118,16 +1121,48 @@ void WhitespaceManager::alignTrailingComments() { } } -// We don't want to align namespace end comments. -const bool DontAlignThisComment = -I > 0 && C.NewlinesBefore == 0 && -Changes[I -

[clang] [clang-format] Don't break between string literal operands of << (PR #69871)

2023-10-22 Thread Owen Pan via cfe-commits
@@ -5118,10 +5118,6 @@ bool TokenAnnotator::mustBreakBefore(const AnnotatedLine , return true; if (Left.IsUnterminatedLiteral) return true; - if (Right.is(tok::lessless) && Right.Next && Left.is(tok::string_literal) && owenca wrote: No, it still

[clang] 3e86cc4 - [clang-format][NFC] Simplify the logic in a return statement

2023-10-22 Thread Owen Pan via cfe-commits
Author: Owen Pan Date: 2023-10-22T13:46:32-07:00 New Revision: 3e86cc4b864f609720c12cc97ff70a20aabb956f URL: https://github.com/llvm/llvm-project/commit/3e86cc4b864f609720c12cc97ff70a20aabb956f DIFF: https://github.com/llvm/llvm-project/commit/3e86cc4b864f609720c12cc97ff70a20aabb956f.diff

[clang] [clang-format] Don't align comments over scopes (PR #68743)

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

[clang] [clang-format] Don't break between string literal operands of << (PR #69871)

2023-10-22 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/69871 Fixes #44363. >From fc955bc2730b52093d1e6d2bdd2dbf0400879edf Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Sun, 22 Oct 2023 01:36:17 -0700 Subject: [PATCH] [clang-format] Don't break between string literal

[clang] [clang-format] Don't align comments over scopes (PR #68743)

2023-10-21 Thread Owen Pan via cfe-commits
@@ -1118,16 +1121,48 @@ void WhitespaceManager::alignTrailingComments() { } } -// We don't want to align namespace end comments. -const bool DontAlignThisComment = -I > 0 && C.NewlinesBefore == 0 && -Changes[I -

[clang] [clang-format] Add a new style for the clang-format source code (PR #69814)

2023-10-21 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/69814 >From 78a2661ba7a18ecf8b09be71f6959fbc9fcf70fe Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Fri, 20 Oct 2023 23:01:38 -0700 Subject: [PATCH 1/2] [clang-format] Add a new style for the clang-format source code

[clang] [clang-format] Add a new style for the clang-format source code (PR #69814)

2023-10-21 Thread Owen Pan via cfe-commits
owenca wrote: Yep. Each file will contain only `BasedOnStyle: clang-format`. https://github.com/llvm/llvm-project/pull/69814 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Add a new style for the clang-format source code (PR #69814)

2023-10-21 Thread Owen Pan via cfe-commits
owenca wrote: I was wondering myself. Will undo it before merging. https://github.com/llvm/llvm-project/pull/69814 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Add a new style for the clang-format source code (PR #69814)

2023-10-21 Thread Owen Pan via cfe-commits
owenca wrote: > What is your goal with that style? It was actually your [idea](https://reviews.llvm.org/D153208#4431239).  https://github.com/llvm/llvm-project/pull/69814 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang-format] Add a new style for the clang-format source code (PR #69814)

2023-10-21 Thread Owen Pan via cfe-commits
owenca wrote: I don't want to "advertise" this new style in the documentation but am willing to be overruled by the majority. https://github.com/llvm/llvm-project/pull/69814 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang-format] Add a new style for the clang-format source code (PR #69814)

2023-10-21 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/69814 None >From 78a2661ba7a18ecf8b09be71f6959fbc9fcf70fe Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Fri, 20 Oct 2023 23:01:38 -0700 Subject: [PATCH] [clang-format] Add a new style for the clang-format source code

[clang] [clang-format] Don't align comments over scopes (PR #68743)

2023-10-20 Thread Owen Pan via cfe-commits
=?utf-8?q?Bj=C3=B6rn_Sch=C3=A4pers?= Message-ID: In-Reply-To: @@ -3102,7 +3102,9 @@ TEST_F(FormatTestComments, DontAlignNamespaceComments) { StringRef Input = "namespace A {\n" " TESTSUITE(B) {\n" "namespace C {\n" -

[clang] [clang-format] Don't align comments over scopes (PR #68743)

2023-10-20 Thread Owen Pan via cfe-commits
=?utf-8?q?Björn_Schäpers?= Message-ID: In-Reply-To: https://github.com/owenca edited https://github.com/llvm/llvm-project/pull/68743 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Don't align comments over scopes (PR #68743)

2023-10-20 Thread Owen Pan via cfe-commits
=?utf-8?q?Bj=C3=B6rn_Sch=C3=A4pers?= Message-ID: In-Reply-To: @@ -1118,16 +1121,39 @@ void WhitespaceManager::alignTrailingComments() { } } -// We don't want to align namespace end comments. -const bool DontAlignThisComment = -I > 0 &&

[clang] [clang-format] Don't align comments over scopes (PR #68743)

2023-10-20 Thread Owen Pan via cfe-commits
=?utf-8?q?Björn_Schäpers?= Message-ID: In-Reply-To: @@ -1118,16 +1121,39 @@ void WhitespaceManager::alignTrailingComments() { } } -// We don't want to align namespace end comments. -const bool DontAlignThisComment = -I > 0 && C.NewlinesBefore == 0

[clang] [clang-format] Don't align comments over scopes (PR #68743)

2023-10-20 Thread Owen Pan via cfe-commits
=?utf-8?q?Bj=C3=B6rn_Sch=C3=A4pers?= Message-ID: In-Reply-To: @@ -1118,16 +1121,39 @@ void WhitespaceManager::alignTrailingComments() { } } -// We don't want to align namespace end comments. -const bool DontAlignThisComment = -I > 0 &&

[clang] [Windows] Add git-clang-format wrapper bat file (PR #69228)

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

[clang] [clang-format] Skip PP directives when determining brace kind (PR #69473)

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

[clang] [clang-format] Annotate do while while (PR #69707)

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

[clang] 7c15dd6 - [clang-format] Add space in placement new expression

2023-10-20 Thread Owen Pan via cfe-commits
Author: Omar Ahmed Date: 2023-10-20T03:16:28-07:00 New Revision: 7c15dd60ec4549f53f1a51c5302c61f8a025a4a5 URL: https://github.com/llvm/llvm-project/commit/7c15dd60ec4549f53f1a51c5302c61f8a025a4a5 DIFF: https://github.com/llvm/llvm-project/commit/7c15dd60ec4549f53f1a51c5302c61f8a025a4a5.diff

[clang] [clang-format] Skip PP directives when determining brace kind (PR #69473)

2023-10-19 Thread Owen Pan via cfe-commits
@@ -491,11 +491,19 @@ void UnwrappedLineParser::calculateBraceTypes(bool ExpectClassBody) { SmallVector LBraceStack; assert(Tok->is(tok::l_brace)); do { -// Get next non-comment token. -FormatToken *NextTok; -do { - NextTok = Tokens->getNextToken(); -

[clang] [clang-format] Skip PP directives when determining brace kind (PR #69473)

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

[clang] [clang-format] Skip PP directives when determining brace kind (PR #69473)

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

[clang] [clang-format] Skip PP directives when determining brace kind (PR #69473)

2023-10-19 Thread Owen Pan via cfe-commits
@@ -491,11 +491,19 @@ void UnwrappedLineParser::calculateBraceTypes(bool ExpectClassBody) { SmallVector LBraceStack; assert(Tok->is(tok::l_brace)); do { -// Get next non-comment token. -FormatToken *NextTok; -do { - NextTok = Tokens->getNextToken(); -

[clang] [Windows] Add git-clang-format wrapper bat file (PR #69228)

2023-10-19 Thread Owen Pan via cfe-commits
owenca wrote: @mydeveloperday what do you think? https://github.com/llvm/llvm-project/pull/69228 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Skip PP directives when determining brace kind (PR #69473)

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

[clang] [clang-format] Skip PP directives when determining brace kind (PR #69473)

2023-10-19 Thread Owen Pan via cfe-commits
owenca wrote: > Here's my solution to one of the regressions I caused (#68404) I don't think it's a regression. On the contrary, it actually exposed another bug. :) https://github.com/llvm/llvm-project/pull/69473 ___ cfe-commits mailing list

[clang] [clang-format] Skip PP directives when determining brace kind (PR #69473)

2023-10-19 Thread Owen Pan via cfe-commits
@@ -491,11 +491,19 @@ void UnwrappedLineParser::calculateBraceTypes(bool ExpectClassBody) { SmallVector LBraceStack; assert(Tok->is(tok::l_brace)); do { -// Get next non-comment token. -FormatToken *NextTok; -do { - NextTok = Tokens->getNextToken(); -

[clang] b2f50b4 - [clang-format][NFC] Use UnwrappedLineParser::eof() for consistency

2023-10-19 Thread Owen Pan via cfe-commits
Author: Owen Pan Date: 2023-10-19T13:38:49-07:00 New Revision: b2f50b49a8c45305d27f0393ee6248e3e8851788 URL: https://github.com/llvm/llvm-project/commit/b2f50b49a8c45305d27f0393ee6248e3e8851788 DIFF: https://github.com/llvm/llvm-project/commit/b2f50b49a8c45305d27f0393ee6248e3e8851788.diff

[clang] 2172eea - [clang-format][NFC] Take a constant conjunct out of a loop condition

2023-10-18 Thread Owen Pan via cfe-commits
Author: Owen Pan Date: 2023-10-18T17:37:41-07:00 New Revision: 2172eeaa52bec211b255e9cb4d8464a8908ff709 URL: https://github.com/llvm/llvm-project/commit/2172eeaa52bec211b255e9cb4d8464a8908ff709 DIFF: https://github.com/llvm/llvm-project/commit/2172eeaa52bec211b255e9cb4d8464a8908ff709.diff

[clang] [clang-format] Fix a bug in annotating TrailingReturnArrow (PR #69249)

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

[clang] [clang-format] Don't align comments over scopes (PR #68743)

2023-10-18 Thread Owen Pan via cfe-commits
@@ -1118,16 +1121,35 @@ void WhitespaceManager::alignTrailingComments() { } } -// We don't want to align namespace end comments. -const bool DontAlignThisComment = -I > 0 && C.NewlinesBefore == 0 && -Changes[I -

[clang] [clang-format] Don't align comments over scopes (PR #68743)

2023-10-18 Thread Owen Pan via cfe-commits
@@ -3191,20 +3191,146 @@ TEST_F(FormatTestComments, DontAlignNamespaceComments) { "}\n" "// Comment"; -#if 0 - // FIXME: The following comment is aligned with the namespace comment. verifyFormat("namespace A {\n" " int Foo;\n"

[clang] [clang-format] Fix a bug in annotating TrailingReturnArrow (PR #69249)

2023-10-17 Thread Owen Pan via cfe-commits
@@ -3497,6 +3497,15 @@ void TokenAnnotator::calculateFormattingInformation(AnnotatedLine ) const { Tok->setType(TT_TrailingReturnArrow); break; } +if (Tok->isNot(TT_TrailingAnnotation)) owenca wrote: Before: look for _any_

[clang] [clang-format] Fix a bug in annotating TrailingReturnArrow (PR #69249)

2023-10-17 Thread Owen Pan via cfe-commits
owenca wrote: @HazardyKnusperkeks any other concerns? https://github.com/llvm/llvm-project/pull/69249 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Windows] Add git-clang-format wrapper bat file (PR #69228)

2023-10-16 Thread Owen Pan via cfe-commits
owenca wrote: > This allows git-clang-format to be used on a Windows terminal without > manually needing to find the path and invoke the python interpreter. We have > a similar script for `scan-build`. Can you open an issue and link to it from here? It seems `git clang-format` works in

[clang] [clang-format] Fix a bug in mis-annotating arrows (PR #67780)

2023-10-16 Thread Owen Pan via cfe-commits
owenca wrote: See #69249. https://github.com/llvm/llvm-project/pull/67780 ___ 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 TrailingReturnArrow (PR #69249)

2023-10-16 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/69249 >From 25e0a84bd254969fb6930001f6203d4dc56f9871 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Mon, 16 Oct 2023 13:38:09 -0700 Subject: [PATCH 1/2] [clang-format] Fix a bug in annotating TrailingReturnArrow Skip

[clang] [clang-format] Fix a bug in annotating TrailingReturnArrow (PR #69249)

2023-10-16 Thread Owen Pan via cfe-commits
https://github.com/owenca edited https://github.com/llvm/llvm-project/pull/69249 ___ 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 TrailingReturnArrow (PR #69249)

2023-10-16 Thread Owen Pan via cfe-commits
@@ -3497,6 +3497,15 @@ void TokenAnnotator::calculateFormattingInformation(AnnotatedLine ) const { Tok->setType(TT_TrailingReturnArrow); break; } +if (Tok->isNot(TT_TrailingAnnotation)) owenca wrote: Because

[clang] [clang-format] Fix a bug in annotating TrailingReturnArrow (PR #69249)

2023-10-16 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/69249 Skip TrailingAnnotation when looking for TrailingReturnArrow. Fixes #69234. >From 25e0a84bd254969fb6930001f6203d4dc56f9871 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Mon, 16 Oct 2023 13:38:09 -0700 Subject:

[clang] [clang-format] Allow default values for template parameters in lambda (PR #69052)

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

[clang] [clang-format] Allow default values for template parameters in lambda (PR #69052)

2023-10-16 Thread Owen Pan via cfe-commits
@@ -2268,6 +2265,12 @@ bool UnwrappedLineParser::tryToParseLambda() { parseRequiresClause(RequiresToken); break; } +case tok::equal: + if (InTemplateParameterList) { +nextToken(); +break; + } + return true;

[clang] [clang-format] Allow default values for template parameters in lambda (PR #69052)

2023-10-16 Thread Owen Pan via cfe-commits
@@ -2268,6 +2265,12 @@ bool UnwrappedLineParser::tryToParseLambda() { parseRequiresClause(RequiresToken); break; } +case tok::equal: + if (InTemplateParameterList) { +nextToken(); +break; + } + return true;

[clang] [clang-format] Allow default values for template parameters in lambda (PR #69052)

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

[clang] [clang-format] Allow default values for template parameters in lambda (PR #69052)

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

[clang] [clang-format] Don't align comments over scopes (PR #68743)

2023-10-16 Thread Owen Pan via cfe-commits
@@ -3191,20 +3191,120 @@ TEST_F(FormatTestComments, DontAlignNamespaceComments) { "}\n" "// Comment"; -#if 0 - // FIXME: The following comment is aligned with the namespace comment. verifyFormat("namespace A {\n" " int Foo;\n"

[clang] [clang-format] Don't align comments over scopes (PR #68743)

2023-10-16 Thread Owen Pan via cfe-commits
@@ -1118,16 +1121,40 @@ void WhitespaceManager::alignTrailingComments() { } } -// We don't want to align namespace end comments. -const bool DontAlignThisComment = -I > 0 && C.NewlinesBefore == 0 && -Changes[I -

[clang] [clang-format] Don't align comments over scopes (PR #68743)

2023-10-16 Thread Owen Pan via cfe-commits
@@ -1118,16 +1121,40 @@ void WhitespaceManager::alignTrailingComments() { } } -// We don't want to align namespace end comments. -const bool DontAlignThisComment = -I > 0 && C.NewlinesBefore == 0 && -Changes[I -

[clang] [clang-format] Don't align comments over scopes (PR #68743)

2023-10-16 Thread Owen Pan via cfe-commits
@@ -20794,7 +20794,7 @@ TEST_F(FormatTest, CatchAlignArrayOfStructuresRightAlignment) { verifyFormat("int a[][] = {\n" "{\n" " {0, 2}, //\n" - " {1, 2} //\n" + " {1, 2} //\n" owenca wrote:

[clang] [clang-format] Don't align comments over scopes (PR #68743)

2023-10-16 Thread Owen Pan via cfe-commits
@@ -1118,16 +1121,40 @@ void WhitespaceManager::alignTrailingComments() { } } -// We don't want to align namespace end comments. -const bool DontAlignThisComment = -I > 0 && C.NewlinesBefore == 0 && -Changes[I -

[clang] [clang-format] Don't align comments over scopes (PR #68743)

2023-10-16 Thread Owen Pan via cfe-commits
@@ -1118,16 +1121,40 @@ void WhitespaceManager::alignTrailingComments() { } } -// We don't want to align namespace end comments. -const bool DontAlignThisComment = -I > 0 && C.NewlinesBefore == 0 && -Changes[I -

[clang] 7f881a2 - [clang-format] Treat AttributeMacro more like __attribute__

2023-10-15 Thread Owen Pan via cfe-commits
Author: Jared Grubb Date: 2023-10-15T15:58:24-07:00 New Revision: 7f881a2abe2c3eceeae0272fc41ba0a237770450 URL: https://github.com/llvm/llvm-project/commit/7f881a2abe2c3eceeae0272fc41ba0a237770450 DIFF: https://github.com/llvm/llvm-project/commit/7f881a2abe2c3eceeae0272fc41ba0a237770450.diff

[clang] 6c7cf74 - Revert "[clang-format] Treat AttributeMacro more like __attribute__"

2023-10-15 Thread Owen Pan via cfe-commits
Author: Owen Pan Date: 2023-10-15T15:52:17-07:00 New Revision: 6c7cf74a75572c3cc5d9979f02b67a7357e9c656 URL: https://github.com/llvm/llvm-project/commit/6c7cf74a75572c3cc5d9979f02b67a7357e9c656 DIFF: https://github.com/llvm/llvm-project/commit/6c7cf74a75572c3cc5d9979f02b67a7357e9c656.diff

[clang] 6f46bcc - [clang-format] Treat AttributeMacro more like __attribute__

2023-10-15 Thread Owen Pan via cfe-commits
Author: Jared Grubb Date: 2023-10-15T15:44:57-07:00 New Revision: 6f46bcc609f14121e6942763ba9871f98541ea0e URL: https://github.com/llvm/llvm-project/commit/6f46bcc609f14121e6942763ba9871f98541ea0e DIFF: https://github.com/llvm/llvm-project/commit/6f46bcc609f14121e6942763ba9871f98541ea0e.diff

[clang] [clang-format] Don't align comments over scopes (PR #68743)

2023-10-15 Thread Owen Pan via cfe-commits
=?utf-8?q?Björn_Schäpers?= Message-ID: In-Reply-To: @@ -182,7 +182,7 @@ TEST_F(FormatTestComments, UnderstandsSingleLineComments) { "int a; // This is unrelated")); EXPECT_EQ("class C {\n" " void f() { // This does something ..\n" -

[clang] [clang-format][NFC] Annotate control statement r_braces (PR #68621)

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

[clang] [clang-format][NFC] Annotate control statement r_braces (PR #68621)

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

[clang] [clang-format][NFC] Annotate control statement r_braces (PR #68621)

2023-10-10 Thread Owen Pan via cfe-commits
@@ -2756,6 +2756,10 @@ FormatToken *UnwrappedLineParser::parseIfThenElse(IfStmtKind *IfKind, CompoundStatementIndenter Indenter(this, Style, Line->Level); parseBlock(/*MustBeDeclaration=*/false, /*AddLevels=*/1u, /*MunchSemi=*/true, KeepIfBraces, ); +

[clang] [clang-format][NFC] Annotate control statement r_braces (PR #68621)

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

[clang] 42c564d - [clang-format][NFC] Make InsertNewlineAtEOF a little more efficient

2023-10-09 Thread Owen Pan via cfe-commits
Author: Owen Pan Date: 2023-10-09T01:09:45-07:00 New Revision: 42c564df2f479efb38e6f02340e370815b439eb1 URL: https://github.com/llvm/llvm-project/commit/42c564df2f479efb38e6f02340e370815b439eb1 DIFF: https://github.com/llvm/llvm-project/commit/42c564df2f479efb38e6f02340e370815b439eb1.diff

[clang] [clang-format][NFC] Annotate more r_braces (PR #68534)

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

[clang] Annotate enum r brace (PR #68535)

2023-10-08 Thread Owen Pan via cfe-commits
=?utf-8?q?Bj=C3=B6rn_Sch=C3=A4pers?= Message-ID: In-Reply-To: owenca wrote: See https://github.com/llvm/llvm-project/issues/56636. https://github.com/llvm/llvm-project/pull/68535 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] Annotate enum r brace (PR #68535)

2023-10-08 Thread Owen Pan via cfe-commits
=?utf-8?q?Bj=C3=B6rn_Sch=C3=A4pers?= Message-ID: In-Reply-To: https://github.com/owenca approved this pull request. https://github.com/llvm/llvm-project/pull/68535 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] 84cbd9f - [clang-format] Fix an error message

2023-10-05 Thread Owen Pan via cfe-commits
Author: Owen Pan Date: 2023-10-05T19:24:08-07:00 New Revision: 84cbd9f4ffba17a74516d1afa442568dc54eabb1 URL: https://github.com/llvm/llvm-project/commit/84cbd9f4ffba17a74516d1afa442568dc54eabb1 DIFF: https://github.com/llvm/llvm-project/commit/84cbd9f4ffba17a74516d1afa442568dc54eabb1.diff

[clang] 8902f12 - [clang-format][doc] Update the Linux kernel coding style URL

2023-10-05 Thread Owen Pan via cfe-commits
Author: Owen Pan Date: 2023-10-05T01:18:49-07:00 New Revision: 8902f12e61aa2d3053ad4d536e36569fc8bc9512 URL: https://github.com/llvm/llvm-project/commit/8902f12e61aa2d3053ad4d536e36569fc8bc9512 DIFF: https://github.com/llvm/llvm-project/commit/8902f12e61aa2d3053ad4d536e36569fc8bc9512.diff

[clang] [clang-format] Annotate ctors/dtors as CtorDtorDeclName instead (PR #67955)

2023-10-03 Thread Owen Pan via cfe-commits
owenca wrote: Reverted in d08fcc817eba. https://github.com/llvm/llvm-project/pull/67955 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] d08fcc8 - Revert "[clang-format] Annotate ctors/dtors as CtorDtorDeclName instead (#67955)"

2023-10-03 Thread Owen Pan via cfe-commits
Author: Owen Pan Date: 2023-10-03T18:19:23-07:00 New Revision: d08fcc817eba7f0186620688eee73f6d25fa90e8 URL: https://github.com/llvm/llvm-project/commit/d08fcc817eba7f0186620688eee73f6d25fa90e8 DIFF: https://github.com/llvm/llvm-project/commit/d08fcc817eba7f0186620688eee73f6d25fa90e8.diff

[clang] [clang-format] Annotate ctors/dtors as CtorDtorDeclName instead (PR #67955)

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

[clang] [clang-format][NFC] AlignTokenSequence: Skip loop iteration (PR #68154)

2023-10-03 Thread Owen Pan via cfe-commits
https://github.com/owenca approved this pull request. We should also update [this line](https://github.com/llvm/llvm-project/pull/68154/files#diff-13a957866eda585a177e1d10139b157956e9d82c40d2275b500c2b1bcb2ad8c0R452) to: ``` assert(Shift > 0 || Changes[i].NewlinesBefore > 0 || ```

[clang] [clang-format][NFC] AlignTokenSequence: Rename Changes[i] to CurrentC… (PR #68153)

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

[clang] [clang-format][NFC] AlignTokens: Rename Changes[i] to CurrentChange (PR #68152)

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

[clang] [clang-format] Annotate ctors/dtors as CtorDtorDeclName instead (PR #67955)

2023-10-03 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/67955 >From 15d37075331311020020c5741e2432cd3fc0be74 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Sun, 1 Oct 2023 23:01:30 -0700 Subject: [PATCH 1/2] [clang-format] Annotate ctors/dtors as CtorDtorDeclName instead

[clang] [clang-format] Annotate ctors/dtors as CtorDtorDeclName instead (PR #67955)

2023-10-03 Thread Owen Pan via cfe-commits
owenca wrote: > https://buildkite.com/llvm-project/clang-ci/builds/4275#018af20e-3d3c-4344-b92d-88ac8b09b484 > Tests do not pass? I saw that but don't know why. Did you have the same failures? I'll push another commit shortly to trigger buildkite again.

[clang] [clang-format] Annotate ctors/dtors as CtorDtorDeclName instead (PR #67955)

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

[clang] [clang-format] Annotate ctors/dtors as CtorDtorDeclName instead (PR #67955)

2023-10-03 Thread Owen Pan via cfe-commits
@@ -3447,9 +3447,13 @@ void TokenAnnotator::calculateFormattingInformation(AnnotatedLine ) const { Tok = Tok->Next) { if (Tok->Previous->EndsCppAttributeGroup) AfterLastAttribute = Tok; -if (isFunctionDeclarationName(Style.isCpp(), *Tok, Line,

[clang] [clang-format] Annotate ctors/dtors as CtorDtorDeclName instead (PR #67955)

2023-10-03 Thread Owen Pan via cfe-commits
@@ -16339,7 +16345,7 @@ TEST_F(FormatTest, ConfigurableSpaceBeforeParens) { verifyFormat("int f();", SpaceFuncDef); verifyFormat("void f (int a, T b) {}", SpaceFuncDef); - verifyFormat("A::A () : a(1) {}", SpaceFuncDef); + verifyFormat("A::A() : a(1) {}", SpaceFuncDef);

[clang] [clang-format] Annotate ctors/dtors as CtorDtorDeclName instead (PR #67955)

2023-10-03 Thread Owen Pan via cfe-commits
@@ -3447,9 +3447,13 @@ void TokenAnnotator::calculateFormattingInformation(AnnotatedLine ) const { Tok = Tok->Next) { if (Tok->Previous->EndsCppAttributeGroup) AfterLastAttribute = Tok; -if (isFunctionDeclarationName(Style.isCpp(), *Tok, Line,

[clang] [clang-format] Fix alignment in presence of template functions (PR #68029)

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

[clang] [clang-format] Fix alignment in presence of template functions (PR #68029)

2023-10-03 Thread Owen Pan via cfe-commits
@@ -18525,12 +18525,17 @@ TEST_F(FormatTest, AlignConsecutiveAssignments) { " a_longer_name_for_wrap}};", Alignment); - Alignment.ColumnLimit = 60; + Alignment = getLLVMStyleWithColumns(60); +

[clang] [clang-format] Fix alignment in presence of template functions (PR #68029)

2023-10-02 Thread Owen Pan via cfe-commits
@@ -18525,12 +18525,17 @@ TEST_F(FormatTest, AlignConsecutiveAssignments) { " a_longer_name_for_wrap}};", Alignment); - Alignment.ColumnLimit = 60; + Alignment = getLLVMStyleWithColumns(60); +

[clang] [clang-format] Fix alignment in presence of template functions (PR #68029)

2023-10-02 Thread Owen Pan via cfe-commits
owenca wrote: Can you add an issue to show the incorrect format before this patch? https://github.com/llvm/llvm-project/pull/68029 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Annotate ctors/dtors as CtorDtorDeclName instead (PR #67955)

2023-10-02 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/67955 >From 15d37075331311020020c5741e2432cd3fc0be74 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Sun, 1 Oct 2023 23:01:30 -0700 Subject: [PATCH] [clang-format] Annotate ctors/dtors as CtorDtorDeclName instead After

[clang] [clang-format] Fix a bug in mis-annotating arrows (PR #67780)

2023-10-02 Thread Owen Pan via cfe-commits
https://github.com/owenca closed https://github.com/llvm/llvm-project/pull/67780 ___ 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 RemoveParentheses: ReturnStatement (PR #67911)

2023-10-02 Thread Owen Pan via cfe-commits
owenca wrote: @tru np! That was my intention anyways. https://github.com/llvm/llvm-project/pull/67911 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Annotate ctors/dtors as CtorDtorDeclName instead (PR #67955)

2023-10-02 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/67955 After annotating constructors/destructors as FunctionDeclarationName in commit 08630512088, we have seen several issues because ctors/dtors had been treated differently than functions in aligning, wrapping, and

[clang] [clang-format] Fix a bug in RemoveParentheses: ReturnStatement (PR #67911)

2023-10-01 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/67911 Don't remove the outermost parentheses surrounding a return statement expression when inside a function/lambda that has the decltype(auto) return type. Fixed #67892. >From

[clang] 511662b - [clang-format][NFC] Don't call startsSequence() in the parser

2023-09-30 Thread Owen Pan via cfe-commits
Author: Owen Pan Date: 2023-09-30T02:09:52-07:00 New Revision: 511662b88c36f8d5d02f0b758b15c1b84d4ee6c1 URL: https://github.com/llvm/llvm-project/commit/511662b88c36f8d5d02f0b758b15c1b84d4ee6c1 DIFF: https://github.com/llvm/llvm-project/commit/511662b88c36f8d5d02f0b758b15c1b84d4ee6c1.diff

[clang] 36c1e56 - [clang-format][NFC] Simplify the UnwrappedLine constructor

2023-09-30 Thread Owen Pan via cfe-commits
Author: Owen Pan Date: 2023-09-30T02:03:14-07:00 New Revision: 36c1e568bb4f8e482e3f713c8cb9460c5cf19863 URL: https://github.com/llvm/llvm-project/commit/36c1e568bb4f8e482e3f713c8cb9460c5cf19863 DIFF: https://github.com/llvm/llvm-project/commit/36c1e568bb4f8e482e3f713c8cb9460c5cf19863.diff

[clang] [clang-format] Handle __attribute/__declspec/AttributeMacro consistently (PR #67518)

2023-09-29 Thread Owen Pan via cfe-commits
https://github.com/owenca closed https://github.com/llvm/llvm-project/pull/67518 ___ 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 mis-annotating arrows (PR #67780)

2023-09-29 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/67780 >From 40d12f082ac712ea4b967db5a981a9fd08ef7c54 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Fri, 29 Sep 2023 02:30:47 -0700 Subject: [PATCH] [clang-format] Fix a bug in mis-annotating arrows Fixed #66923. ---

[clang] [clang-format] Fix a bug in mis-annotating arrows (PR #67780)

2023-09-29 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/67780 Fixed #66923. >From 4d65ac64140d39edb70ba64d88971819c2602ea7 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Fri, 29 Sep 2023 02:30:47 -0700 Subject: [PATCH] [clang-format] Fix a bug in mis-annotating arrows

[clang] [clang-format] Don't align ctors and dtors with other functions (PR #67618)

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

[clang] [clang-format] Handle __attribute/__declspec/AttributeMacro consistently (PR #67518)

2023-09-28 Thread Owen Pan via cfe-commits
https://github.com/owenca resolved https://github.com/llvm/llvm-project/pull/67518 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

<    4   5   6   7   8   9   10   11   12   >