[clang] [clang-format] Handle doxygen commands starting with \ (PR #80381)

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

[clang] [polly] [clang-format] Add Automatic and ExceptShortType options for AlwaysBreakAfterReturnType. (PR #78011)

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

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

2024-02-04 Thread Owen Pan via cfe-commits
@@ -24160,6 +24160,14 @@ TEST_F(FormatTest, AlternativeOperators) { verifyFormat("int a compl(5);"); verifyFormat("int a not(5);"); + verifyFormat("v(not)"); + verifyFormat("v(not!)"); + verifyFormat("Symbol(not, None)"); + verifyFormat("Symbol(not!, None)"); + + veri

[clang] [Format] Fix detection of languages when reading from stdin (PR #79051)

2024-02-04 Thread Owen Pan via cfe-commits
owenca wrote: @bhamiltoncx Thanks for the fix! Nevertheless, it seems that this triggered a new regression. See #80621. https://github.com/llvm/llvm-project/pull/79051 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-

[clang] [clang-format] Fix a regression in dumping the config (PR #80628)

2024-02-04 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/80628 Commit d813af73f70f addressed a regression introduced by commit 3791b3fca6ea but caused `clang-format -dump-config` to "hang". This patch reverts changes to ClangFormat.cpp by both 3791b3fca6ea and d813af73f70f an

[clang] [clang-format] Fix a regression in dumping the config (PR #80628)

2024-02-05 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/80628 >From d49f94ca7de184fb7859a2d6d3f85e9b9adcc041 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Sun, 4 Feb 2024 18:29:42 -0800 Subject: [PATCH 1/2] [clang-format] Fix a regression in dumping the config Commit d813af

[clang] [Format] Fix detection of languages when reading from stdin (PR #79051)

2024-02-06 Thread Owen Pan via cfe-commits
owenca wrote: Probably. See #80628 for a fix. https://github.com/llvm/llvm-project/pull/79051 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Add MainIncludeChar option. (PR #78752)

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

[clang] a628f68 - Revert "[clang] Mark clang-format-ignore.cpp as unsupported on Windows"

2024-02-06 Thread Owen Pan via cfe-commits
Author: Owen Pan Date: 2024-02-06T09:00:15-08:00 New Revision: a628f68a9c4ce6f3dcd0c8bb3650db45671ed15a URL: https://github.com/llvm/llvm-project/commit/a628f68a9c4ce6f3dcd0c8bb3650db45671ed15a DIFF: https://github.com/llvm/llvm-project/commit/a628f68a9c4ce6f3dcd0c8bb3650db45671ed15a.diff LOG:

[clang] [clang-format] Fix a regression in dumping the config (PR #80628)

2024-02-06 Thread Owen Pan via cfe-commits
@@ -1,5 +1,8 @@ +// RUN: clang-format -assume-filename=foo.m -dump-config | FileCheck %s owenca wrote: Yes, because it wouldn't make a difference before and after the patch. I don't think we can use lit to test that behavior (i.e., not waiting for an EOF) of cl

[clang] [clang-format] Add Leave to AlwaysBreakTemplateDeclarations (PR #80569)

2024-02-07 Thread Owen Pan via cfe-commits
https://github.com/owenca closed https://github.com/llvm/llvm-project/pull/80569 ___ 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 dumping the config (PR #80628)

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

[clang] [clang-format] Rename option AlwaysBreakTemplateDeclarations (PR #81093)

2024-02-07 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/81093 Drop the "Always" prefix to remove the self-contradiction. >From b9463c6664227edd6e579840292389909be04ab2 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Wed, 7 Feb 2024 22:43:15 -0800 Subject: [PATCH] [clang-forma

[clang] [clang-format] Rename option AlwaysBreakTemplateDeclarations (PR #81093)

2024-02-07 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/81093 >From b9463c6664227edd6e579840292389909be04ab2 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Wed, 7 Feb 2024 22:43:15 -0800 Subject: [PATCH 1/2] [clang-format] Rename option AlwaysBreakTemplateDeclarations Drop

[clang] [clang-format] Fix a regression in dumping the config (PR #80628)

2024-02-07 Thread Owen Pan via cfe-commits
https://github.com/owenca milestoned https://github.com/llvm/llvm-project/pull/80628 ___ 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 dumping the config (PR #80628)

2024-02-07 Thread Owen Pan via cfe-commits
owenca wrote: /cherry-pick 8f6e13e6da84 https://github.com/llvm/llvm-project/pull/80628 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Update FormatToken::isSimpleTypeSpecifier() (PR #80241)

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

[clang] [clang-format] Rename option AlwaysBreakTemplateDeclarations (PR #81093)

2024-02-08 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/81093 >From b9463c6664227edd6e579840292389909be04ab2 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Wed, 7 Feb 2024 22:43:15 -0800 Subject: [PATCH 1/3] [clang-format] Rename option AlwaysBreakTemplateDeclarations Drop

[clang] [clang-format] Add BreakAfterReturnType option to deprecate AlwaysBreakAfterReturnType. (PR #80827)

2024-02-08 Thread Owen Pan via cfe-commits
owenca wrote: @rmarker we only need to change the user-facing part and should leave the internal naming unchanged (at least in this patch) in order to have the smallest diff possible. I've added the support for deprecating/renaming top-level struct-type options to `dump_format_style.py` in #81

[clang] [clang-format] Add BreakAfterReturnType option to deprecate AlwaysBreakAfterReturnType. (PR #80827)

2024-02-08 Thread Owen Pan via cfe-commits
@@ -1010,7 +1010,8 @@ struct FormatStyle { /// \version 3.7 DefinitionReturnTypeBreakingStyle AlwaysBreakAfterDefinitionReturnType; - /// The function declaration return type breaking style to use. + /// The function declaration return type breaking style to use. This +

[clang] [clang-format][docs] Fix version (PR #81185)

2024-02-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. Good catch! https://github.com/llvm/llvm-project/pull/81185 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llv

[clang] 173e674 - [clang-format] Fix an out-of-bounds bug uncovered by 763139afc19d

2024-02-09 Thread Owen Pan via cfe-commits
Author: Owen Pan Date: 2024-02-09T00:21:09-08:00 New Revision: 173e674ba55eb93e8af43f2eece7feffe9954b34 URL: https://github.com/llvm/llvm-project/commit/173e674ba55eb93e8af43f2eece7feffe9954b34 DIFF: https://github.com/llvm/llvm-project/commit/173e674ba55eb93e8af43f2eece7feffe9954b34.diff LOG:

[clang] 5609bd8 - Revert "[clang-format] Update FormatToken::isSimpleTypeSpecifier() (#80241)"

2024-02-09 Thread Owen Pan via cfe-commits
Author: Owen Pan Date: 2024-02-09T01:52:41-08:00 New Revision: 5609bd83c3bd39a7522b05b32decc9e3c8ad08ae URL: https://github.com/llvm/llvm-project/commit/5609bd83c3bd39a7522b05b32decc9e3c8ad08ae DIFF: https://github.com/llvm/llvm-project/commit/5609bd83c3bd39a7522b05b32decc9e3c8ad08ae.diff LOG:

[clang] 245d772 - Revert "[clang-format] Fix an out-of-bounds bug uncovered by 763139afc19d"

2024-02-09 Thread Owen Pan via cfe-commits
Author: Owen Pan Date: 2024-02-09T01:53:47-08:00 New Revision: 245d7727d51548c3d5d867b69b1f9b1efff2502e URL: https://github.com/llvm/llvm-project/commit/245d7727d51548c3d5d867b69b1f9b1efff2502e DIFF: https://github.com/llvm/llvm-project/commit/245d7727d51548c3d5d867b69b1f9b1efff2502e.diff LOG:

[clang] 02362b1 - [clang-format] Check token size in QualifierFixerTest.cpp

2024-02-09 Thread Owen Pan via cfe-commits
Author: Owen Pan Date: 2024-02-09T02:14:50-08:00 New Revision: 02362b1ad1c07a01714b195d769400dd40dbfd04 URL: https://github.com/llvm/llvm-project/commit/02362b1ad1c07a01714b195d769400dd40dbfd04 DIFF: https://github.com/llvm/llvm-project/commit/02362b1ad1c07a01714b195d769400dd40dbfd04.diff LOG:

[clang] [clang-format] Rename option AlwaysBreakTemplateDeclarations (PR #81093)

2024-02-09 Thread Owen Pan via cfe-commits
owenca wrote: > I'd go contrary to your > [comment](https://github.com/llvm/llvm-project/pull/80827#issuecomment-1935386091) > and rename the attribute. Because otherwise you still have the contradiction > within the code. I was not against renaming the attribute there. I just wanted it to be

[clang] [clang-format] Rename option AlwaysBreakTemplateDeclarations (PR #81093)

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

[clang] 7664ddf - [clang-format][NFC] Drop "Always" in "AlwaysBreakTemplateDeclarations"

2024-02-09 Thread Owen Pan via cfe-commits
Author: Owen Pan Date: 2024-02-09T20:18:24-08:00 New Revision: 7664ddf8811242295abb837640cad8dd8cefb5e8 URL: https://github.com/llvm/llvm-project/commit/7664ddf8811242295abb837640cad8dd8cefb5e8 DIFF: https://github.com/llvm/llvm-project/commit/7664ddf8811242295abb837640cad8dd8cefb5e8.diff LOG:

[clang] [clang-format] Add BreakAfterReturnType option to deprecate AlwaysBreakAfterReturnType. (PR #80827)

2024-02-09 Thread Owen Pan via cfe-commits
owenca wrote: See the follow-up commit 7664ddf88112 to #81093. https://github.com/llvm/llvm-project/pull/80827 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

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

[clang] [clang-format] Add SkipMacroDefinitionBody option (PR #78682)

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

[clang] [llvm] [clang-tools-extra] [clang-format] Option to ignore macro definitions (PR #70338)

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

[clang] [clang-format] Add MainIncludeChar option. (PR #78752)

2024-01-20 Thread Owen Pan via cfe-commits
@@ -0,0 +1,27 @@ +// Test the combination of regrouped include directives, via regexes and owenca wrote: > Ok I will move them there, thanks :) Should I remove these lit tests or are > they complementary? Please remove them from the lit tests. https://github.c

[clang] [clang-format] Fix poor spacing in `AlignArrayOfStructures: Left` (PR #77868)

2024-01-20 Thread Owen Pan via cfe-commits
@@ -1366,11 +1366,12 @@ void WhitespaceManager::alignArrayInitializersLeftJustified( auto &Cells = CellDescs.Cells; // Now go through and fixup the spaces. auto *CellIter = Cells.begin(); - // The first cell needs to be against the left brace. - if (Changes[CellIter->I

[clang] [clang-format] Fix poor spacing in `AlignArrayOfStructures: Left` (PR #77868)

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

[clang] [clang-format] Fix poor spacing in `AlignArrayOfStructures: Left` (PR #77868)

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

[clang] [clang-format] Handle templated elaborated type specifier in function… (PR #77013)

2024-01-20 Thread Owen Pan via cfe-commits
@@ -14583,9 +14583,10 @@ TEST_F(FormatTest, UnderstandContextOfRecordTypeKeywords) { verifyFormat("template <> struct X < 15, i<3 && 42 < 50 && 33 < 28> {};"); verifyFormat("int i = SomeFunction(a b);"); - // FIXME: - // This now gets parsed incorrectly as class definit

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

2024-01-20 Thread Owen Pan via cfe-commits
owenca wrote: > Covering all double parens in a single sub-option is not precise enough for > code bases that may want to have `__attribute__(( x ))` but also allow `if ( > ( x ) )`. We should not go overboard with supporting all kinds of options/suboptions imaginable. I don't think we should

[clang] [clang-format]: Fix formatting of if statements with BlockIndent (PR #77699)

2024-01-20 Thread Owen Pan via cfe-commits
@@ -768,15 +768,25 @@ void ContinuationIndenter::addTokenOnCurrentLine(LineState &State, bool DryRun, // parenthesis by disallowing any further line breaks if there is no line // break after the opening parenthesis. Don't break if it doesn't conserve // columns. + const

[clang] [clang-format]: Fix formatting of if statements with BlockIndent (PR #77699)

2024-01-20 Thread Owen Pan via cfe-commits
@@ -768,15 +768,25 @@ void ContinuationIndenter::addTokenOnCurrentLine(LineState &State, bool DryRun, // parenthesis by disallowing any further line breaks if there is no line // break after the opening parenthesis. Don't break if it doesn't conserve // columns. + const

[clang] [clang-format] Handle templated elaborated type specifier in function… (PR #77013)

2024-01-20 Thread Owen Pan via cfe-commits
@@ -3873,6 +3873,9 @@ void UnwrappedLineParser::parseRecord(bool ParseAsExpr) { const FormatToken &InitialToken = *FormatTok; nextToken(); + auto IsNonMacroIdentifier = [](FormatToken *Tok) { owenca wrote: Nit: ```suggestion auto IsNonMacroIdentifier =

[clang] [clang-format] Handle templated elaborated type specifier in function… (PR #77013)

2024-01-20 Thread Owen Pan via cfe-commits
https://github.com/owenca closed https://github.com/llvm/llvm-project/pull/77013 ___ 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 attributes and filtering for repeated parens (PR #77522)

2024-01-20 Thread Owen Pan via cfe-commits
owenca wrote: > The code is [self-hosted](https://git.rtems.org/rtems/) and [mirrored on > GitHub](https://github.com/RTEMS/rtems) with a [documented style > guide](https://docs.rtems.org/branches/master/eng/coding-formatting.html). In > addition, I have been and will continue to be willing to

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

2024-01-21 Thread Owen Pan via cfe-commits
owenca wrote: > > Would `__attribute__((noreturn))`, `if ((i = j))`, `decltype((x))`, and > > `while (((i + 1) * j - 2) * k > 3)` be formatted as `__attribute__(( > > noreturn ))`, `if (( i = j ))`, `decltype(( x ))`, and `while ( ( ( i + 1 ) > > * j - 2 ) * k > 3 )`, respectively? > > Almost

[clang] [clang-format] Fix a bug in ContinuationIndenter (PR #78921)

2024-01-21 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/78921 Fixes #76991. >From bc3f566b7c512434179241796a2d7d4ac3e7b381 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Sun, 21 Jan 2024 17:14:53 -0800 Subject: [PATCH] [clang-format] Fix a bug in ContinuationIndenter Fixes

[clang] [clang-format]: Fix formatting of if statements with BlockIndent (PR #77699)

2024-01-21 Thread Owen Pan via cfe-commits
https://github.com/owenca approved this pull request. https://github.com/llvm/llvm-project/pull/77699 ___ 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 attributes and filtering for repeated parens (PR #77522)

2024-01-21 Thread Owen Pan via cfe-commits
owenca wrote: > > It seems adding a boolean sub-option that targets double pairs of > > parentheses as I suggested before is feasible although a better name than > > `ConsecutiveParentheses` may be needed. > > I'm fine to fix but request a concrete suggestion or proposal before I spend > much

[clang] [clang-format] Allow decltype in requires clause (PR #78847)

2024-01-21 Thread Owen Pan via cfe-commits
@@ -1071,6 +1071,16 @@ TEST_F(TokenAnnotatorTest, UnderstandsRequiresClausesAndConcepts) { "concept C = (!Foo) && Bar;"); owenca wrote: +1. You don't even need to create a pull request for this kind of NFC changes. https://github.com/llvm/l

[clang] [clang-format] Allow decltype in requires clause (PR #78847)

2024-01-21 Thread Owen Pan via cfe-commits
@@ -1071,6 +1071,37 @@ TEST_F(TokenAnnotatorTest, UnderstandsRequiresClausesAndConcepts) { "concept C = (!Foo) && Bar;"); ASSERT_EQ(Tokens.size(), 19u) << Tokens; EXPECT_TOKEN(Tokens[15], tok::ampamp, TT_BinaryOperator); + + Tokens = annotate("void f()

[clang] [clang-format] Allow decltype in requires clause (PR #78847)

2024-01-21 Thread Owen Pan via cfe-commits
@@ -1071,6 +1071,16 @@ TEST_F(TokenAnnotatorTest, UnderstandsRequiresClausesAndConcepts) { "concept C = (!Foo) && Bar;"); ASSERT_EQ(Tokens.size(), 19u) << Tokens; EXPECT_TOKEN(Tokens[15], tok::ampamp, TT_BinaryOperator); + + Tokens = annotate("void f()

[clang] [flang] [lld] [clang-tools-extra] [llvm] [libcxx] [lldb] [mlir] [compiler-rt] [clang-format] Add ShortReturnTypeColumn option. (PR #78011)

2024-01-21 Thread Owen Pan via cfe-commits
owenca wrote: > @mydeveloperday, do you have an opinion on this pull request? It addresses > #78010 with minimal changes, or are you interested in exploring other > possibilities? It's weird to add such a top-level option to fix a bug and keep the current behavior. See https://github.com/llv

[clang] Improved is simple type specifier (PR #78903)

2024-01-22 Thread Owen Pan via cfe-commits
owenca wrote: > Here's the sort of approach I"m looking at @owenca Can you restore the clang-format files for this pull request? I'll open another PR that depends on this one. https://github.com/llvm/llvm-project/pull/78903 ___ cfe-commits mailing li

[clang] [clang-format] BreakAfterAttributes did not take into account gnu attributes (PR #78102)

2024-01-22 Thread Owen Pan via cfe-commits
owenca wrote: > You either have to use a new option, or adapt the documentation. Latter > clearly only refers to `C++11 attributes`, which `__attribute__(())` isn't. > > I don't think a new option is needed. > > When you are already at it, you may also consider handling `__declspec()`. +1. h

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

2024-01-22 Thread Owen Pan via cfe-commits
@@ -4842,19 +4842,19 @@ bool TokenAnnotator::spaceRequiredBefore(const AnnotatedLine &Line, return true; } if (Left.is(TT_UnaryOperator)) { -if (Right.isNot(tok::l_paren)) { +if (Right.isOneOf(tok::identifier, tok::numeric_constant)) { // The alternative

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

2024-01-22 Thread Owen Pan via cfe-commits
@@ -24160,6 +24160,14 @@ TEST_F(FormatTest, AlternativeOperators) { verifyFormat("int a compl(5);"); verifyFormat("int a not(5);"); + verifyFormat("v(not)"); + verifyFormat("v(not!)"); + verifyFormat("Symbol(not, None)"); + verifyFormat("Symbol(not!, None)"); + + veri

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

2024-01-22 Thread Owen Pan via cfe-commits
@@ -4842,19 +4842,19 @@ bool TokenAnnotator::spaceRequiredBefore(const AnnotatedLine &Line, return true; } if (Left.is(TT_UnaryOperator)) { -if (Right.isNot(tok::l_paren)) { +if (Right.isOneOf(tok::identifier, tok::numeric_constant)) { // The alternative

[clang] [clang-format] Fix a bug in ContinuationIndenter (PR #78921)

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

[clang] [clang-format]: Fix formatting of if statements with BlockIndent (PR #77699)

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

[clang] [clang-format] Allow decltype in requires clause (PR #78847)

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

[clang] [clang-format] Update FormatToken::isSimpleTypeSpecifier() (PR #79115)

2024-01-23 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/79115 Depends on #79037. >From 61a06b77e8e6f2b5c5a9a2aa0b7f46260545f5b4 Mon Sep 17 00:00:00 2001 From: Carl Peto Date: Mon, 22 Jan 2024 18:52:46 + Subject: [PATCH 1/2] [clang] - Sema::isSimpleTypeSpecifier return t

[clang] [clang-format] Update FormatToken::isSimpleTypeSpecifier() (PR #79115)

2024-01-23 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/79115 >From 6d11eaa2c9b5de0b42b82c6b52b35eca44b5d772 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Tue, 23 Jan 2024 02:35:09 -0800 Subject: [PATCH] [clang-format] Update FormatToken::isSimpleTypeSpecifier() --- clang/

[clang] [clang-format] Update FormatToken::isSimpleTypeSpecifier() (PR #79115)

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

[clang] [clang] Improved isSimpleTypeSpecifier (PR #79037)

2024-01-24 Thread Owen Pan via cfe-commits
owenca wrote: See https://discourse.llvm.org/t/should-issimpletypespecifier-return-true-for-bool/74873/16. https://github.com/llvm/llvm-project/pull/79037 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/l

[clang-tools-extra] [clang] [llvm] [clang-format] Option to ignore macro definitions (PR #70338)

2024-01-24 Thread Owen Pan via cfe-commits
@@ -1157,7 +1157,15 @@ void UnwrappedLineParser::parsePPDefine() { // guard processing above, and changes preprocessing nesting. FormatTok->Tok.setKind(tok::identifier); FormatTok->Tok.setIdentifierInfo(Keywords.kw_internal_ident_after_define); - nextToken(); + + if (St

[clang] [clang-format] Fix a bug in AnnotatingParser::rParenEndsCast() (PR #79549)

2024-01-25 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/79549 Fixes #78965. >From 550ab825a339307ecf2f02fe12ba987ab1351bf9 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Thu, 25 Jan 2024 20:16:37 -0800 Subject: [PATCH] [clang-format] Fix a bug in AnnotatingParser::rParenEnd

[clang] [clang-format][NFC] Use FileCheck for clang-format-ignore lit test (PR #77977)

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

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

2024-01-15 Thread Owen Pan via cfe-commits
@@ -4842,7 +4842,7 @@ bool TokenAnnotator::spaceRequiredBefore(const AnnotatedLine &Line, return true; } if (Left.is(TT_UnaryOperator)) { -if (Right.isNot(tok::l_paren)) { +if (!Right.isOneOf(tok::r_paren, tok::l_paren, tok::exclaim)) { owenca

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

2024-01-15 Thread Owen Pan via cfe-commits
owenca wrote: > I think this is kind of too specific. +1. > Also I agree with [#78166 > (comment)](https://github.com/llvm/llvm-project/issues/78166#issuecomment-1892311219) > that `WhitespaceSensitiveMacros` should be used. I don't think we should require that the option be used. https://g

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

2024-01-16 Thread Owen Pan via cfe-commits
owenca wrote: This should work: ``` --- a/clang/lib/Format/TokenAnnotator.cpp +++ b/clang/lib/Format/TokenAnnotator.cpp @@ -4402,9 +4402,17 @@ bool TokenAnnotator::spaceRequiredBefore(const AnnotatedLine &Line, if (Left.Finalized) return Right.hasWhitespaceBefore(); - // Never ever me

[clang-tools-extra] [clang] [llvm] [clang-format] Option to ignore macro definitions (PR #70338)

2024-01-18 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/70338 >From 25ca978ef9caf372997f2ebf227fb2b2ca443aa0 Mon Sep 17 00:00:00 2001 From: Tomek Paszek Date: Sat, 11 Nov 2023 19:38:00 +0100 Subject: [PATCH 01/15] Added an option to ignore macro definitions. --- clang/incl

[clang] [clang-format] Add SkipMacroDefinitionBody option (PR #78682)

2024-01-19 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/78682 Closes #67991. Co-authored-by: @tomekpaszek >From 620e614b242055c3b8cbd81efd9bbc64a0ee4e56 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Thu, 18 Jan 2024 23:34:13 -0800 Subject: [PATCH] [clang-format] Option to

[clang] [clang-format] Add SkipMacroDefinitionBody option (PR #78682)

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

[clang] [clang-tools-extra] [clang-format] Aggregate options regarding empty lines (PR #96770)

2024-06-28 Thread Owen Pan via cfe-commits
owenca wrote: > This patch was initially part of > [9267f8f](https://github.com/llvm/llvm-project/commit/9267f8f19a2e502ef5a216c0d52b352b3699d399). > I neglected to check the server builds before I added it. It broke clangd. > Jie Fu fixed the problem in > [4c91b49](https://github.com/llvm/ll

[clang] [clang-format] Allow ternary in all templates (PR #96801)

2024-06-28 Thread Owen Pan via cfe-commits
https://github.com/owenca approved this pull request. https://github.com/llvm/llvm-project/pull/96801 ___ 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-07-01 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/77522 >From 4a7489251b842da778dd839bd5af3db12ba0fe0b Mon Sep 17 00:00:00 2001 From: Gedare Bloom Date: Mon, 17 Jul 2023 18:24:30 -0600 Subject: [PATCH 1/5] Add SpaceInParensOption ExceptDoubleParentheses This change al

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

2024-07-02 Thread Owen Pan via cfe-commits
https://github.com/owenca closed 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-07-02 Thread Owen Pan via cfe-commits
https://github.com/owenca closed 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] Skip block commented out includes when sorting them (PR #97787)

2024-07-04 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/97787 Fixes #97539. >From 73d92b38268e5b44d6ed7e6ac9219267003cc7fb Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Thu, 4 Jul 2024 21:39:38 -0700 Subject: [PATCH] [clang-format] Skip block commented out includes when sor

[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-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] 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. https://github.com/ll

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

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

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

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

[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 non-Verilog

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

2024-04-27 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] 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][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 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] 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 Fi

[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] [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 = - !Outpu

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

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

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

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

<    3   4   5   6   7   8   9   10   11   >