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

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

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

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

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

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

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

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

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

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

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

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

[clang] [clang-format] Fix a regression in annotating struct braces (PR #92352)

2024-05-15 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/92352 Fixes #92350. >From d6f338d050bba640e90da983cac34111cdbf56c2 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Wed, 15 May 2024 22:38:29 -0700 Subject: [PATCH] [clang-format] Fix a regression in annotating struct bra

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

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

[clang] [clang-format] Fix a regression in annotating struct braces (PR #92352)

2024-05-16 Thread Owen Pan via cfe-commits
https://github.com/owenca closed https://github.com/llvm/llvm-project/pull/92352 ___ 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 goto labels (PR #92494)

2024-05-16 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/92494 Fixes #92300. >From 530b15d68c66b0f1414329a8e190b27c2e6bf106 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Thu, 16 May 2024 20:49:17 -0700 Subject: [PATCH] [clang-format] Fix a regression in annotating goto label

[clang] [clang-format] Fix a regression in annotating goto labels (PR #92494)

2024-05-16 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/92494 >From d9f113101028c68465e8befe7db1d4c206daa535 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Thu, 16 May 2024 20:49:17 -0700 Subject: [PATCH] [clang-format] Fix a bug in formatting goto labels in macros Fixes #92

[clang] [clang-format] Fix a bug in formatting goto labels in macros (PR #92494)

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

[clang] 2d5e488 - [clang-format][NFC] Clean up SortIncludesTest.cpp

2024-05-19 Thread Owen Pan via cfe-commits
Author: Owen Pan Date: 2024-05-19T15:19:05-07:00 New Revision: 2d5e488c98225108aebfe4aa4acfe6ec1f234a37 URL: https://github.com/llvm/llvm-project/commit/2d5e488c98225108aebfe4aa4acfe6ec1f234a37 DIFF: https://github.com/llvm/llvm-project/commit/2d5e488c98225108aebfe4aa4acfe6ec1f234a37.diff LOG:

[clang] 1c58208 - [clang-format][NFC] Remove redundnat llvm::, clang::, etc.

2024-05-20 Thread Owen Pan via cfe-commits
Author: Owen Pan Date: 2024-05-20T20:32:18-07:00 New Revision: 1c58208d899285318c89e069268145c85ec33368 URL: https://github.com/llvm/llvm-project/commit/1c58208d899285318c89e069268145c85ec33368 DIFF: https://github.com/llvm/llvm-project/commit/1c58208d899285318c89e069268145c85ec33368.diff LOG:

[clang] [clang-format] Add space after a word token (PR #92741)

2024-05-21 Thread Owen Pan via cfe-commits
owenca wrote: > Since I am by no means an expert on Clang, a few questions arose > > * As Clang formats the code correctly (no code changes necessary) when > instead of `xor` a different function name e.g. `xooor` is used, I wonder why > `xor` is tokenized as Unary operator in the first place

[clang] [clang-format] Add space after a word token (PR #92741)

2024-05-21 Thread Owen Pan via cfe-commits
@@ -5280,7 +5280,8 @@ bool TokenAnnotator::spaceRequiredBefore(const AnnotatedLine &Line, // handled. if (Left.is(tok::amp) && Right.is(tok::r_square)) return Style.SpacesInSquareBrackets; -return Style.SpaceAfterLogicalNot && Left.is(tok::exclaim); +retu

[clang] [clang-format] Fix a bug in formatting goto labels in macros (PR #92494)

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

[clang] [clang-format] Correctly annotate C++ alternative operators in C (PR #92880)

2024-05-21 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/92880 PR #90161 uncovered a bug that annotates C++ xor as UnaryOperator if followed by a binary operator. This patch fixes that and all other C++ alternative operator keywords when followed by a binary operator in C.

[clang] [clang-format] Correctly annotate C++ alternative operators in C (PR #92880)

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

[clang] [clang-format] Add space after a word token (PR #92741)

2024-05-21 Thread Owen Pan via cfe-commits
owenca wrote: See #92880. https://github.com/llvm/llvm-project/pull/92741 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format]: Annotate colons found in inline assembly (PR #92617)

2024-05-22 Thread Owen Pan via cfe-commits
@@ -1358,6 +1358,8 @@ class AnnotatingParser { Line.First->startsSequence(tok::kw_export, Keywords.kw_module) || Line.First->startsSequence(tok::kw_export, Keywords.kw_import)) { Tok->setType(TT_ModulePartitionColon); + } else if (Line.First->is

[clang] [clang-format]: Annotate colons found in inline assembly (PR #92617)

2024-05-22 Thread Owen Pan via cfe-commits
@@ -1489,11 +1489,25 @@ TEST_F(TokenAnnotatorTest, RequiresDoesNotChangeParsingOfTheRest) { TEST_F(TokenAnnotatorTest, UnderstandsAsm) { auto Tokens = annotate("__asm{\n" "a:\n" - "};"); - ASSERT_EQ(Tokens.size(), 7u) << Toke

[clang] [clang-format]: Annotate colons found in inline assembly (PR #92617)

2024-05-22 Thread Owen Pan via cfe-commits
@@ -1489,11 +1489,25 @@ TEST_F(TokenAnnotatorTest, RequiresDoesNotChangeParsingOfTheRest) { TEST_F(TokenAnnotatorTest, UnderstandsAsm) { auto Tokens = annotate("__asm{\n" "a:\n" - "};"); - ASSERT_EQ(Tokens.size(), 7u) << Toke

[clang] [clang-format]: Annotate colons found in inline assembly (PR #92617)

2024-05-23 Thread Owen Pan via cfe-commits
@@ -1488,12 +1488,91 @@ TEST_F(TokenAnnotatorTest, RequiresDoesNotChangeParsingOfTheRest) { TEST_F(TokenAnnotatorTest, UnderstandsAsm) { auto Tokens = annotate("__asm{\n" - "a:\n" - "};"); - ASSERT_EQ(Tokens.size(), 7u) << To

[clang] [clang-format]: Annotate colons found in inline assembly (PR #92617)

2024-05-23 Thread Owen Pan via cfe-commits
@@ -1426,12 +1428,9 @@ class AnnotatingParser { // the colon are passed as macro arguments. Tok->setType(TT_ObjCMethodExpr); } else if (Contexts.back().ContextKind == tok::l_paren && - !Line.InPragmaDirective) { -if (Style.isTableGe

[clang] [clang-format]: Annotate colons found in inline assembly (PR #92617)

2024-05-23 Thread Owen Pan via cfe-commits
@@ -1488,12 +1488,91 @@ TEST_F(TokenAnnotatorTest, RequiresDoesNotChangeParsingOfTheRest) { TEST_F(TokenAnnotatorTest, UnderstandsAsm) { auto Tokens = annotate("__asm{\n" - "a:\n" - "};"); - ASSERT_EQ(Tokens.size(), 7u) << To

[clang] [clang-format]: Annotate colons found in inline assembly (PR #92617)

2024-05-23 Thread Owen Pan via cfe-commits
@@ -1488,12 +1488,91 @@ TEST_F(TokenAnnotatorTest, RequiresDoesNotChangeParsingOfTheRest) { TEST_F(TokenAnnotatorTest, UnderstandsAsm) { auto Tokens = annotate("__asm{\n" - "a:\n" - "};"); - ASSERT_EQ(Tokens.size(), 7u) << To

[clang] [clang-format]: Annotate colons found in inline assembly (PR #92617)

2024-05-23 Thread Owen Pan via cfe-commits
@@ -1488,12 +1488,91 @@ TEST_F(TokenAnnotatorTest, RequiresDoesNotChangeParsingOfTheRest) { TEST_F(TokenAnnotatorTest, UnderstandsAsm) { auto Tokens = annotate("__asm{\n" - "a:\n" - "};"); - ASSERT_EQ(Tokens.size(), 7u) << To

[clang] [clang-format]: Annotate colons found in inline assembly (PR #92617)

2024-05-24 Thread Owen Pan via cfe-commits
https://github.com/owenca commented: It seems that you used 5 different assembly snippets and repeated each 3-6 times. Instead, we can have something like the following: ``` asm{Snippet 1}; __asm(Snippet 2); __asm__(Snippet 3); asm volatile (Snippet 4); __asm volatile (Snippet 5); ``` Also,

[clang] [clang-format]: Annotate colons found in inline assembly (PR #92617)

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

[clang] [clang-format]: Annotate colons found in inline assembly (PR #92617)

2024-05-24 Thread Owen Pan via cfe-commits
@@ -1488,12 +1488,247 @@ TEST_F(TokenAnnotatorTest, RequiresDoesNotChangeParsingOfTheRest) { TEST_F(TokenAnnotatorTest, UnderstandsAsm) { auto Tokens = annotate("__asm{\n" - "a:\n" - "};"); - ASSERT_EQ(Tokens.size(), 7u) << T

[clang] [clang-format]: Annotate colons found in inline assembly (PR #92617)

2024-05-24 Thread Owen Pan via cfe-commits
@@ -1488,12 +1488,247 @@ TEST_F(TokenAnnotatorTest, RequiresDoesNotChangeParsingOfTheRest) { TEST_F(TokenAnnotatorTest, UnderstandsAsm) { auto Tokens = annotate("__asm{\n" - "a:\n" - "};"); - ASSERT_EQ(Tokens.size(), 7u) << T

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

2024-05-24 Thread Owen Pan via cfe-commits
@@ -10539,6 +10539,17 @@ TEST_F(FormatTest, KeepStringLabelValuePairsOnALine) { " bbb);"); } +TEST_F(FormatTest, WrapBeforeInsertionOperatorbetweenStringLiterals) { + verifyFormat("QStringList() << \"foo\" << \"bar\";");

[clang] [clang-format]: Annotate colons found in inline assembly (PR #92617)

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

[clang] [clang-format]: Annotate colons found in inline assembly (PR #92617)

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

[clang] [clang-format]: Annotate colons found in inline assembly (PR #92617)

2024-05-25 Thread Owen Pan via cfe-commits
@@ -1488,12 +1488,81 @@ TEST_F(TokenAnnotatorTest, RequiresDoesNotChangeParsingOfTheRest) { TEST_F(TokenAnnotatorTest, UnderstandsAsm) { auto Tokens = annotate("__asm{\n" - "a:\n" - "};"); - ASSERT_EQ(Tokens.size(), 7u) << To

[clang] [clang-format]: Annotate colons found in inline assembly (PR #92617)

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

[clang] [clang-format]: Annotate colons found in inline assembly (PR #92617)

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

[clang] [clang-format]: Annotate colons found in inline assembly (PR #92617)

2024-05-25 Thread Owen Pan via cfe-commits
@@ -1488,12 +1488,81 @@ TEST_F(TokenAnnotatorTest, RequiresDoesNotChangeParsingOfTheRest) { TEST_F(TokenAnnotatorTest, UnderstandsAsm) { auto Tokens = annotate("__asm{\n" - "a:\n" - "};"); - ASSERT_EQ(Tokens.size(), 7u) << To

[clang] [clang-format]: Annotate colons found in inline assembly (PR #92617)

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

[clang] [clang-format] Add LeftWithLastLine to AlignEscapedNewlines option (PR #93402)

2024-05-26 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/93402 Closes #92999. >From fc9097e064e2d64832acc611b2a8d50d332119d6 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Sun, 26 May 2024 00:23:35 -0700 Subject: [PATCH] [clang-format] Add LeftWithLastLine to AlignEscapedNewl

[clang] [clang-format] Add SpacesInParensOption for filtering repeated parens (PR #77522)

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

[clang] [clang-format] Add SpacesInParensOption for filtering repeated parens (PR #77522)

2024-05-26 Thread Owen Pan via cfe-commits
https://github.com/owenca commented: I think we can simply check if a sequence of two `l_parens` have a matching sequence of two `r_parens` and insert spaces only if `ExceptDoubleParentheses` is false. https://github.com/llvm/llvm-project/pull/77522 ___

[clang] [clang-format] Add SpacesInParensOption for filtering repeated parens (PR #77522)

2024-05-26 Thread Owen Pan via cfe-commits
@@ -17265,6 +17317,268 @@ TEST_F(FormatTest, ConfigurableSpacesInParens) { verifyFormat("size_t idx = (a->foo)(a - 1);", Spaces); verifyFormat("size_t idx = (*foo)(a - 1);", Spaces); verifyFormat("size_t idx = (*(foo))(a - 1);", Spaces); + + // Check ExceptDoubleParenthe

[clang] Code implementing the SpacesInParensOptions.ExceptDoubleParentheses l… (PR #93439)

2024-05-26 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/93439 …ogic >From ac03e1506b5ea0d00038501c4f41d5b30c8fa2b3 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Sun, 26 May 2024 22:01:48 -0700 Subject: [PATCH] Code implementing the SpacesInParensOptions.ExceptDoubleParenth

[clang] Code implementing the SpacesInParensOptions.ExceptDoubleParentheses l… (PR #93439)

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

[clang] [clang-format] Add SpacesInParensOption for filtering repeated parens (PR #77522)

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

[clang] Code implementing SpacesInParensOptions.ExceptDoubleParentheses logic (PR #93439)

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

[clang] Code implementing SpacesInParensOptions.ExceptDoubleParentheses logic (PR #93439)

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

[clang] Code implementing SpacesInParensOptions.ExceptDoubleParentheses logic (PR #93439)

2024-05-27 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/93439 >From ac03e1506b5ea0d00038501c4f41d5b30c8fa2b3 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Sun, 26 May 2024 22:01:48 -0700 Subject: [PATCH 1/2] Code implementing the SpacesInParensOptions.ExceptDoubleParenthese

[clang] Code implementing SpacesInParensOptions.ExceptDoubleParentheses logic (PR #93439)

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

[clang] [clang-format] Add LeftWithLastLine to AlignEscapedNewlines option (PR #93402)

2024-05-27 Thread Owen Pan via cfe-commits
https://github.com/owenca closed https://github.com/llvm/llvm-project/pull/93402 ___ 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 formatting goto labels in macros (PR #92494)

2024-05-27 Thread Owen Pan via cfe-commits
https://github.com/owenca milestoned https://github.com/llvm/llvm-project/pull/92494 ___ 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 formatting goto labels in macros (PR #92494)

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

[clang] [clang-format] Insert a space between a keyword and a literal (PR #93632)

2024-05-28 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/93632 Fixes #93603. >From be3cb7662b789c7ffa61aab55c9390543cbab2ca Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Tue, 28 May 2024 19:36:36 -0700 Subject: [PATCH] [clang-format] Insert a space between a keyword and a li

[clang] [clang-format] Fix a regression in annotating class decl braces (PR #93657)

2024-05-29 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/93657 Fixes #93604. >From e853b7d6f13c152bfe57cec28a75507422f52edb Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Wed, 29 May 2024 00:49:10 -0700 Subject: [PATCH] [clang-format] Fix a regression in annotating class decl

[clang] [clang-format] Fix a regression in annotating class decl braces (PR #93657)

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

[clang] [clang-format] Insert a space between a keyword and a literal (PR #93632)

2024-05-29 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/93632 >From be3cb7662b789c7ffa61aab55c9390543cbab2ca Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Tue, 28 May 2024 19:36:36 -0700 Subject: [PATCH 1/2] [clang-format] Insert a space between a keyword and a literal Fix

[clang] [clang-format] add an option to insert a space only for non-code block empty braces, not for empty parentheses (PR #93634)

2024-05-29 Thread Owen Pan via cfe-commits
owenca wrote: See https://github.com/llvm/llvm-project/issues/93635#issuecomment-2138778128. Also, we need to deprecate [`SpaceInEmptyBlock`](https://clang.llvm.org/docs/ClangFormatStyleOptions.html#spaceinemptyblock). https://github.com/llvm/llvm-project/pull/93634 ___

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

2024-05-30 Thread Owen Pan via cfe-commits
owenca wrote: Please refer to e3eca335940251308c8990c8880341002e74b9c1 for grouping/deprecating existing options with a new one. https://github.com/llvm/llvm-project/pull/91221 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

[clang] [clang-format] Insert a space between a keyword and a literal (PR #93632)

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

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

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

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

2024-05-31 Thread Owen Pan via cfe-commits
owenca wrote: /cherry-pick https://github.com/llvm/llvm-project/commit/8fe39e64c0ef0a1aefce3c1187c5822343caeedd https://github.com/llvm/llvm-project/pull/92214 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mail

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

2024-05-31 Thread Owen Pan via cfe-commits
owenca wrote: We should backport it to 18.1.7 IMO. See #93034 and #93958. WDYT @mydeveloperday @HazardyKnusperkeks? https://github.com/llvm/llvm-project/pull/92214 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin

[clang] [clang-format] Handle attributes before lambda return arrow (PR #94119)

2024-06-01 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/94119 Fixes #92657. >From 0ef24a51b4f831c49efe956662764f0b2c2cca61 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Sat, 1 Jun 2024 12:53:08 -0700 Subject: [PATCH] [clang-format] Handle attributes before lambda return arr

[clang] [clang-format] Handle attributes before lambda return arrow (PR #94119)

2024-06-01 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/94119 >From 0ef24a51b4f831c49efe956662764f0b2c2cca61 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Sat, 1 Jun 2024 12:53:08 -0700 Subject: [PATCH 1/2] [clang-format] Handle attributes before lambda return arrow Fixes

[clang] [clang-format] Handle attributes before lambda return arrow (PR #94119)

2024-06-01 Thread Owen Pan via cfe-commits
owenca wrote: > Do we want a token annotator test? The bug was in the unwrapped line parser, but it doesn't hurt to add an annotator test. https://github.com/llvm/llvm-project/pull/94119 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https:/

[clang] [clang-format] Handle attributes before lambda return arrow (PR #94119)

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

[clang] f06f016 - [clang-format][NFC] Add missing parens of __attribute in unit tests

2024-06-02 Thread Owen Pan via cfe-commits
Author: Owen Pan Date: 2024-06-02T12:44:40-07:00 New Revision: f06f0164199d4a968d8336937cd5ef2c05946d8d URL: https://github.com/llvm/llvm-project/commit/f06f0164199d4a968d8336937cd5ef2c05946d8d DIFF: https://github.com/llvm/llvm-project/commit/f06f0164199d4a968d8336937cd5ef2c05946d8d.diff LOG:

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

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

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

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

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

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

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

2024-06-02 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] Improve BlockIndent at ColumnLimit (PR #93140)

2024-06-02 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

<    5   6   7   8   9   10   11   >