[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

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

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

[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
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] 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-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) <<

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

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

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

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

[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

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

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

2024-05-23 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) <<

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

2024-05-23 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) <<

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

2024-05-23 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

[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] 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] 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] 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] 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 , // handled. if (Left.is(tok::amp) && Right.is(tok::r_square)) return Style.SpacesInSquareBrackets; -return Style.SpaceAfterLogicalNot && Left.is(tok::exclaim); +return

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

[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

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

[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

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

[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

[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

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

[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

[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

[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] [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 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,

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

2024-05-13 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

[clang] 1fadb2b - Revert "[clang-format] Fix FormatToken::isSimpleTypeSpecifier() (#91712)"

2024-05-13 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

[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

[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

[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

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

2024-05-11 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

[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] [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.

[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

[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

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

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

[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] [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 ) { // the sequence "<::" will be unconditionally treated as "[:". // Cf. Lexer::LexTokenInternal. LangOpts.Digraphs = LexingStd >= FormatStyle::LS_Cpp11; + LangOpts.RawStringLiterals = LexingStd

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

[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

[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

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

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

2024-05-05 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

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

2024-05-04 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] Fix a crash with AlignArrayOfStructures option (PR #86420)

2024-05-04 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] 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 ) { // the sequence "<::" will be unconditionally treated as "[:". // Cf. Lexer::LexTokenInternal. LangOpts.Digraphs = LexingStd >= FormatStyle::LS_Cpp11; + LangOpts.RawStringLiterals = LexingStd

[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

[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

[clang] [llvm] [z/OS] treat text files as text files so auto-conversion is done (PR #90128)

2024-05-01 Thread Owen Pan via cfe-commits
@@ -413,8 +413,9 @@ static bool format(StringRef FileName, bool ErrorOnIncompleteFormat = false) { // On Windows, overwriting a file with an open file mapping doesn't work, // so read the whole file into memory when formatting in-place. ErrorOr> CodeOrErr = -

[clang] [clang-format] Fix a bug in annotating struct braces (PR #90555)

2024-04-30 Thread Owen Pan via cfe-commits
https://github.com/owenca closed https://github.com/llvm/llvm-project/pull/90555 ___ 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 struct braces (PR #90555)

2024-04-29 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/90555 Fixes #60040. >From 77d807d47d47ca9916edc03182e1952c27300a8a Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Mon, 29 Apr 2024 21:11:28 -0700 Subject: [PATCH] [clang-format] Fix a bug in annotating struct braces

[clang] [clang-format] Set Change.TokenLength to ColumnWidth (PR #90378)

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

[clang] [clang-format][NFC] Return early in isWordLike() for non-Verilog (PR #90363)

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

[clang] [clang-format] Set Change.TokenLength to ColumnWidth (PR #90378)

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

[clang] [clang-format] Set Change.TokenLength to ColumnWidth (PR #90378)

2024-04-28 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/90378 Fixes #47333. Fixes #47624. Fixes #75929. Fixes #87885. Fixes #89916. >From d671f32e9bcc6e42e53ddd1799eb0fdef774c142 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Sat, 27 Apr 2024 23:34:45 -0700 Subject: [PATCH]

[clang] [clang-format][NFC] Return early in isWordLike() for non-Verilog (PR #90363)

2024-04-27 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/90363 None >From 70e5f7df8711ac22450a441efe91ed7fa6e339f0 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Sat, 27 Apr 2024 15:16:43 -0700 Subject: [PATCH] [clang-format][NFC] Return early in isWordLike() for

[clang] b4af01b - [clang-format][NFC] Don't repeat Changes[i]/Changes[i - 1]

2024-04-27 Thread Owen Pan via cfe-commits
Author: Owen Pan Date: 2024-04-27T15:14:20-07:00 New Revision: b4af01bada0c945906d85c364e12aceaf98b0fae URL: https://github.com/llvm/llvm-project/commit/b4af01bada0c945906d85c364e12aceaf98b0fae DIFF: https://github.com/llvm/llvm-project/commit/b4af01bada0c945906d85c364e12aceaf98b0fae.diff

[clang] [clang-format] Add a space after a word token only if required (PR #90161)

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

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

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

[clang] [clang-format] Add a space after a word token only if required (PR #90161)

2024-04-25 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/90161 Fixes #78166. >From 3f59076142bd6a87f4875dc79e95e4570f4af7c2 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Thu, 25 Apr 2024 20:08:03 -0700 Subject: [PATCH] [clang-format] Add a space after a word token only if

[clang] [clang-format] adds a space after not inside macros (PR #78176)

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

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

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

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

2024-04-24 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] [clang-format] Do not update cursor pos if no includes replacement (PR #77456)

2024-04-24 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/77456 >From 6c184f9714c94af94c7692e1264061b8dc14e912 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

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

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

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

2024-04-24 Thread Owen Pan via cfe-commits
owenca wrote: > I have squashed the commits in only one. Note that I have left the failing > tests in the commit, I am not sure if I should remove them or not. Unfortunately, this wiped out my updates that fixed a formatting error and added `#if 0` for the failing tests.

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

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

[clang] [clang-format] Remove YAML hack to emit a BasedOnStyle comment (PR #89228)

2024-04-24 Thread Owen Pan via cfe-commits
https://github.com/owenca approved this pull request. https://github.com/llvm/llvm-project/pull/89228 ___ 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] [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] 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

[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

  1   2   3   4   5   6   7   8   9   10   >