@@ -681,6 +700,10 @@ struct FormatToken {
return true;
if (is(TT_DictLiteral) && is(tok::greater))
return true;
+if (is(TT_TableGenParamAngleCloser))
+ return true;
+if (is(TT_TableGenListCloser))
+ return true;
return isOneOf(tok::r_paren
@@ -2165,6 +2165,56 @@ TEST_F(TokenAnnotatorTest, UnderstandsVerilogOperators) {
EXPECT_TOKEN(Tokens[4], tok::string_literal, TT_Unknown);
}
+TEST_F(TokenAnnotatorTest, UnderstandTableGenTokens) {
+ auto Style = getLLVMStyle(FormatStyle::LK_TableGen);
+ Style.TableGenBreak
HazardyKnusperkeks wrote:
> > `clang-format` doesn't know what are types, except for the keywords. So
> > there is no way to decide if this is a function declaration without naming
> > the parameters, or a variable declaration with a constructor call.
>
> This is C so I guess it can only be a
HazardyKnusperkeks wrote:
> Who should have the final say on the Google code style if not Google?
That's also my point of view. Who ever decides to use google style, has to live
with google changing its style.
https://github.com/llvm/llvm-project/pull/76239
HazardyKnusperkeks wrote:
> @rymiel @HazardyKnusperkeks Thank you for your review! I have fixed the
> points. But for refactoring of the test base class in
> [f8d10d5](https://github.com/llvm/llvm-project/commit/f8d10d5ac9ab4b45b388c74357fc82fb96562e66)
> . I'm not sure I should do here, and i
@@ -570,6 +571,74 @@ static int dumpConfig(bool IsSTDIN) {
return 0;
}
+// Check whether `FilePath` is ignored according to the nearest
+// .clang-format-ignore file based on the rules below:
+// - A blank line is skipped.
+// - Leading and trailing spaces of a line are trim
@@ -570,6 +571,74 @@ static int dumpConfig(bool IsSTDIN) {
return 0;
}
+// Check whether `FilePath` is ignored according to the nearest
+// .clang-format-ignore file based on the rules below:
+// - A blank line is skipped.
+// - Leading and trailing spaces of a line are trim
@@ -570,6 +571,74 @@ static int dumpConfig(bool IsSTDIN) {
return 0;
}
+// Check whether `FilePath` is ignored according to the nearest
+// .clang-format-ignore file based on the rules below:
+// - A blank line is skipped.
+// - Leading and trailing spaces of a line are trim
HazardyKnusperkeks wrote:
In the description (and the commit messages?) you wrote `clang-format.ignore`
instead of `clang-format-ignore`.
https://github.com/llvm/llvm-project/pull/76327
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://l
https://github.com/HazardyKnusperkeks approved this pull request.
https://github.com/llvm/llvm-project/pull/76336
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
HazardyKnusperkeks wrote:
> Hi, Thanks for reviewing, could you merge this for me? I don't have write
> access
I could. But I'm no fan of submitting just because one person approved without
others having the chance to say something. (As has happened here.)
https://github.com/llvm/llvm-project
https://github.com/HazardyKnusperkeks closed
https://github.com/llvm/llvm-project/pull/76336
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/HazardyKnusperkeks approved this pull request.
https://github.com/llvm/llvm-project/pull/76327
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -22965,6 +22965,84 @@ TEST_F(FormatTest, EmptyLinesInLambdas) {
"};");
}
+TEST_F(FormatTest, BreakBeforeLambdaBodyWrapping) {
+ verifyFormat("connect([]() {\n"
+ " foo();\n"
+ " bar();\n"
+ "});");
+
+ auto Style
HazardyKnusperkeks wrote:
I think that's not the right way to fix the issue.
Why are the 2 lines formatted differently? It seems to me that this fixes the
symptom, not the cause.
https://github.com/llvm/llvm-project/pull/76675
___
cfe-commits mailing
@@ -22965,6 +22965,84 @@ TEST_F(FormatTest, EmptyLinesInLambdas) {
"};");
}
+TEST_F(FormatTest, BreakBeforeLambdaBodyWrapping) {
+ verifyFormat("connect([]() {\n"
+ " foo();\n"
+ " bar();\n"
+ "});");
+
+ auto Style
@@ -366,8 +366,14 @@ bool ContinuationIndenter::mustBreak(const LineState
&State) {
const auto &CurrentState = State.Stack.back();
if (Style.BraceWrapping.BeforeLambdaBody && Current.CanBreakBefore &&
Current.is(TT_LambdaLBrace) && Previous.isNot(TT_LineComment)) {
-
HazardyKnusperkeks wrote:
> > I think that's not the right way to fix the issue.
> > Why are the 2 lines formatted differently? It seems to me that this fixes
> > the symptom, not the cause.
>
> Because for the line where brackets are used it meets the condition in the
> next `if` statement do
https://github.com/HazardyKnusperkeks approved this pull request.
As far as I'm concerned it looks good. But I need a second opinion.
@mydeveloperday @owenca @rymiel
https://github.com/llvm/llvm-project/pull/76675
___
cfe-commits mailing list
cfe-com
https://github.com/HazardyKnusperkeks approved this pull request.
https://github.com/llvm/llvm-project/pull/76733
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/HazardyKnusperkeks edited
https://github.com/llvm/llvm-project/pull/76795
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/HazardyKnusperkeks commented:
Can you also add a formatting test?
https://github.com/llvm/llvm-project/pull/76795
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -10,6 +10,7 @@
#include "FormatTestUtils.h"
#include "TestLexer.h"
+#include "clang/Basic/TokenKinds.h"
HazardyKnusperkeks wrote:
Why do you need this?
https://github.com/llvm/llvm-project/pull/76795
___
cfe-com
@@ -1698,8 +1698,6 @@ FormatStyle getGoogleStyle(FormatStyle::LanguageKind
Language) {
/*BasedOnStyle=*/"google",
},
};
- GoogleStyle.AttributeMacros.push_back("GUARDED_BY");
HazardyKnusperkeks wrote:
Even if that would not be needed anymor
@@ -10093,11 +10090,11 @@ TEST_F(FormatTest, ReturnTypeBreakingStyle) {
getGoogleStyleWithColumns(40));
verifyFormat("Tttt ppp\n"
"ABSL_GUARDED_BY(mutex1)\n"
- "ABSL_GUARDED_BY(mutex2);",
+
@@ -5151,6 +5151,14 @@ bool TokenAnnotator::mustBreakBefore(const AnnotatedLine
&Line,
return true;
if (Left.IsUnterminatedLiteral)
return true;
+ if (Right.is(tok::lessless) && Right.Next && Left.is(tok::string_literal) &&
+ // FIXME: Breaking after newlines s
@@ -3914,7 +3914,15 @@ void UnwrappedLineParser::parseRecord(bool ParseAsExpr) {
// (this would still leave us with an ambiguity between template function
// and class declarations).
if (FormatTok->isOneOf(tok::colon, tok::less)) {
HazardyKnusperkeks wrot
https://github.com/HazardyKnusperkeks commented:
Ok, one last thing. From what I figured it was wrongly detected as class
definition. So you could add a token annotator test, which verifies that the
`{` is not an `ClassLBrace`?
https://github.com/llvm/llvm-project/pull/77013
__
@@ -1444,16 +1444,22 @@ WhitespaceManager::CellDescriptions
WhitespaceManager::getCells(unsigned Start,
} else if (C.Tok->is(tok::comma)) {
if (!Cells.empty())
Cells.back().EndIndex = i;
-if (C.Tok->getNextNonComment()->isNot(tok::r_brace)) // d
@@ -2499,6 +2499,15 @@ TEST_F(TokenAnnotatorTest, BraceKind) {
EXPECT_BRACE_KIND(Tokens[6], BK_Block);
}
+TEST_F(TokenAnnotatorTest, StreamOperator) {
+ auto Tokens = annotate("\"foo\\n\" << aux << \"foo\\n\" << \"foo\";");
+ ASSERT_EQ(Tokens.size(), 9u) << Tokens;
+ EXPE
https://github.com/HazardyKnusperkeks edited
https://github.com/llvm/llvm-project/pull/77045
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1444,16 +1444,26 @@ WhitespaceManager::CellDescriptions
WhitespaceManager::getCells(unsigned Start,
} else if (C.Tok->is(tok::comma)) {
if (!Cells.empty())
Cells.back().EndIndex = i;
-if (C.Tok->getNextNonComment()->isNot(tok::r_brace)) // d
@@ -1444,16 +1444,26 @@ WhitespaceManager::CellDescriptions
WhitespaceManager::getCells(unsigned Start,
} else if (C.Tok->is(tok::comma)) {
if (!Cells.empty())
Cells.back().EndIndex = i;
-if (C.Tok->getNextNonComment()->isNot(tok::r_brace)) // d
https://github.com/HazardyKnusperkeks approved this pull request.
https://github.com/llvm/llvm-project/pull/77045
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/HazardyKnusperkeks approved this pull request.
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
https://github.com/HazardyKnusperkeks approved this pull request.
https://github.com/llvm/llvm-project/pull/77045
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1444,6 +1444,7 @@ WhitespaceManager::CellDescriptions
WhitespaceManager::getCells(unsigned Start,
} else if (C.Tok->is(tok::comma)) {
if (!Cells.empty())
Cells.back().EndIndex = i;
+
HazardyKnusperkeks wrote:
Unrelated (and unwante
@@ -2315,6 +2315,10 @@ bool UnwrappedLineParser::tryToParseLambdaIntroducer() {
if (Next->is(tok::greater))
return false;
}
+ if (const auto Kind = FormatTok->Tok.getKind();
+ tok::isLiteral(Kind) && !tok::isStringLiteral(Kind)) {
HazardyKnusp
@@ -1698,8 +1698,6 @@ FormatStyle getGoogleStyle(FormatStyle::LanguageKind
Language) {
/*BasedOnStyle=*/"google",
},
};
- GoogleStyle.AttributeMacros.push_back("GUARDED_BY");
HazardyKnusperkeks wrote:
I'm open in all directions.
When clang
@@ -3131,20 +3132,25 @@ static void sortCppIncludes(const FormatStyle &Style,
}
result += Includes[Index].Text;
if (Cursor && CursorIndex == Index)
- *Cursor = IncludesBeginOffset + result.size() - CursorToEOLOffset;
+ NewCursor = IncludesBeginOffset + res
https://github.com/HazardyKnusperkeks approved this pull request.
https://github.com/llvm/llvm-project/pull/77477
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -16815,6 +16817,18 @@ TEST_F(FormatTest, ConfigurableSpacesInParens) {
verifyFormat("void __attribute__((naked)) foo(int bar)", Spaces);
verifyFormat("void f( ) __attribute__((asdf));", Spaces);
+ Spaces.SpacesInParensOptions.InAttributeSpecifiers =
+ FormatStyle:
https://github.com/HazardyKnusperkeks approved this pull request.
But Owen's proposal isn't bad either.
https://github.com/llvm/llvm-project/pull/77522
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listi
https://github.com/HazardyKnusperkeks approved this pull request.
https://github.com/llvm/llvm-project/pull/77704
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/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.
+ auto
HazardyKnusperkeks wrote:
You can of course always ask for commit access:
https://llvm.org/docs/DeveloperPolicy.html#obtaining-commit-access
https://github.com/llvm/llvm-project/pull/77477
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https:
https://github.com/HazardyKnusperkeks closed
https://github.com/llvm/llvm-project/pull/77477
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Author: Björn Schäpers
Date: 2021-07-29T08:43:41+02:00
New Revision: 75f6a795ee0faf544c3f539d01008d1d5d876acb
URL:
https://github.com/llvm/llvm-project/commit/75f6a795ee0faf544c3f539d01008d1d5d876acb
DIFF:
https://github.com/llvm/llvm-project/commit/75f6a795ee0faf544c3f539d01008d1d5d876acb.diff
Author: Björn Schäpers
Date: 2022-03-12T22:44:24+01:00
New Revision: 8b4d68bf65ef145333aae82683b5fcee29b38dc2
URL:
https://github.com/llvm/llvm-project/commit/8b4d68bf65ef145333aae82683b5fcee29b38dc2
DIFF:
https://github.com/llvm/llvm-project/commit/8b4d68bf65ef145333aae82683b5fcee29b38dc2.diff
Author: Krystian Kuzniarek
Date: 2022-03-12T22:49:57+01:00
New Revision: 9106a07f1fcb4bd425a3ef2f9f3e2b68bc1ad916
URL:
https://github.com/llvm/llvm-project/commit/9106a07f1fcb4bd425a3ef2f9f3e2b68bc1ad916
DIFF:
https://github.com/llvm/llvm-project/commit/9106a07f1fcb4bd425a3ef2f9f3e2b68bc1ad916.
Author: Björn Schäpers
Date: 2022-03-14T12:44:45+01:00
New Revision: 2d8e907016ef323ed1a9e2e70c558eb9c3568b06
URL:
https://github.com/llvm/llvm-project/commit/2d8e907016ef323ed1a9e2e70c558eb9c3568b06
DIFF:
https://github.com/llvm/llvm-project/commit/2d8e907016ef323ed1a9e2e70c558eb9c3568b06.diff
Author: Björn Schäpers
Date: 2022-03-14T12:44:46+01:00
New Revision: acd17a2be81a33abf4350e31ae1747dcb0f12332
URL:
https://github.com/llvm/llvm-project/commit/acd17a2be81a33abf4350e31ae1747dcb0f12332
DIFF:
https://github.com/llvm/llvm-project/commit/acd17a2be81a33abf4350e31ae1747dcb0f12332.diff
Author: Björn Schäpers
Date: 2022-03-14T12:44:47+01:00
New Revision: b7494a1d72c16a4d1f9cc8d4b3eba36934c35664
URL:
https://github.com/llvm/llvm-project/commit/b7494a1d72c16a4d1f9cc8d4b3eba36934c35664
DIFF:
https://github.com/llvm/llvm-project/commit/b7494a1d72c16a4d1f9cc8d4b3eba36934c35664.diff
Author: Björn Schäpers
Date: 2022-03-14T12:44:48+01:00
New Revision: 35abbf166d4ad13e4a89095307bb6e4b2e96e0b3
URL:
https://github.com/llvm/llvm-project/commit/35abbf166d4ad13e4a89095307bb6e4b2e96e0b3
DIFF:
https://github.com/llvm/llvm-project/commit/35abbf166d4ad13e4a89095307bb6e4b2e96e0b3.diff
Author: Björn Schäpers
Date: 2022-03-15T21:41:57+01:00
New Revision: 1db8112311c7f3c1d39c3b62637ac26055ad9d8f
URL:
https://github.com/llvm/llvm-project/commit/1db8112311c7f3c1d39c3b62637ac26055ad9d8f
DIFF:
https://github.com/llvm/llvm-project/commit/1db8112311c7f3c1d39c3b62637ac26055ad9d8f.diff
Author: Björn Schäpers
Date: 2022-02-03T22:55:27+01:00
New Revision: 3d0b619261392f5f24a7b9961b24cdd621829c13
URL:
https://github.com/llvm/llvm-project/commit/3d0b619261392f5f24a7b9961b24cdd621829c13
DIFF:
https://github.com/llvm/llvm-project/commit/3d0b619261392f5f24a7b9961b24cdd621829c13.diff
Author: Björn Schäpers
Date: 2022-02-11T22:42:37+01:00
New Revision: 9aab0db13fb6d21d1b70247a9b5e4cf916ee1c3a
URL:
https://github.com/llvm/llvm-project/commit/9aab0db13fb6d21d1b70247a9b5e4cf916ee1c3a
DIFF:
https://github.com/llvm/llvm-project/commit/9aab0db13fb6d21d1b70247a9b5e4cf916ee1c3a.diff
Author: Björn Schäpers
Date: 2022-02-15T21:37:35+01:00
New Revision: bcd1e4612f4fa2d12a51f0708c619ae3b2deaa2b
URL:
https://github.com/llvm/llvm-project/commit/bcd1e4612f4fa2d12a51f0708c619ae3b2deaa2b
DIFF:
https://github.com/llvm/llvm-project/commit/bcd1e4612f4fa2d12a51f0708c619ae3b2deaa2b.diff
Author: Björn Schäpers
Date: 2022-02-15T21:37:36+01:00
New Revision: b786a4aefedaf68eb7710d9c01a18ad1d0c820b7
URL:
https://github.com/llvm/llvm-project/commit/b786a4aefedaf68eb7710d9c01a18ad1d0c820b7
DIFF:
https://github.com/llvm/llvm-project/commit/b786a4aefedaf68eb7710d9c01a18ad1d0c820b7.diff
Author: Björn Schäpers
Date: 2022-02-15T21:37:38+01:00
New Revision: 8da319fe770b21d342a534bf02d2b88fffe667cc
URL:
https://github.com/llvm/llvm-project/commit/8da319fe770b21d342a534bf02d2b88fffe667cc
DIFF:
https://github.com/llvm/llvm-project/commit/8da319fe770b21d342a534bf02d2b88fffe667cc.diff
Author: Björn Schäpers
Date: 2022-07-18T21:41:09+02:00
New Revision: 3c18a8b3a349781eac54144d0cf252bbbce0c4c1
URL:
https://github.com/llvm/llvm-project/commit/3c18a8b3a349781eac54144d0cf252bbbce0c4c1
DIFF:
https://github.com/llvm/llvm-project/commit/3c18a8b3a349781eac54144d0cf252bbbce0c4c1.diff
Author: Björn Schäpers
Date: 2022-07-18T21:41:09+02:00
New Revision: 2b04c41b28320c1e399209fbe7a5a8d540578999
URL:
https://github.com/llvm/llvm-project/commit/2b04c41b28320c1e399209fbe7a5a8d540578999
DIFF:
https://github.com/llvm/llvm-project/commit/2b04c41b28320c1e399209fbe7a5a8d540578999.diff
Author: Björn Schäpers
Date: 2022-07-18T21:42:34+02:00
New Revision: d2eda49202386b222cec763aad9aaecd463ce044
URL:
https://github.com/llvm/llvm-project/commit/d2eda49202386b222cec763aad9aaecd463ce044
DIFF:
https://github.com/llvm/llvm-project/commit/d2eda49202386b222cec763aad9aaecd463ce044.diff
@@ -2332,6 +2332,77 @@ TEST_F(TokenAnnotatorTest, UnderstandTableGenTokens) {
EXPECT_TOKEN(Tokens[4], tok::less, TT_TemplateOpener);
EXPECT_TOKEN(Tokens[6], tok::greater, TT_TemplateCloser);
EXPECT_TOKEN(Tokens[7], tok::l_brace, TT_FunctionLBrace);
+
+ // DAGArg breaking
@@ -332,6 +332,84 @@ TEST_F(FormatTestTableGen, Assert) {
verifyFormat("assert !le(DefVar1, 0), \"Assert1\";\n");
}
+TEST_F(FormatTestTableGen, DAGArgBreakElements) {
+ FormatStyle Style = getGoogleStyle(FormatStyle::LK_TableGen);
+ Style.ColumnLimit = 60;
+ // By default
@@ -1842,6 +1846,19 @@ void
ContinuationIndenter::moveStatePastScopeOpener(LineState &State,
Style.ContinuationIndentWidth +
std::max(CurrentState.LastSpace, CurrentState.StartOfFunctionCall);
+if (Style.isTableGen()) {
+ if (Current.is(TT_TableGenDAG
HazardyKnusperkeks wrote:
> > I mean multiple threads in the same process with different languages. maybe
> > unlikely, but not impossible.
>
> But libFormat/clang-format are _not_ multithreaded, right?
clang-format is not, but libFormat I don't know. I know my IDE uses directly
libFormat.
I
https://github.com/HazardyKnusperkeks approved this pull request.
https://github.com/llvm/llvm-project/pull/84346
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
HazardyKnusperkeks wrote:
> Reverts #84599
>
> This broke the presubmit bot.
Any logs to show what was broken?
https://github.com/llvm/llvm-project/pull/85353
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mail
https://github.com/HazardyKnusperkeks approved this pull request.
https://github.com/llvm/llvm-project/pull/85361
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/HazardyKnusperkeks approved this pull request.
https://github.com/llvm/llvm-project/pull/85470
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/HazardyKnusperkeks approved this pull request.
https://github.com/llvm/llvm-project/pull/85498
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/HazardyKnusperkeks approved this pull request.
https://github.com/llvm/llvm-project/pull/85508
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/HazardyKnusperkeks approved this pull request.
https://github.com/llvm/llvm-project/pull/83149
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/HazardyKnusperkeks closed
https://github.com/llvm/llvm-project/pull/85470
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/HazardyKnusperkeks approved this pull request.
https://github.com/llvm/llvm-project/pull/85760
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/HazardyKnusperkeks closed
https://github.com/llvm/llvm-project/pull/85760
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
HazardyKnusperkeks wrote:
Presumably fixed by #85760
https://github.com/llvm/llvm-project/pull/83149
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/HazardyKnusperkeks approved this pull request.
https://github.com/llvm/llvm-project/pull/86150
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
HazardyKnusperkeks wrote:
My pleasure.
https://github.com/llvm/llvm-project/pull/86150
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -19056,6 +19056,9 @@ TEST_F(FormatTest, AlignConsecutiveDeclarations) {
verifyFormat("inta(int x);\n"
"double b();",
Alignment);
+ verifyFormat("inta(const Test & = Test());\n"
HazardyKnusperkeks wrote:
I'd like to s
@@ -471,6 +471,9 @@ AlignTokenSequence(const FormatStyle &Style, unsigned
Start, unsigned End,
Previous >= 0 &&
Changes[Previous].Tok->getType() == TT_PointerOrReference;
--Previous) {
+// Don't align function default argument using ret
https://github.com/HazardyKnusperkeks approved this pull request.
https://github.com/llvm/llvm-project/pull/86253
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/HazardyKnusperkeks approved this pull request.
https://github.com/llvm/llvm-project/pull/86420
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -4827,6 +4827,10 @@ bool TokenAnnotator::spaceRequiredBefore(const
AnnotatedLine &Line,
Right.is(TT_TemplateOpener)) {
return true;
}
+if (Left.is(tok::identifier) && Right.is(tok::numeric_constant) &&
+Right.TokenText[0] == '.') {
@@ -464,10 +464,11 @@ AlignTokenSequence(const FormatStyle &Style, unsigned
Start, unsigned End,
if (i + 1 != Changes.size())
Changes[i + 1].PreviousEndOfTokenColumn += Shift;
-// If PointerAlignment is PAS_Right, keep *s or &s next to the token
+// If Point
@@ -19056,6 +19056,9 @@ TEST_F(FormatTest, AlignConsecutiveDeclarations) {
verifyFormat("inta(int x);\n"
"double b();",
Alignment);
+ verifyFormat("inta(const Test & = Test());\n"
HazardyKnusperkeks wrote:
I wanted to s
@@ -2218,6 +2218,11 @@ struct FormatStyle {
/// \version 3.8
bool BreakAfterJavaFieldAnnotations;
+ /// If ``true``, clang-format will always break before function definition
+ /// parameters
HazardyKnusperkeks wrote:
```suggestion
/// parameters.
```
@@ -5317,6 +5318,12 @@ bool TokenAnnotator::mustBreakBefore(const AnnotatedLine
&Line,
if (Right.NewlinesBefore > 1 && Style.MaxEmptyLinesToKeep > 0)
return true;
+ if (Style.BreakFunctionDefinitionParameters && Line.MightBeFunctionDecl &&
HazardyKnusp
@@ -2218,6 +2218,11 @@ struct FormatStyle {
/// \version 3.8
bool BreakAfterJavaFieldAnnotations;
+ /// If ``true``, clang-format will always break before function definition
+ /// parameters
+ /// \version 19
+ bool BreakFunctionDefinitionParameters;
@@ -7951,6 +7951,24 @@ TEST_F(FormatTest, AllowAllArgumentsOnNextLineDontAlign)
{
Input, Style);
}
+TEST_F(FormatTest, BreakFunctionDefinitionParameters) {
+ FormatStyle Style = getLLVMStyleWithColumns(80);
HazardyKnusperkeks wrote:
```sugges
@@ -4827,6 +4827,10 @@ bool TokenAnnotator::spaceRequiredBefore(const
AnnotatedLine &Line,
Right.is(TT_TemplateOpener)) {
return true;
}
+if (Left.is(tok::identifier) && Right.is(tok::numeric_constant) &&
+Right.TokenText[0] == '.') {
@@ -2218,6 +2218,11 @@ struct FormatStyle {
/// \version 3.8
bool BreakAfterJavaFieldAnnotations;
+ /// If ``true``, clang-format will always break before function definition
+ /// parameters
+ /// \version 19
+ bool BreakFunctionDefinitionParameters;
@@ -7951,6 +7951,24 @@ TEST_F(FormatTest, AllowAllArgumentsOnNextLineDontAlign)
{
Input, Style);
}
+TEST_F(FormatTest, BreakFunctionDefinitionParameters) {
HazardyKnusperkeks wrote:
As I understand you want this, so that you can put all argume
https://github.com/HazardyKnusperkeks approved this pull request.
https://github.com/llvm/llvm-project/pull/86254
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/HazardyKnusperkeks closed
https://github.com/llvm/llvm-project/pull/86254
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/HazardyKnusperkeks approved this pull request.
https://github.com/llvm/llvm-project/pull/86776
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/HazardyKnusperkeks approved this pull request.
https://github.com/llvm/llvm-project/pull/86458
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/HazardyKnusperkeks approved this pull request.
https://github.com/llvm/llvm-project/pull/84988
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/HazardyKnusperkeks 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
101 - 200 of 884 matches
Mail list logo