[clang] 1e7cc72 - [clang-format] Allow to set token types final

2022-03-01 Thread Björn Schäpers via cfe-commits
Author: Björn Schäpers Date: 2022-03-01T21:55:31+01:00 New Revision: 1e7cc72ac91d524da80ec6e144dce925a27090fc URL: https://github.com/llvm/llvm-project/commit/1e7cc72ac91d524da80ec6e144dce925a27090fc DIFF: https://github.com/llvm/llvm-project/commit/1e7cc72ac91d524da80ec6e144dce925a27090fc.diff

[clang] 78ac867 - [clang-format] Fix requires related crash

2022-03-01 Thread Björn Schäpers via cfe-commits
Author: Björn Schäpers Date: 2022-03-01T21:55:31+01:00 New Revision: 78ac86701801663d700919e543f4e1129982993d URL: https://github.com/llvm/llvm-project/commit/78ac86701801663d700919e543f4e1129982993d DIFF: https://github.com/llvm/llvm-project/commit/78ac86701801663d700919e543f4e1129982993d.diff

[clang] d6daca2 - [clang-format] Fix BreakBeforeBinaryOperators with TemplateCloser on the lhs

2022-03-01 Thread Björn Schäpers via cfe-commits
Author: Björn Schäpers Date: 2022-03-01T21:55:32+01:00 New Revision: d6daca21738aed64837b825c32d4f1b4f54cec04 URL: https://github.com/llvm/llvm-project/commit/d6daca21738aed64837b825c32d4f1b4f54cec04 DIFF: https://github.com/llvm/llvm-project/commit/d6daca21738aed64837b825c32d4f1b4f54cec04.diff

[clang] 5e51ace - [clang-format][docs] Fix a bad comment

2022-03-01 Thread Björn Schäpers via cfe-commits
Author: Krystian Kuzniarek Date: 2022-03-01T21:55:32+01:00 New Revision: 5e51ace4e86ddaec34b5641f28a0ecbb17c8b1f3 URL: https://github.com/llvm/llvm-project/commit/5e51ace4e86ddaec34b5641f28a0ecbb17c8b1f3 DIFF: https://github.com/llvm/llvm-project/commit/5e51ace4e86ddaec34b5641f28a0ecbb17c8b1f3.

[clang] f014ab9 - [clang-format][NFC] Code Tidies in UnwrappedLineFormatter

2022-01-03 Thread Björn Schäpers via cfe-commits
Author: Björn Schäpers Date: 2022-01-03T23:06:55+01:00 New Revision: f014ab933f35805159021d2d0c856a3c9af21a85 URL: https://github.com/llvm/llvm-project/commit/f014ab933f35805159021d2d0c856a3c9af21a85 DIFF: https://github.com/llvm/llvm-project/commit/f014ab933f35805159021d2d0c856a3c9af21a85.diff

[clang] d48d1f8 - [clang-format][NFC] Merge another two calls to isOneOf

2022-01-03 Thread Björn Schäpers via cfe-commits
Author: Björn Schäpers Date: 2022-01-03T23:06:55+01:00 New Revision: d48d1f8ee84577a1ca38d4fe03956ee27884e399 URL: https://github.com/llvm/llvm-project/commit/d48d1f8ee84577a1ca38d4fe03956ee27884e399 DIFF: https://github.com/llvm/llvm-project/commit/d48d1f8ee84577a1ca38d4fe03956ee27884e399.diff

[clang] 1188f24 - Revert "[clang-format][NFC] Prefer pass by reference"

2022-01-03 Thread Björn Schäpers via cfe-commits
Author: Björn Schäpers Date: 2022-01-03T23:06:56+01:00 New Revision: 1188f241acb78dacef00b7b6b3ec0b04cb43c786 URL: https://github.com/llvm/llvm-project/commit/1188f241acb78dacef00b7b6b3ec0b04cb43c786 DIFF: https://github.com/llvm/llvm-project/commit/1188f241acb78dacef00b7b6b3ec0b04cb43c786.diff

[clang] 35493b4 - [clang-format][NFC] Replace deque with vector

2022-01-05 Thread Björn Schäpers via cfe-commits
Author: Björn Schäpers Date: 2022-01-05T12:31:34+01:00 New Revision: 35493b45603fc897280cfba60866075888d9a790 URL: https://github.com/llvm/llvm-project/commit/35493b45603fc897280cfba60866075888d9a790 DIFF: https://github.com/llvm/llvm-project/commit/35493b45603fc897280cfba60866075888d9a790.diff

[clang] c2257fe - [clang-format] Fix SeparateDefinitionBlocks docs and ...

2022-01-05 Thread Björn Schäpers via cfe-commits
Author: Björn Schäpers Date: 2022-01-05T12:31:34+01:00 New Revision: c2257fe236726ed46f1ec3d68633f1b6663d2513 URL: https://github.com/llvm/llvm-project/commit/c2257fe236726ed46f1ec3d68633f1b6663d2513 DIFF: https://github.com/llvm/llvm-project/commit/c2257fe236726ed46f1ec3d68633f1b6663d2513.diff

[clang] a1db435 - [clang-format][NFC] Don't pass member by argument

2022-01-05 Thread Björn Schäpers via cfe-commits
Author: Björn Schäpers Date: 2022-01-05T12:31:34+01:00 New Revision: a1db43539027898cbd200798c4549115d261ed86 URL: https://github.com/llvm/llvm-project/commit/a1db43539027898cbd200798c4549115d261ed86 DIFF: https://github.com/llvm/llvm-project/commit/a1db43539027898cbd200798c4549115d261ed86.diff

[clang] 918c977 - [clang-format][NFC] Early return in TokenAnnotator::next

2022-01-05 Thread Björn Schäpers via cfe-commits
Author: Björn Schäpers Date: 2022-01-05T12:31:35+01:00 New Revision: 918c977dc1c8905086443e13c172a492247d4709 URL: https://github.com/llvm/llvm-project/commit/918c977dc1c8905086443e13c172a492247d4709 DIFF: https://github.com/llvm/llvm-project/commit/918c977dc1c8905086443e13c172a492247d4709.diff

[clang] 29d8535 - [clang-format][NFC] TokenAnnotator: Use range based for

2022-01-05 Thread Björn Schäpers via cfe-commits
Author: Björn Schäpers Date: 2022-01-05T12:31:35+01:00 New Revision: 29d8535e2b86d27a3c1363646f04ddf1835c30d2 URL: https://github.com/llvm/llvm-project/commit/29d8535e2b86d27a3c1363646f04ddf1835c30d2 DIFF: https://github.com/llvm/llvm-project/commit/29d8535e2b86d27a3c1363646f04ddf1835c30d2.diff

[clang] 2ab5d29 - [clang-format][NFC] Use Prev instead of Current->Previous

2022-01-05 Thread Björn Schäpers via cfe-commits
Author: Björn Schäpers Date: 2022-01-05T12:31:35+01:00 New Revision: 2ab5d29f556bc3b5510ae495e5bb54b8b5921d1f URL: https://github.com/llvm/llvm-project/commit/2ab5d29f556bc3b5510ae495e5bb54b8b5921d1f DIFF: https://github.com/llvm/llvm-project/commit/2ab5d29f556bc3b5510ae495e5bb54b8b5921d1f.diff

[clang] 8f6af1d - [clang-format][NFC] Put all state change into the for statement

2022-01-05 Thread Björn Schäpers via cfe-commits
Author: Björn Schäpers Date: 2022-01-05T12:31:36+01:00 New Revision: 8f6af1d4688904fda730d0fea78d2df11252bf40 URL: https://github.com/llvm/llvm-project/commit/8f6af1d4688904fda730d0fea78d2df11252bf40 DIFF: https://github.com/llvm/llvm-project/commit/8f6af1d4688904fda730d0fea78d2df11252bf40.diff

[clang] 1da96f7 - [clang-format][NFC] Right.Previous is Left

2022-01-05 Thread Björn Schäpers via cfe-commits
Author: Björn Schäpers Date: 2022-01-05T12:31:36+01:00 New Revision: 1da96f744951b54f7a3f9bf799fb8e75a31d291b URL: https://github.com/llvm/llvm-project/commit/1da96f744951b54f7a3f9bf799fb8e75a31d291b DIFF: https://github.com/llvm/llvm-project/commit/1da96f744951b54f7a3f9bf799fb8e75a31d291b.diff

[clang] 966f24e - [clang-format] Add a BlockIndent option to AlignAfterOpenBracket

2022-01-17 Thread Björn Schäpers via cfe-commits
Author: Cameron Mulhern Date: 2022-01-17T09:03:23+01:00 New Revision: 966f24e5a62a9f5df518357c2d4b0e361244a624 URL: https://github.com/llvm/llvm-project/commit/966f24e5a62a9f5df518357c2d4b0e361244a624 DIFF: https://github.com/llvm/llvm-project/commit/966f24e5a62a9f5df518357c2d4b0e361244a624.dif

[clang] c5243c6 - [clang-format] Fix aligning with linebreaks

2021-03-28 Thread Björn Schäpers via cfe-commits
Author: Björn Schäpers Date: 2021-03-28T16:26:27+02:00 New Revision: c5243c63cda3c740d6e9c7e501f6518c21688da3 URL: https://github.com/llvm/llvm-project/commit/c5243c63cda3c740d6e9c7e501f6518c21688da3 DIFF: https://github.com/llvm/llvm-project/commit/c5243c63cda3c740d6e9c7e501f6518c21688da3.diff

[clang] 4696857 - DeclContext: Fix iterator category

2021-04-16 Thread Björn Schäpers via cfe-commits
Author: Björn Schäpers Date: 2021-04-16T20:59:36+02:00 New Revision: 46968577336f29ddc5fd30e87cb94b03fa3c9cd9 URL: https://github.com/llvm/llvm-project/commit/46968577336f29ddc5fd30e87cb94b03fa3c9cd9 DIFF: https://github.com/llvm/llvm-project/commit/46968577336f29ddc5fd30e87cb94b03fa3c9cd9.diff

[clang] bcc1dee - [clang-format] Add StatementAttributeLikeMacros option

2021-01-17 Thread Björn Schäpers via cfe-commits
Author: Björn Schäpers Date: 2021-01-18T06:54:31+01:00 New Revision: bcc1dee60019f3a488a04dc7f701f7a692040fed URL: https://github.com/llvm/llvm-project/commit/bcc1dee60019f3a488a04dc7f701f7a692040fed DIFF: https://github.com/llvm/llvm-project/commit/bcc1dee60019f3a488a04dc7f701f7a692040fed.diff

[clang] b43075e - [clang-format] Fix documentation of bcc1dee600

2021-01-18 Thread Björn Schäpers via cfe-commits
Author: Björn Schäpers Date: 2021-01-18T11:03:13+01:00 New Revision: b43075e34a598460fe1590d950862a26449e8d10 URL: https://github.com/llvm/llvm-project/commit/b43075e34a598460fe1590d950862a26449e8d10 DIFF: https://github.com/llvm/llvm-project/commit/b43075e34a598460fe1590d950862a26449e8d10.diff

[clang] cbdde49 - [clang-format] Apply Allman style to lambdas

2021-01-19 Thread Björn Schäpers via cfe-commits
Author: Björn Schäpers Date: 2021-01-19T18:17:01+01:00 New Revision: cbdde495ba28915d52b561e44aaba12db4cf724f URL: https://github.com/llvm/llvm-project/commit/cbdde495ba28915d52b561e44aaba12db4cf724f DIFF: https://github.com/llvm/llvm-project/commit/cbdde495ba28915d52b561e44aaba12db4cf724f.diff

[clang] [clang-format] Change GNU style language standard to LS_Latest (PR #104669)

2024-08-18 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks approved this pull request. https://github.com/llvm/llvm-project/pull/104669 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Use double hyphen for multiple-letter flags (PR #100978)

2024-08-21 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks closed https://github.com/llvm/llvm-project/pull/100978 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Treat new expressions as simple functions (PR #105168)

2024-08-21 Thread Björn Schäpers via cfe-commits
HazardyKnusperkeks wrote: How does it look like without the new? https://github.com/llvm/llvm-project/pull/105168 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Treat new expressions as simple functions (PR #105168)

2024-08-23 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks approved this pull request. https://github.com/llvm/llvm-project/pull/105168 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] clang-format: Add "AllowShortNamespacesOnASingleLine" option (PR #105597)

2024-08-23 Thread Björn Schäpers via cfe-commits
@@ -916,6 +981,23 @@ class LineJoiner { return 1 + I[1]->Last->TotalLength + 1 + I[2]->Last->TotalLength <= Limit; } + bool nextNLinesFitInto(SmallVectorImpl::const_iterator I, + SmallVectorImpl::const_iterator E, + unsign

[clang] clang-format: Add "AllowShortNamespacesOnASingleLine" option (PR #105597)

2024-08-23 Thread Björn Schäpers via cfe-commits
@@ -616,6 +625,62 @@ class LineJoiner { return 1; } + unsigned tryMergeNamespace(SmallVectorImpl::const_iterator I, + SmallVectorImpl::const_iterator E, + unsigned Limit) { +if (Limit == 0) + return 0; +

[clang] clang-format: Add "AllowShortNamespacesOnASingleLine" option (PR #105597)

2024-08-23 Thread Björn Schäpers via cfe-commits
@@ -27981,6 +27981,118 @@ TEST_F(FormatTest, BreakBinaryOperations) { Style); } +TEST_F(FormatTest, ShortNamespacesOption) { + FormatStyle Style = getLLVMStyle(); + Style.AllowShortNamespacesOnASingleLine = true; + Style.FixNamespaceComments = false; + + //

[clang] clang-format: Add "AllowShortNamespacesOnASingleLine" option (PR #105597)

2024-08-23 Thread Björn Schäpers via cfe-commits
@@ -916,6 +981,23 @@ class LineJoiner { return 1 + I[1]->Last->TotalLength + 1 + I[2]->Last->TotalLength <= Limit; } + bool nextNLinesFitInto(SmallVectorImpl::const_iterator I, + SmallVectorImpl::const_iterator E, + unsign

[clang] [clang-format] Correctly compute SplitPenalty of TrailingReturnArrow (PR #105613)

2024-08-23 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks approved this pull request. https://github.com/llvm/llvm-project/pull/105613 ___ 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-26 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks approved this pull request. 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] Improve BlockIndent at ColumnLimit (PR #93140)

2024-06-26 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks 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] [clang-format] Allow ternary in all templates (PR #96801)

2024-06-27 Thread Björn Schäpers via cfe-commits
HazardyKnusperkeks wrote: > I'm not even sure if this change is a good idea! I think it's very likely it > will lead to regressions, for we don't have tests for such cases yet, it seems I'm sure you will look after them, so I'd say let them come. ;) https://github.com/llvm/llvm-project/pull/96

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

2024-06-27 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks 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] Introduce "ReflowComments: IndentOnly" to re-indent comments without breaking internal structure (think Doxygen). (PR #96804)

2024-06-27 Thread Björn Schäpers via cfe-commits
@@ -3749,24 +3749,47 @@ struct FormatStyle { /// \version 13 ReferenceAlignmentStyle ReferenceAlignment; - // clang-format off - /// If ``true``, clang-format will attempt to re-flow comments. That is it - /// will touch a comment and *reflow* long comments into new lin

[clang] [clang-format] Introduce "ReflowComments: IndentOnly" to re-indent comments without breaking internal structure (think Doxygen). (PR #96804)

2024-06-27 Thread Björn Schäpers via cfe-commits
@@ -493,9 +493,25 @@ TEST_F(FormatTestComments, AlignsBlockComments) { TEST_F(FormatTestComments, CommentReflowingCanBeTurnedOff) { FormatStyle Style = getLLVMStyleWithColumns(20); - Style.ReflowComments = false; - verifyFormat("// a aa aa", Style);

[clang] Add "clang-format-on-save-mode" minor mode to clang-format.el (PR #104533)

2024-10-19 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks closed https://github.com/llvm/llvm-project/pull/104533 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] clang-format-ignore: Add support for double asterisk patterns (PR #110560)

2024-10-25 Thread Björn Schäpers via cfe-commits
@@ -49,11 +49,29 @@ bool matchFilePath(StringRef Pattern, StringRef FilePath) { return false; break; case '*': { - while (++I < EOP && Pattern[I] == '*') { // Skip consecutive stars. + if (I + 1 < EOP && Pattern[I + 1] == '*') { +// Handle '*

[clang] [clang-format] clang-format-ignore: Add support for double asterisk patterns (PR #110560)

2024-10-24 Thread Björn Schäpers via cfe-commits
@@ -49,11 +49,29 @@ bool matchFilePath(StringRef Pattern, StringRef FilePath) { return false; break; case '*': { - while (++I < EOP && Pattern[I] == '*') { // Skip consecutive stars. + if (I + 1 < EOP && Pattern[I + 1] == '*') { +// Handle '*

[clang] [clang-format] Add an option to control indentation of `export { ... }` (PR #110381)

2024-10-24 Thread Björn Schäpers via cfe-commits
@@ -3107,29 +3131,15 @@ void UnwrappedLineParser::parseNamespace() { DeclarationScopeStack.size() > 1) ? 1u : 0u; -bool ManageWhitesmithsBraces = -AddLevels == 0u && -Style.BreakBeforeBraces == FormatStyle::BS_Whitesm

[clang] [clang-format] Fix path expansion inside git-clang-format.bat (PR #114078)

2024-10-29 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks approved this pull request. https://github.com/llvm/llvm-project/pull/114078 ___ 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 parsing `switch` in macro call (PR #114506)

2024-11-01 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks approved this pull request. https://github.com/llvm/llvm-project/pull/114506 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Don't re-annotate CaseLabelColon as ConditionalExpr (PR #114639)

2024-11-02 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks approved this pull request. https://github.com/llvm/llvm-project/pull/114639 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Add TemplateNames option to help parse C++ angles (PR #109916)

2024-10-23 Thread Björn Schäpers via cfe-commits
@@ -5230,6 +5239,7 @@ struct FormatStyle { TableGenBreakingDAGArgOperators == R.TableGenBreakingDAGArgOperators && TableGenBreakInsideDAGArg == R.TableGenBreakInsideDAGArg && + TabWidth == R.TabWidth && TemplateNames == R.TemplateN

[clang] [clang-format] Add KeepFormFeed option (PR #113268)

2024-10-23 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks approved this pull request. https://github.com/llvm/llvm-project/pull/113268 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Fix working -assume-filename with .clang-format-ignore (PR #113100)

2024-10-23 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks approved this pull request. https://github.com/llvm/llvm-project/pull/113100 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Stop crashing on slightly off Verilog module headers (PR #116000)

2024-11-13 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks approved this pull request. https://github.com/llvm/llvm-project/pull/116000 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Add an option to control indentation of `export { ... }` (PR #110381)

2024-10-25 Thread Björn Schäpers via cfe-commits
@@ -26588,10 +26613,7 @@ TEST_F(FormatTest, Cpp20ModulesSupport) { " int foo;\n" "};", Style); - verifyFormat("export {\n" - " int foo;\n" - "};", - Style); + verifyFormat("export { int f

[clang] [clang-format] Print the names of unfound files in error messages (PR #113640)

2024-10-25 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks approved this pull request. https://github.com/llvm/llvm-project/pull/113640 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Make bitwise and imply requires clause (PR #110942)

2024-10-25 Thread Björn Schäpers via cfe-commits
@@ -1296,6 +1296,15 @@ TEST_F(TokenAnnotatorTest, UnderstandsRequiresClausesAndConcepts) { Tokens = annotate("bool x = t && requires(Foo x) { x.foo(); };"); ASSERT_EQ(Tokens.size(), 25u) << Tokens; EXPECT_TOKEN(Tokens[5], tok::kw_requires, TT_RequiresExpression); + + //

[clang] [clang-format] Add BreakBeforeTemplateClose option (PR #118046)

2024-12-07 Thread Björn Schäpers via cfe-commits
@@ -11077,6 +11077,157 @@ TEST_F(FormatTest, WrapsTemplateDeclarationsWithComments) { Style); } +TEST_F(FormatTest, BreakBeforeTemplateClose) { HazardyKnusperkeks wrote: I want to see some lambdas and template usages (not declarations). https://github

[clang] [clang-format] add BinPackLongBracedLists style option (PR #112482)

2024-12-07 Thread Björn Schäpers via cfe-commits
@@ -3398,6 +3401,21 @@ struct FormatStyle { /// \version 3.7 unsigned MaxEmptyLinesToKeep; + /// If ``BinPackArguments`` is ``false`` this option can override it if + /// ``true`` when 20 or more items are in a braced initializer list. + /// \code + ///BinPackLongB

[clang] [clang-format] Fix an assertion failure in RemoveSemicolon (PR #117472)

2024-12-07 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks approved this pull request. https://github.com/llvm/llvm-project/pull/117472 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Handle C-style cast of member function pointer type (PR #126340)

2025-02-08 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks approved this pull request. https://github.com/llvm/llvm-project/pull/126340 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Add AlignAfterOpenBracketOptions (PR #108332)

2025-01-29 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks approved this pull request. https://github.com/llvm/llvm-project/pull/108332 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Add ClassHeadName to help annotating StartOfName (PR #124891)

2025-01-29 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks approved this pull request. https://github.com/llvm/llvm-project/pull/124891 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Add AlignAfterOpenBracketOptions (PR #108332)

2025-01-29 Thread Björn Schäpers via cfe-commits
@@ -1169,6 +1181,18 @@ template <> struct MappingTraits { IO.mapOptional("WhitespaceSensitiveMacros", Style.WhitespaceSensitiveMacros); +// If AlignAfterOpenBracket was specified but AlignAfterOpenBracketBreak +// was not, initialize the latter f

[clang] [clang-format] Hanlde qualified type name for `QualifierAlignment` (PR #125327)

2025-02-01 Thread Björn Schäpers via cfe-commits
HazardyKnusperkeks wrote: > > Seems to also work for top-level types (`::int_64_t constexpr x{123};` > > works correctly) but breaks for fully qualified types (`::std::int64_t > > constexpr x{123};` becomes `::constexpr std::int64_t x{123};`) > > Yeah, I intentionally didn't want to use a loop

[clang] [clang-format] Fix a bug in annotating ClassHeadName (PR #125326)

2025-02-01 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks approved this pull request. https://github.com/llvm/llvm-project/pull/125326 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Hanlde qualified type name for `QualifierAlignment` (PR #125327)

2025-02-02 Thread Björn Schäpers via cfe-commits
@@ -412,6 +414,15 @@ const FormatToken *LeftRightQualifierAlignmentFixer::analyzeLeft( // The case `const long long volatile int` -> `const volatile long long int` // The case `long volatile long int const` -> `const volatile long long int` if (TypeToken->isTypeName(Lang

[clang] [clang-format] Hanlde qualified type name for `QualifierAlignment` (PR #125327)

2025-02-02 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks approved this pull request. https://github.com/llvm/llvm-project/pull/125327 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Add null-terminated path option (#123921) (PR #123926)

2025-02-02 Thread Björn Schäpers via cfe-commits
@@ -260,15 +265,13 @@ def main(): "Ignoring the following files (wrong extension, symlink, or " "ignored by clang-format):" ) -for filename in ignored_files: -print("%s" % filename) +print_f

[clang] Add configuration option PenaltyBreakBeforeMemberAccess (PR #118409)

2024-12-18 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks approved this pull request. https://github.com/llvm/llvm-project/pull/118409 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] extend clang-format directive with options to prevent formatting for one line (PR #118566)

2024-12-18 Thread Björn Schäpers via cfe-commits
@@ -144,7 +144,8 @@ void DefinitionBlockSeparator::separateBlocks( return false; if (const auto *Tok = OperateLine->First; - Tok->is(tok::comment) && !isClangFormatOn(Tok->TokenText)) { + Tok->is(tok::comment) && parseClangFormatDirective(Tok->T

[clang] [clang-format] Add BreakBeforeTemplateClose option (PR #118046)

2024-12-19 Thread Björn Schäpers via cfe-commits
@@ -11077,6 +11077,221 @@ TEST_F(FormatTest, WrapsTemplateDeclarationsWithComments) { Style); } +TEST_F(FormatTest, BreakBeforeTemplateClose) { HazardyKnusperkeks wrote: One additional test: How about nested templates? `template typename T>` for exampl

[clang] [clang-format] Add BreakBeforeTemplateClose option (PR #118046)

2024-12-19 Thread Björn Schäpers via cfe-commits
@@ -11077,6 +11077,221 @@ TEST_F(FormatTest, WrapsTemplateDeclarationsWithComments) { Style); } +TEST_F(FormatTest, BreakBeforeTemplateClose) { + FormatStyle Style = getGoogleStyle(FormatStyle::LK_Cpp); + Style.ColumnLimit = 0; + verifyNoChange("template \n" +

[clang] [clang-format] Add AlignAfterOpenBracketOptions (PR #108332)

2024-12-13 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks edited https://github.com/llvm/llvm-project/pull/108332 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Add AlignAfterOpenBracketOptions (PR #108332)

2024-12-13 Thread Björn Schäpers via cfe-commits
@@ -1169,6 +1181,18 @@ template <> struct MappingTraits { IO.mapOptional("WhitespaceSensitiveMacros", Style.WhitespaceSensitiveMacros); +// If AlignAfterOpenBracket was specified but AlignAfterOpenBracketBreak +// was not, initialize the latter f

[clang] [clang-format] Add AlignAfterOpenBracketOptions (PR #108332)

2024-12-13 Thread Björn Schäpers via cfe-commits
@@ -1169,6 +1181,18 @@ template <> struct MappingTraits { IO.mapOptional("WhitespaceSensitiveMacros", Style.WhitespaceSensitiveMacros); +// If AlignAfterOpenBracket was specified but AlignAfterOpenBracketBreak +// was not, initialize the latter f

[clang] [clang-format] Add AlignAfterOpenBracketOptions (PR #108332)

2024-12-13 Thread Björn Schäpers via cfe-commits
@@ -811,10 +816,11 @@ void ContinuationIndenter::addTokenOnCurrentLine(LineState &State, bool DryRun, if (!Tok.Previous) return true; if (Tok.Previous->isIf()) - return Style.AlignAfterOpenBracket == FormatStyle::BAS_AlwaysBreak; -return !Tok.Previous->i

[clang] [clang-format] Add AlignAfterOpenBracketOptions (PR #108332)

2024-12-13 Thread Björn Schäpers via cfe-commits
@@ -1452,6 +1476,7 @@ FormatStyle getLLVMStyle(FormatStyle::LanguageKind Language) { FormatStyle LLVMStyle; LLVMStyle.AccessModifierOffset = -2; LLVMStyle.AlignAfterOpenBracket = FormatStyle::BAS_Align; + LLVMStyle.AlignAfterOpenBracketBreak = {}; Hazar

[clang] [clang-format] Add AlignAfterOpenBracketOptions (PR #108332)

2024-12-13 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks commented: I don't think this is the way to go, or at least not with this name. How about going the `Custom` way? https://github.com/llvm/llvm-project/pull/108332 ___ cfe-commits mailing list cfe-commits@lists.llv

[clang] [clang-format] add BinPackLongBracedLists style option (PR #112482)

2024-12-13 Thread Björn Schäpers via cfe-commits
@@ -1208,6 +1208,21 @@ struct FormatStyle { /// \version 3.7 bool BinPackArguments; + /// If ``BinPackArguments`` is ``false`` this option can override it if + /// ``true`` when 20 or more items are in a braced initializer list. HazardyKnusperkeks wrote:

[clang] [clang-format] add BinPackLongBracedLists style option (PR #112482)

2024-12-13 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks commented: I think it should be merges with `BinPackArguments` to get an enum * Never * TwentyOrAbove (name is debatable) * Always * (Leave?) https://github.com/llvm/llvm-project/pull/112482 ___ cfe-commits mailing

[clang] [clang-format] add BinPackLongBracedLists style option (PR #112482)

2024-12-13 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks edited https://github.com/llvm/llvm-project/pull/112482 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Fix crashes when the macro expansion is empty (PR #119428)

2024-12-20 Thread Björn Schäpers via cfe-commits
@@ -233,6 +233,10 @@ MacroExpander::expand(FormatToken *ID, if (Result.size() > 1) { ++Result[0]->MacroCtx->StartOfExpansion; ++Result[Result.size() - 2]->MacroCtx->EndOfExpansion; + } else { +// If the macro expansion is empty, mark the start and end ---

[clang] [clang-format] Add AlignAfterOpenBracketOptions (PR #108332)

2024-12-21 Thread Björn Schäpers via cfe-commits
@@ -1452,6 +1476,7 @@ FormatStyle getLLVMStyle(FormatStyle::LanguageKind Language) { FormatStyle LLVMStyle; LLVMStyle.AccessModifierOffset = -2; LLVMStyle.AlignAfterOpenBracket = FormatStyle::BAS_Align; + LLVMStyle.AlignAfterOpenBracketBreak = {}; Hazar

[clang] [clang-format] add BinPackLongBracedLists style option (PR #112482)

2024-12-21 Thread Björn Schäpers via cfe-commits
HazardyKnusperkeks wrote: > > I think it should be merges with `BinPackArguments` to get an enum > > > > * Never > > * TwentyOrAbove (name is debatable) > > * Always > > * (Leave?) > > Currently the 20 item limit is only enforced on C++ initializer lists. Making > it part of the `BinPackArgume

[clang] [clang-format] add BinPackLongBracedLists style option (PR #112482)

2024-12-21 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks approved this pull request. https://github.com/llvm/llvm-project/pull/112482 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Add BreakBeforeTemplateClose option (PR #118046)

2025-01-09 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks approved this pull request. https://github.com/llvm/llvm-project/pull/118046 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format][NFC] Make formatting Verilog faster (PR #121139)

2025-01-09 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks approved this pull request. https://github.com/llvm/llvm-project/pull/121139 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Add null-terminated path option (#123921) (PR #123926)

2025-01-22 Thread Björn Schäpers via cfe-commits
@@ -869,5 +875,12 @@ def convert_string(bytes_input): return str(bytes_input) +def print_filename(filename, null=False): +if null: +print(filename + "\0", end="") HazardyKnusperkeks wrote: Shouldn't you copy the the indentation of the pri

[clang] [clang-format] Add null-terminated path option (#123921) (PR #123926)

2025-01-22 Thread Björn Schäpers via cfe-commits
@@ -869,5 +875,12 @@ def convert_string(bytes_input): return str(bytes_input) +def print_filename(filename, null=False): HazardyKnusperkeks wrote: Why setting a value for null? https://github.com/llvm/llvm-project/pull/123926 ___

[clang] [clang-format] Fix a regression in `PointerAlignment: Left` (PR #124085)

2025-01-23 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks approved this pull request. https://github.com/llvm/llvm-project/pull/124085 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Add null-terminated path option (#123921) (PR #123926)

2025-01-23 Thread Björn Schäpers via cfe-commits
HazardyKnusperkeks wrote: > > This seems reasonable to me, but wait for the others, maybe @owenca > > I'm wondering if `-0` should turn off all informational messaging as well and > _only_ print the paths. As it is, it will print things like _Running > clang-format on the following files:_, ev

[clang] [clang-format] Add null-terminated path option (#123921) (PR #123926)

2025-01-23 Thread Björn Schäpers via cfe-commits
@@ -869,5 +875,12 @@ def convert_string(bytes_input): return str(bytes_input) +def print_filename(filename, null=False): HazardyKnusperkeks wrote: If this were C++ I'd say yes, you touched all calls (since you added it). Don't know if in Python it i

[clang] [clang-format] Fix a bug in annotating overloaded co_await decl (PR #124240)

2025-01-24 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks approved this pull request. https://github.com/llvm/llvm-project/pull/124240 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Add null-terminated path option (#123921) (PR #123926)

2025-01-24 Thread Björn Schäpers via cfe-commits
@@ -205,6 +205,12 @@ def main(): "commits" ), ) +p.add_argument( +"-0", +"--null", +action="store_true", +help="print the affected paths with null-terminated characters", HazardyKnusperkeks wrote: I t

[clang] [clang-format] Add additional custom words for equivalent clang-format on/off functionality (PR #123543)

2025-01-20 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks requested changes to this pull request. You shouldn't do that in ClangFormat.cpp, because tools which use libformat directly would suddenly behave different as clang-format. https://github.com/llvm/llvm-project/pull/123543 __

[clang] [clang-format] Rename ExportBlockIndentation -> IndentExportBlock (PR #123493)

2025-01-20 Thread Björn Schäpers via cfe-commits
HazardyKnusperkeks wrote: > I assume ExportBlockIndentation is not out in the wild too much so no need to > backwards support, was ExportBlockIndentation added this release? No it does not. It was just added. https://github.com/llvm/llvm-project/pull/123493

[clang] [clang-format] Fix annotating attrs in class/struct (PR #124634)

2025-01-28 Thread Björn Schäpers via cfe-commits
HazardyKnusperkeks wrote: > (Why drop the formatting test? Seems good to have an integration test for > this, no?) Because the bug was a misannotation. The formatting, based on the annotations, should already be covered. Of course one can always add more tests, and I'm not demanding to remove

[clang] [clang-format] Handle leading C++11 attribute in QualifierAlignment (PR #123690)

2025-01-21 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks approved this pull request. https://github.com/llvm/llvm-project/pull/123690 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Add an option to control indentation of `export { ... }` (PR #110381)

2025-01-18 Thread Björn Schäpers via cfe-commits
@@ -171,6 +171,8 @@ class UnwrappedLineParser { void parseRequiresClause(FormatToken *RequiresToken); void parseRequiresExpression(FormatToken *RequiresToken); void parseConstraintExpression(); + void parseCXXExportBlock(); HazardyKnusperkeks wrote: ```

[clang] [clang-format] Add an option to control indentation of `export { ... }` (PR #110381)

2025-01-18 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks commented: Apart from that LGTM. https://github.com/llvm/llvm-project/pull/110381 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Add an option to control indentation of `export { ... }` (PR #110381)

2025-01-18 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks edited https://github.com/llvm/llvm-project/pull/110381 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Add an option to control indentation of `export { ... }` (PR #110381)

2025-01-18 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks approved this pull request. https://github.com/llvm/llvm-project/pull/110381 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Support BraceWrapping.AfterNamespace with AllowShortNamespacesOnASingleLine (PR #123010)

2025-01-18 Thread Björn Schäpers via cfe-commits
@@ -28430,6 +28430,26 @@ TEST_F(FormatTest, ShortNamespacesOption) { "}}} // namespace foo::bar::baz", "namespace foo { namespace bar { namespace baz { class qux; } } }", Style); + Style.FixNamespaceComments = false; + + Style.BreakBeforeBraces = FormatStyle

[clang] [clang-format] Support BraceWrapping.AfterNamespace with AllowShortNamespacesOnASingleLine (PR #123010)

2025-01-18 Thread Björn Schäpers via cfe-commits
@@ -28430,6 +28430,26 @@ TEST_F(FormatTest, ShortNamespacesOption) { "}}} // namespace foo::bar::baz", "namespace foo { namespace bar { namespace baz { class qux; } } }", Style); + Style.FixNamespaceComments = false; + + Style.BreakBeforeBraces = FormatStyle

[clang] [clang-format] Add an option to control indentation of `export { ... }` (PR #110381)

2025-01-18 Thread Björn Schäpers via cfe-commits
@@ -310,7 +310,7 @@ C++23 Feature Support - Extend lifetime of temporaries in mem-default-init for P2718R0. Clang now fully supports `P2718R0 Lifetime extension in range-based for loops `_. - + HazardyKnusperkeks wrote: Remove

[clang] [clang-format] Fix a TableGen crash on comment after l_paren (PR #124380)

2025-01-25 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks approved this pull request. https://github.com/llvm/llvm-project/pull/124380 ___ 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   >