[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

[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] 2fbc9f2 - [clang-format][doc] Clean up quotes, etc.

2024-06-02 Thread Owen Pan via cfe-commits
Author: Owen Pan Date: 2024-06-02T16:45:17-07:00 New Revision: 2fbc9f217e5fe8db8444a87dbd7138a768b8aa85 URL: https://github.com/llvm/llvm-project/commit/2fbc9f217e5fe8db8444a87dbd7138a768b8aa85 DIFF: https://github.com/llvm/llvm-project/commit/2fbc9f217e5fe8db8444a87dbd7138a768b8aa85.diff LOG:

[clang] d7d2d4f - [clang-format] Fix documentation build error

2024-06-02 Thread Owen Pan via cfe-commits
Author: Owen Pan Date: 2024-06-02T18:03:12-07:00 New Revision: d7d2d4f53fc79b4b58e8d8d08151b577c3699d4a URL: https://github.com/llvm/llvm-project/commit/d7d2d4f53fc79b4b58e8d8d08151b577c3699d4a DIFF: https://github.com/llvm/llvm-project/commit/d7d2d4f53fc79b4b58e8d8d08151b577c3699d4a.diff LOG:

[clang] [clang-format] Handle AttributeMacros in parseRecord() (PR #94189)

2024-06-03 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/94189 Fixes #94184. >From 45c818098c1eedd72b82e9b5362538e2781698ab Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Mon, 3 Jun 2024 00:40:18 -0700 Subject: [PATCH] [clang-format] Handle AttributeMacros in parseRecord() F

[clang] f4a7f81 - [clang-format][doc] Minor cleanup

2024-06-03 Thread Owen Pan via cfe-commits
Author: Owen Pan Date: 2024-06-03T01:04:05-07:00 New Revision: f4a7f81a914ca8aceddd9b7a71e36bb0828ae052 URL: https://github.com/llvm/llvm-project/commit/f4a7f81a914ca8aceddd9b7a71e36bb0828ae052 DIFF: https://github.com/llvm/llvm-project/commit/f4a7f81a914ca8aceddd9b7a71e36bb0828ae052.diff LOG:

[clang] [clang-format] Handle AttributeMacros in parseRecord() (PR #94189)

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

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

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

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

2024-06-03 Thread Owen Pan via cfe-commits
https://github.com/owenca commented: Can you call `parseConfiguration()` instead of `getStyle()` in QtCreator while the user is entering code? It seems inefficient to call `getStyle()` all the time. https://github.com/llvm/llvm-project/pull/91317 ___

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

2024-06-03 Thread Owen Pan via cfe-commits
@@ -4026,12 +4030,13 @@ Expected getStyle(StringRef StyleName, StringRef FileName, // Reset possible inheritance Style.InheritsParentConfig = false; - auto dropDiagnosticHandler = [](const llvm::SMDiagnostic &, void *) {}; + auto diagHandlerOrDropHandling = + DiagH

[clang] [clang-format] Handle AttributeMacros in parseRecord() (PR #94189)

2024-06-03 Thread Owen Pan via cfe-commits
owenca wrote: > As noted in the issue, I think it should also keep working without the > attribute macro. (I'd be fine with the all upper case is a macro heuristic.) See https://github.com/llvm/llvm-project/issues/94184#issuecomment-2146557923. https://github.com/llvm/llvm-project/pull/94189 _

[clang] [clang-format] Allow open brace with trailing comment (no line break) (PR #89956)

2024-06-03 Thread Owen Pan via cfe-commits
owenca wrote: > > Ping > > Your PR is a draft, otherwise it would have been auto tagged and reviewers > would be informed. @GertyP can you remove the Draft status? https://github.com/llvm/llvm-project/pull/89956 ___ cfe-commits mailing list cfe-comm

[clang] [clang-format] Allow open brace with trailing comment (no line break) (PR #89956)

2024-06-03 Thread Owen Pan via cfe-commits
owenca wrote: IMO breaking before a trailing comment is a bug. Can we fix it without adding an option? If not, we should add one (e.g. `BreakBeforeTrailingComment`) instead of using `AlignTrailingComments`. https://github.com/llvm/llvm-project/pull/89956 ___

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

2024-06-03 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-06-03 Thread Owen Pan via cfe-commits
@@ -4650,10 +4650,23 @@ struct FormatStyle { /// # Should be declared this way: /// SpacesInParens: Custom /// SpacesInParensOptions: + /// ExceptDoubleParentheses: false /// InConditionalStatements: true /// Other: true /// \endcode struct

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

2024-06-03 Thread Owen Pan via cfe-commits
@@ -1175,8 +1176,8 @@ template <> struct MappingTraits { (SpacesInParentheses || SpaceInEmptyParentheses || SpacesInConditionalStatement || SpacesInCStyleCastParentheses)) { if (SpacesInParentheses) { -// set all options except InCStyleCasts and I

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

2024-06-03 Thread Owen Pan via cfe-commits
@@ -4681,23 +4695,30 @@ struct FormatStyle { bool InEmptyParentheses; /// Put a space in parentheses not covered by preceding options. /// \code -///true: false: -///t f( Deleted & ) & = delete; vs. t f(Deleted

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

2024-06-03 Thread Owen Pan via cfe-commits
https://github.com/owenca commented: Do we need all these new test cases? If yes, consider moving the test (and other `ConfigurableSpacesIn...` tests) to a separate file. https://github.com/llvm/llvm-project/pull/77522 ___ cfe-commits mailing list cfe

[clang] [clang-format] Allow open brace with trailing comment (no line break) (PR #89956)

2024-06-04 Thread Owen Pan via cfe-commits
owenca wrote: > @owenca Re. draft status: I thought a draft would be a better way (less > presumptuous, more tentative suggestion) to present one particular solution, > while acknowledging the possibility of alternatives. If that's not really the > way a draft is used or if it's more of a prob

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

2024-06-04 Thread Owen Pan via cfe-commits
@@ -4026,12 +4030,13 @@ Expected getStyle(StringRef StyleName, StringRef FileName, // Reset possible inheritance Style.InheritsParentConfig = false; - auto dropDiagnosticHandler = [](const llvm::SMDiagnostic &, void *) {}; + auto diagHandlerOrDropHandling = + DiagH

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

2024-06-04 Thread Owen Pan via cfe-commits
@@ -4026,12 +4030,13 @@ Expected getStyle(StringRef StyleName, StringRef FileName, // Reset possible inheritance Style.InheritsParentConfig = false; - auto dropDiagnosticHandler = [](const llvm::SMDiagnostic &, void *) {}; + auto diagHandlerOrDropHandling = + DiagH

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

2024-06-04 Thread Owen Pan via cfe-commits
@@ -3945,20 +3945,23 @@ const char *DefaultFallbackStyle = "LLVM"; llvm::ErrorOr> loadAndParseConfigFile(StringRef ConfigFile, llvm::vfs::FileSystem *FS, - FormatStyle *Style, bool AllowUnknownOptions) { + FormatStyle *Style, bool Al

[clang] [clang-format] Don't format comments in SkipMacroDefinitionBody (PR #94425)

2024-06-04 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/94425 Fixes #94326. >From 7e4c3e6b5b77085f795d6ccdfbf7279e32741b16 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Tue, 4 Jun 2024 21:10:14 -0700 Subject: [PATCH] [clang-format] Don't format comments in SkipMacroDefinit

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

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

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

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

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

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

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

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

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

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

[clang] [clang-format] Fix a bug in annotating CastRParen before unary && (PR #89346)

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

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

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

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

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

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

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

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

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

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

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

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

2024-04-19 Thread Owen Pan via cfe-commits
owenca wrote: Ah, I still need to do that. https://github.com/llvm/llvm-project/pull/87953 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

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

[clang] [clang-format] Fix a regression in annotating BK_BracedInit (PR #87450)

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

[clang] [clang-format] Fix a regression in ContinuationIndenter (PR #88414)

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

[clang] [clang-format] Fix a regression in annotating TrailingReturnArrow (PR #86624)

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

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

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

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

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

[clang] [clang-format] Fix a bug in annotating CastRParen before unary && (PR #89346)

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

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

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

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

2024-07-23 Thread Owen Pan via cfe-commits
owenca wrote: > Fixes #73584 Seems it's not fixed yet: ``` $ cat test.cpp { PyObjectPtr const readinto_method_obj{ PyObject_GetAttrString(input_stream, "readinto")}; } $ clang-format test.cpp { PyObjectPtr const readinto_method_obj{PyObject_GetAttrString(input_stream, "readi

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

2024-07-23 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/93140 >From 09bd1f04730f0accad7ce041b0121f716cc7a18d Mon Sep 17 00:00:00 2001 From: Gedare Bloom Date: Tue, 21 May 2024 22:21:59 -0600 Subject: [PATCH 01/13] [clang-format] Improve BlockIndent at ColumnLimit Fixes #557

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

2024-07-23 Thread Owen Pan via cfe-commits
https://github.com/owenca edited https://github.com/llvm/llvm-project/pull/93140 ___ 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-07-23 Thread Owen Pan via cfe-commits
https://github.com/owenca approved this pull request. https://github.com/llvm/llvm-project/pull/93140 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 7e7a906 - Revert "[clang-format] Fix a bug in annotating `*` in `#define`s (#99433)"

2024-07-24 Thread Owen Pan via cfe-commits
Author: Owen Pan Date: 2024-07-24T19:33:44-07:00 New Revision: 7e7a9069d4240d2ae619cb50eba09f948c537ce3 URL: https://github.com/llvm/llvm-project/commit/7e7a9069d4240d2ae619cb50eba09f948c537ce3 DIFF: https://github.com/llvm/llvm-project/commit/7e7a9069d4240d2ae619cb50eba09f948c537ce3.diff LOG:

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

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

[clang] [clang-format] Handle parenthesized list in RemoveParentheses (PR #100852)

2024-07-26 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/100852 Also, reformat clang-format source to remove redundant parentheses enclosing single list items. Fixes #100768. >From f06f3ab5e59217348e72179c9581be338efa8789 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Fri,

[clang] [clang-format] Fix misannotations of `<` in ternary expressions (PR #100980)

2024-07-29 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/100980 Fixes #100300. >From 594a3517f9074cd2794366d3fba5fb4679785ce8 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Mon, 29 Jul 2024 00:19:02 -0700 Subject: [PATCH] [clang-format] Fix misannotations of `<` in ternary e

[clang] [clang-format] Fix a misannotation of PointerOrReference (PR #101291)

2024-07-30 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/101291 Fixes #101138. >From 0a162016899abb8a477e0fedad5be0416464ad4a Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Tue, 30 Jul 2024 23:20:12 -0700 Subject: [PATCH] [clang-format] Fix a misannotation of PointerOrReferen

[clang] [clang-format] Fix a misannotation of PointerOrReference (PR #101291)

2024-07-30 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/101291 >From c59345d3b70a5343af22f78837ef8a47bea35e41 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Tue, 30 Jul 2024 23:20:12 -0700 Subject: [PATCH] [clang-format] Fix a misannotation of PointerOrReference Fixes #10113

[clang] [clang-format] Fix a bug in SpaceBeforeParensOptions (PR #98849)

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

[clang] [clang-format] Add BinPackBinaryOperations configuration (PR #95013)

2024-07-15 Thread Owen Pan via cfe-commits
owenca wrote: This patch doesn't seem to work with the last two examples in #79487: ``` $ cat foo.cc template concept my_concept = std::is_object_v && std::is_const_v && std::default_initializable; std::uint32_t a = byte_buffer[0] | byte_buffer[1] << 8 | byte_buffer[

[clang] [clang-format] Add BinPackBinaryOperations configuration (PR #95013)

2024-07-15 Thread Owen Pan via cfe-commits
owenca wrote: It seems that this patch implements the new option without regard to the relative precedence of the binary operators: ``` $ cat bar.cc f1 = f2 * f3 + f4 / f5 - f6; $ clang-format -style='{BinPa

[clang] [clang-format] Add BinPackBinaryOperations configuration (PR #95013)

2024-07-17 Thread Owen Pan via cfe-commits
owenca wrote: It seems [AlignOperands](https://clang.llvm.org/docs/ClangFormatStyleOptions.html#alignoperands) is supposed to do what this new option would, so maybe we should fix/extend `AlignOperands` instead? https://github.com/llvm/llvm-project/pull/95013 _

[clang] [clang-format] Fix a bug in annotating `*` in `#define`s (PR #99433)

2024-07-17 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/99433 Fixes #99271. >From ebf25d890ff47be48bd153942d943906943a247b Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Wed, 17 Jul 2024 22:30:21 -0700 Subject: [PATCH] [clang-format] Fix a bug in annotating `*` in `#define`s

[clang] [clang-format] Fix a bug in annotating `*` in `#define`s (PR #99433)

2024-07-19 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/99433 >From ebf25d890ff47be48bd153942d943906943a247b Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Wed, 17 Jul 2024 22:30:21 -0700 Subject: [PATCH 1/2] [clang-format] Fix a bug in annotating `*` in `#define`s Fixes #99

[clang] [clang-format] Fix a bug in annotating `*` in `#define`s (PR #99433)

2024-07-19 Thread Owen Pan via cfe-commits
owenca wrote: > How about judging whether the FunctionLBrace exists as the opener of the > outer context? That wouldn't work as we must also handle function calls at the top level when dealing with macro definitions. https://github.com/llvm/llvm-project/pull/99433

[clang] [clang-format] Fix a bug in annotating `*` in `#define`s (PR #99433)

2024-07-19 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/99433 >From ebf25d890ff47be48bd153942d943906943a247b Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Wed, 17 Jul 2024 22:30:21 -0700 Subject: [PATCH 1/3] [clang-format] Fix a bug in annotating `*` in `#define`s Fixes #99

[clang] [clang-format] Fix a bug in annotating `*` in `#define`s (PR #99433)

2024-07-20 Thread Owen Pan via cfe-commits
https://github.com/owenca closed https://github.com/llvm/llvm-project/pull/99433 ___ 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 StartOfName (PR #99791)

2024-07-20 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/99791 Fixes #99758. >From f38256c028e1600bc6b957f851ffcc0dedab589c Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Sat, 20 Jul 2024 16:43:39 -0700 Subject: [PATCH] [clang-format] Fix a bug in annotating StartOfName Fixe

[clang] [clang-format] Fix a bug in annotating FunctionAnnotationRParen (PR #99802)

2024-07-21 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/99802 Fixes #37906. >From a24f1411ba233e9f14ffa87e6abd139616b8cfed Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Sun, 21 Jul 2024 00:08:20 -0700 Subject: [PATCH] [clang-format] Fix a bug in annotating FunctionAnnotati

[clang] [clang-format] Fix a bug in annotating StartOfName (PR #99791)

2024-07-21 Thread Owen Pan via cfe-commits
https://github.com/owenca closed https://github.com/llvm/llvm-project/pull/99791 ___ 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 FunctionAnnotationRParen (PR #99802)

2024-07-21 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/99802 >From a24f1411ba233e9f14ffa87e6abd139616b8cfed Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Sun, 21 Jul 2024 00:08:20 -0700 Subject: [PATCH 1/2] [clang-format] Fix a bug in annotating FunctionAnnotationRParen F

[clang] [clang-format] Fix a bug in annotating FunctionAnnotationRParen (PR #99802)

2024-07-21 Thread Owen Pan via cfe-commits
https://github.com/owenca closed https://github.com/llvm/llvm-project/pull/99802 ___ 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-07-22 Thread Owen Pan via cfe-commits
owenca wrote: You can annotate the lambda l_paren: ``` $ git diff FormatToken.h diff --git a/clang/lib/Format/FormatToken.h b/clang/lib/Format/FormatToken.h index cc45d5a8c5c1..abcedb66b57c 100644 --- a/clang/lib/Format/FormatToken.h +++ b/clang/lib/Format/FormatToken.h @@ -102,6 +102,7 @@ namesp

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

2024-07-22 Thread Owen Pan via cfe-commits
@@ -803,6 +803,51 @@ void ContinuationIndenter::addTokenOnCurrentLine(LineState &State, bool DryRun, return !Tok.Previous->isOneOf(TT_CastRParen, tok::kw_for, tok::kw_while, tok::kw_switch); }; + auto IsLambdaParameterList = [](const Fo

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

2024-07-22 Thread Owen Pan via cfe-commits
@@ -813,10 +858,10 @@ void ContinuationIndenter::addTokenOnCurrentLine(LineState &State, bool DryRun, // cll( // cll( // caaall(aa, a; - Current.FakeLParen

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

2024-07-22 Thread Owen Pan via cfe-commits
@@ -803,6 +803,51 @@ void ContinuationIndenter::addTokenOnCurrentLine(LineState &State, bool DryRun, return !Tok.Previous->isOneOf(TT_CastRParen, tok::kw_for, tok::kw_while, tok::kw_switch); }; + auto IsLambdaParameterList = [](const Fo

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

2024-07-22 Thread Owen Pan via cfe-commits
@@ -803,6 +803,51 @@ void ContinuationIndenter::addTokenOnCurrentLine(LineState &State, bool DryRun, return !Tok.Previous->isOneOf(TT_CastRParen, tok::kw_for, tok::kw_while, tok::kw_switch); }; + auto IsLambdaParameterList = [](const Fo

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

2024-07-22 Thread Owen Pan via cfe-commits
@@ -803,6 +803,51 @@ void ContinuationIndenter::addTokenOnCurrentLine(LineState &State, bool DryRun, return !Tok.Previous->isOneOf(TT_CastRParen, tok::kw_for, tok::kw_while, tok::kw_switch); }; + auto IsLambdaParameterList = [](const Fo

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

2024-07-22 Thread Owen Pan via cfe-commits
@@ -803,6 +803,51 @@ void ContinuationIndenter::addTokenOnCurrentLine(LineState &State, bool DryRun, return !Tok.Previous->isOneOf(TT_CastRParen, tok::kw_for, tok::kw_while, tok::kw_switch); }; + auto IsLambdaParameterList = [](const Fo

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

2024-07-22 Thread Owen Pan via cfe-commits
owenca wrote: Please also add the following: ``` $ git diff TokenAnnotatorTest.cpp diff --git a/clang/unittests/Format/TokenAnnotatorTest.cpp b/clang/unittests/Format/TokenAnnotatorTest.cpp index c5e8aa72cd2c..4994498c389b 100644 --- a/clang/unittests/Format/TokenAnnotatorTest.cpp +++ b/clang/un

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

2024-07-22 Thread Owen Pan via cfe-commits
@@ -9337,6 +9337,32 @@ TEST_F(FormatTest, AlignsAfterOpenBracket) { "\n" ");", Style); + verifyFormat("bool aaa(\n" + "const bool &a, const void *aa\n" + ") const {\n"

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

2024-07-22 Thread Owen Pan via cfe-commits
@@ -9337,6 +9337,32 @@ TEST_F(FormatTest, AlignsAfterOpenBracket) { "\n" ");", Style); + verifyFormat("bool aaa(\n" + "const bool &a, const void *aa\n" + ") const {\n"

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

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

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

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

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

<    8   9   10   11   12   13   14   15   16   17   >