@@ -9608,6 +9608,10 @@ TEST_F(FormatTest, AlignsAfterOpenBracket) {
"\"a aaa a aaa a\"\n"
");",
Style);
+ verifyFormat("aaa(\n"
+ "&b
https://github.com/owenca approved this pull request.
https://github.com/llvm/llvm-project/pull/124998
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1146,6 +1175,8 @@ TEST_F(TokenAnnotatorTest,
UnderstandsRequiresClausesAndConcepts) {
EXPECT_TOKEN(Tokens[31], tok::greater, TT_TemplateCloser);
EXPECT_EQ(Tokens[31]->FakeRParens, 1u);
EXPECT_TRUE(Tokens[31]->ClosesRequiresClause);
+ // FIXME:
+ // EXPECT_TOKEN(Tok
@@ -1146,6 +1175,8 @@ TEST_F(TokenAnnotatorTest,
UnderstandsRequiresClausesAndConcepts) {
EXPECT_TOKEN(Tokens[31], tok::greater, TT_TemplateCloser);
EXPECT_EQ(Tokens[31]->FakeRParens, 1u);
EXPECT_TRUE(Tokens[31]->ClosesRequiresClause);
+ // FIXME:
+ // EXPECT_TOKEN(Tok
@@ -3458,6 +3509,9 @@ TEST_F(TokenAnnotatorTest, BraceKind) {
Tokens = annotate("a = class Foo extends goog.a {};",
getGoogleStyle(FormatStyle::LK_JavaScript));
ASSERT_EQ(Tokens.size(), 12u) << Tokens;
+ EXPECT_TOKEN(Tokens[3], tok::identifier, TT_Class
https://github.com/owenca updated
https://github.com/llvm/llvm-project/pull/124891
>From 04fd96533a48b0f6fdbacb6c9947740bf4c58992 Mon Sep 17 00:00:00 2001
From: Owen Pan
Date: Tue, 28 Jan 2025 23:16:10 -0800
Subject: [PATCH] [clang-format] Add ClassHeadName to help annotating
StartOfName
Fixe
https://github.com/owenca closed
https://github.com/llvm/llvm-project/pull/124998
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -11224,6 +11224,254 @@ TEST_F(FormatTest,
WrapsTemplateDeclarationsWithComments) {
Style);
}
+TEST_F(FormatTest, BreakBeforeTemplateCloser) {
+ FormatStyle Style = getLLVMStyle();
+ // Begin with tests covering the case where there is no constraint on the
+ // col
@@ -11224,6 +11224,254 @@ TEST_F(FormatTest,
WrapsTemplateDeclarationsWithComments) {
Style);
}
+TEST_F(FormatTest, BreakBeforeTemplateCloser) {
+ FormatStyle Style = getLLVMStyle();
+ // Begin with tests covering the case where there is no constraint on the
+ // col
@@ -304,6 +304,10 @@ bool ContinuationIndenter::canBreak(const LineState
&State) {
Current.closesBlockOrBlockTypeList(Style)))
{
return false;
}
+ if (Style.BreakBeforeTemplateCloser && Current.is(TT_TemplateCloser) &&
+ !Current
@@ -11224,6 +11224,328 @@ TEST_F(FormatTest,
WrapsTemplateDeclarationsWithComments) {
Style);
}
+TEST_F(FormatTest, BreakBeforeTemplateCloser) {
+ FormatStyle Style = getLLVMStyle();
+ // Begin with tests covering the case where there is no constraint on the
+ // col
@@ -11224,6 +11224,328 @@ TEST_F(FormatTest,
WrapsTemplateDeclarationsWithComments) {
Style);
}
+TEST_F(FormatTest, BreakBeforeTemplateCloser) {
+ FormatStyle Style = getLLVMStyle();
+ // Begin with tests covering the case where there is no constraint on the
+ // col
@@ -11224,6 +11224,328 @@ TEST_F(FormatTest,
WrapsTemplateDeclarationsWithComments) {
Style);
}
+TEST_F(FormatTest, BreakBeforeTemplateCloser) {
+ FormatStyle Style = getLLVMStyle();
+ // Begin with tests covering the case where there is no constraint on the
+ // col
@@ -11224,6 +11224,328 @@ TEST_F(FormatTest,
WrapsTemplateDeclarationsWithComments) {
Style);
}
+TEST_F(FormatTest, BreakBeforeTemplateCloser) {
+ FormatStyle Style = getLLVMStyle();
+ // Begin with tests covering the case where there is no constraint on the
+ // col
@@ -11224,6 +11224,328 @@ TEST_F(FormatTest,
WrapsTemplateDeclarationsWithComments) {
Style);
}
+TEST_F(FormatTest, BreakBeforeTemplateCloser) {
+ FormatStyle Style = getLLVMStyle();
+ // Begin with tests covering the case where there is no constraint on the
+ // col
owenca wrote:
What about changing it to an option (e.g. `BinPackBracedListThreshold`) with a
default value of about 20? If the number of elements in the list is more than
the threshold, they will be bin packed even if `BinPackArguments` is set to
false.
https://github.com/llvm/llvm-project/pu
@@ -11224,6 +11224,328 @@ TEST_F(FormatTest,
WrapsTemplateDeclarationsWithComments) {
Style);
}
+TEST_F(FormatTest, BreakBeforeTemplateCloser) {
+ FormatStyle Style = getLLVMStyle();
+ // Begin with tests covering the case where there is no constraint on the
+ // col
@@ -11224,6 +11224,328 @@ TEST_F(FormatTest,
WrapsTemplateDeclarationsWithComments) {
Style);
}
+TEST_F(FormatTest, BreakBeforeTemplateCloser) {
+ FormatStyle Style = getLLVMStyle();
+ // Begin with tests covering the case where there is no constraint on the
+ // col
https://github.com/owenca closed
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
@@ -11224,6 +11224,328 @@ TEST_F(FormatTest,
WrapsTemplateDeclarationsWithComments) {
Style);
}
+TEST_F(FormatTest, BreakBeforeTemplateCloser) {
+ FormatStyle Style = getLLVMStyle();
+ // Begin with tests covering the case where there is no constraint on the
+ // col
@@ -11224,6 +11224,328 @@ TEST_F(FormatTest,
WrapsTemplateDeclarationsWithComments) {
Style);
}
+TEST_F(FormatTest, BreakBeforeTemplateCloser) {
+ FormatStyle Style = getLLVMStyle();
+ // Begin with tests covering the case where there is no constraint on the
+ // col
@@ -11224,6 +11224,328 @@ TEST_F(FormatTest,
WrapsTemplateDeclarationsWithComments) {
Style);
}
+TEST_F(FormatTest, BreakBeforeTemplateCloser) {
+ FormatStyle Style = getLLVMStyle();
+ // Begin with tests covering the case where there is no constraint on the
+ // col
@@ -11224,6 +11224,328 @@ TEST_F(FormatTest,
WrapsTemplateDeclarationsWithComments) {
Style);
}
+TEST_F(FormatTest, BreakBeforeTemplateCloser) {
+ FormatStyle Style = getLLVMStyle();
+ // Begin with tests covering the case where there is no constraint on the
+ // col
@@ -11224,6 +11224,328 @@ TEST_F(FormatTest,
WrapsTemplateDeclarationsWithComments) {
Style);
}
+TEST_F(FormatTest, BreakBeforeTemplateCloser) {
+ FormatStyle Style = getLLVMStyle();
+ // Begin with tests covering the case where there is no constraint on the
+ // col
@@ -11224,6 +11224,328 @@ TEST_F(FormatTest,
WrapsTemplateDeclarationsWithComments) {
Style);
}
+TEST_F(FormatTest, BreakBeforeTemplateCloser) {
+ FormatStyle Style = getLLVMStyle();
+ // Begin with tests covering the case where there is no constraint on the
+ // col
@@ -11224,6 +11224,328 @@ TEST_F(FormatTest,
WrapsTemplateDeclarationsWithComments) {
Style);
}
+TEST_F(FormatTest, BreakBeforeTemplateCloser) {
+ FormatStyle Style = getLLVMStyle();
+ // Begin with tests covering the case where there is no constraint on the
+ // col
@@ -11224,6 +11224,328 @@ TEST_F(FormatTest,
WrapsTemplateDeclarationsWithComments) {
Style);
}
+TEST_F(FormatTest, BreakBeforeTemplateCloser) {
+ FormatStyle Style = getLLVMStyle();
+ // Begin with tests covering the case where there is no constraint on the
+ // col
@@ -11224,6 +11224,328 @@ TEST_F(FormatTest,
WrapsTemplateDeclarationsWithComments) {
Style);
}
+TEST_F(FormatTest, BreakBeforeTemplateCloser) {
+ FormatStyle Style = getLLVMStyle();
+ // Begin with tests covering the case where there is no constraint on the
+ // col
@@ -11224,6 +11224,328 @@ TEST_F(FormatTest,
WrapsTemplateDeclarationsWithComments) {
Style);
}
+TEST_F(FormatTest, BreakBeforeTemplateCloser) {
+ FormatStyle Style = getLLVMStyle();
+ // Begin with tests covering the case where there is no constraint on the
+ // col
@@ -11224,6 +11224,328 @@ TEST_F(FormatTest,
WrapsTemplateDeclarationsWithComments) {
Style);
}
+TEST_F(FormatTest, BreakBeforeTemplateCloser) {
+ FormatStyle Style = getLLVMStyle();
+ // Begin with tests covering the case where there is no constraint on the
+ // col
https://github.com/owenca closed
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
https://github.com/owenca edited
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
@@ -11224,6 +11224,254 @@ TEST_F(FormatTest,
WrapsTemplateDeclarationsWithComments) {
Style);
}
+TEST_F(FormatTest, BreakBeforeTemplateCloser) {
+ FormatStyle Style = getLLVMStyle();
+ // Begin with tests covering the case where there is no constraint on the
+ // col
@@ -2252,6 +2252,33 @@ struct FormatStyle {
/// \version 16
BreakBeforeInlineASMColonStyle BreakBeforeInlineASMColon;
+ /// If ``true``, a line break will be placed before the ``>`` in a block
+ /// indented template declaration.
owenca wrote:
```sugges
https://github.com/owenca 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
https://github.com/owenca created
https://github.com/llvm/llvm-project/pull/126340
Fixes #125012.
>From a0e44456a4fa1f5ef1168ac0e399b7113252bf96 Mon Sep 17 00:00:00 2001
From: Owen Pan
Date: Fri, 7 Feb 2025 19:53:17 -0800
Subject: [PATCH] [clang-format] Handle C-style cast of member function p
owenca wrote:
See #126340.
https://github.com/llvm/llvm-project/pull/126019
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/owenca 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
https://github.com/owenca 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
https://github.com/owenca updated
https://github.com/llvm/llvm-project/pull/112482
>From 8282f754ae40b64a88e2d22a6cb21e7028da8371 Mon Sep 17 00:00:00 2001
From: Gedare Bloom
Date: Tue, 15 Oct 2024 23:55:49 -0600
Subject: [PATCH 1/8] [clang-format] add BinPackLongBracedList style option
The use
https://github.com/owenca closed
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
https://github.com/owenca milestoned
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
owenca wrote:
/cherry-pick 8d373ceaec1f1b27c9e682cfaf71aae19ea48d98
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
owenca wrote:
> > Diagnostic output should go to stderr, but the informational output of
> > git-clang-format is sent to stdout instead.
>
> What does that mean? The printing of null-terminated paths on stdout is
> pretty standard on unix utilities. What's "diagnostic" and "informational"?
Di
owenca wrote:
You mean 20.x?
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
@@ -14185,6 +14185,32 @@ TEST_F(FormatTest, LayoutCxx11BraceInitializers) {
"ff, g, hh, ii, jj, kk,\n"
"};",
NoBinPacking);
+ NoBinPacking.BinPackLongBracedLists = false;
owenca wrote:
```suggestion
NoBinPacki
@@ -14185,6 +14185,32 @@ TEST_F(FormatTest, LayoutCxx11BraceInitializers) {
"ff, g, hh, ii, jj, kk,\n"
"};",
NoBinPacking);
+ NoBinPacking.BinPackLongBracedLists = false;
+ verifyFormat("const Aa a = {\n"
+
@@ -1212,6 +1212,22 @@ struct FormatStyle {
/// \version 3.7
bool BinPackArguments;
+ /// If ``BinPackLongBracedLists`` is ``true`` it overrides
+ /// ``BinPackArguments`` if there are 20 or more items in a braced
+ /// initializer list.
+ /// \code
+ ///BinPackLo
@@ -14185,6 +14185,32 @@ TEST_F(FormatTest, LayoutCxx11BraceInitializers) {
"ff, g, hh, ii, jj, kk,\n"
"};",
NoBinPacking);
+ NoBinPacking.BinPackLongBracedLists = false;
+ verifyFormat("const Aa a = {\n"
+
@@ -2520,6 +2536,9 @@ struct FormatStyle {
/// (e.g. a type or variable name), clang-format formats as if the ``{}``
were
/// the parentheses of a function call with that name. If there is no name,
/// a zero-length name is assumed.
+ ///
+ /// ``BinPackArguments`` may
@@ -874,6 +874,11 @@ TEST_F(TokenAnnotatorTest, UnderstandsCasts) {
EXPECT_TOKEN(Tokens[14], tok::r_paren, TT_CastRParen);
EXPECT_TOKEN(Tokens[15], tok::amp, TT_UnaryOperator);
+ Tokens = annotate("func((foo(bar::*)(void))&a);");
owenca wrote:
So `foo` i
owenca wrote:
The root cause is that the l_paren after the return type is not annotated.
That's why the space between them is missing.
https://github.com/llvm/llvm-project/pull/126019
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lis
https://github.com/owenca closed
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
@@ -28430,6 +28430,36 @@ TEST_F(FormatTest, ShortNamespacesOption) {
"}}} // namespace foo::bar::baz",
"namespace foo { namespace bar { namespace baz { class qux; } } }",
Style);
+ Style.FixNamespaceComments = false;
+
+ Style.BreakBeforeBraces = FormatStyle
@@ -367,8 +367,12 @@ class LineJoiner {
if (Style.AllowShortNamespacesOnASingleLine &&
TheLine->First->is(tok::kw_namespace) &&
-TheLine->Last->is(tok::l_brace)) {
- const auto result = tryMergeNamespace(I, E, Limit);
+((Style.BraceWrapping.Aft
@@ -28430,6 +28430,36 @@ TEST_F(FormatTest, ShortNamespacesOption) {
"}}} // namespace foo::bar::baz",
"namespace foo { namespace bar { namespace baz { class qux; } } }",
Style);
+ Style.FixNamespaceComments = false;
+
+ Style.BreakBeforeBraces = FormatStyle
@@ -28430,6 +28430,36 @@ TEST_F(FormatTest, ShortNamespacesOption) {
"}}} // namespace foo::bar::baz",
"namespace foo { namespace bar { namespace baz { class qux; } } }",
Style);
+ Style.FixNamespaceComments = false;
+
+ Style.BreakBeforeBraces = FormatStyle
@@ -628,28 +632,36 @@ class LineJoiner {
unsigned tryMergeNamespace(ArrayRef::const_iterator I,
ArrayRef::const_iterator E,
- unsigned Limit) {
+ unsigned Limit, bool OpenBraceWrapped) {
---
owenca wrote:
> > It seems that `git-clang-format` was not designed for its output to be
> > consumed by another utility as it prints everything to `stdout` instead of
> > `stderr`. Adding an option like`--print0` (especially just for `--staged`)
> > looks odd to me.
>
> No, the approach of p
@@ -874,6 +874,11 @@ TEST_F(TokenAnnotatorTest, UnderstandsCasts) {
EXPECT_TOKEN(Tokens[14], tok::r_paren, TT_CastRParen);
EXPECT_TOKEN(Tokens[15], tok::amp, TT_UnaryOperator);
+ Tokens = annotate("func((foo(bar::*)(void))&a);");
owenca wrote:
What's `fo
https://github.com/owenca updated
https://github.com/llvm/llvm-project/pull/125327
>From af3d964d74634f0dd9f7216572c1d852b7a549dc Mon Sep 17 00:00:00 2001
From: Owen Pan
Date: Fri, 31 Jan 2025 18:32:33 -0800
Subject: [PATCH 1/2] [clang-format] Hanlde qualified type names
Fixes #125178.
---
cl
@@ -11220,6 +11220,333 @@ TEST_F(FormatTest,
WrapsTemplateDeclarationsWithComments) {
Style);
}
+TEST_F(FormatTest, BreakBeforeTemplateCloser) {
+ FormatStyle Style = getGoogleStyle(FormatStyle::LK_Cpp);
+ // Begin with tests covering the case where there is no constr
owenca wrote:
Same reason we almost never handle them, just like we (almost?) never handle
the possibility of templated qualified names of arbitrary nesting levels (e.g.
`A1::A2 … An`) and of comments before _every_ token. We can always
tweak the code if and when we need to handle these rare c
owenca wrote:
> Seems to also work for top-level types (`::int_64_t constexpr x{123};` works
> correctly)
It didn't work either.
https://github.com/llvm/llvm-project/pull/125327
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.
owenca 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 for names l
https://github.com/owenca closed
https://github.com/llvm/llvm-project/pull/125021
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/owenca closed
https://github.com/llvm/llvm-project/pull/125019
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
owenca wrote:
> > From #123921, it seems that you only want the new option to work with
> > `--staged`, but should it also work with other options that may print a
> > list of filenames?
>
> I don't know; I only use `git clang-format` as in #123921 and I am not
> familiar with all its uses. I
@@ -11220,6 +11220,333 @@ TEST_F(FormatTest,
WrapsTemplateDeclarationsWithComments) {
Style);
}
+TEST_F(FormatTest, BreakBeforeTemplateCloser) {
+ FormatStyle Style = getGoogleStyle(FormatStyle::LK_Cpp);
+ // Begin with tests covering the case where there is no constr
@@ -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
@@ -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
https://github.com/owenca closed
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
https://github.com/owenca created
https://github.com/llvm/llvm-project/pull/125326
None
>From d2a9862cb4f88ebb92f0d5266ffd80aec51b8f04 Mon Sep 17 00:00:00 2001
From: Owen Pan
Date: Fri, 31 Jan 2025 18:19:37 -0800
Subject: [PATCH] [clang-format] Fix a bug in annotating ClassHeadName
---
clang
https://github.com/owenca created
https://github.com/llvm/llvm-project/pull/125327
Fixes #125178.
>From af3d964d74634f0dd9f7216572c1d852b7a549dc Mon Sep 17 00:00:00 2001
From: Owen Pan
Date: Fri, 31 Jan 2025 18:32:33 -0800
Subject: [PATCH] [clang-format] Hanlde qualified type names
Fixes #125
https://github.com/owenca edited
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
Author: Owen Pan
Date: 2025-01-31T18:52:53-08:00
New Revision: 280609c215e4a684cad215ea5be913293de0d255
URL:
https://github.com/llvm/llvm-project/commit/280609c215e4a684cad215ea5be913293de0d255
DIFF:
https://github.com/llvm/llvm-project/commit/280609c215e4a684cad215ea5be913293de0d255.diff
LOG:
owenca 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 for names like `A1::A
https://github.com/owenca closed
https://github.com/llvm/llvm-project/pull/118513
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/owenca closed
https://github.com/llvm/llvm-project/pull/119044
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/owenca approved this pull request.
https://github.com/llvm/llvm-project/pull/119044
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/owenca updated
https://github.com/llvm/llvm-project/pull/119044
>From c5bf1fc70df08ef94cc32a47d1bdce69c92c2abf Mon Sep 17 00:00:00 2001
From: Gedare Bloom
Date: Fri, 6 Dec 2024 16:52:35 -0700
Subject: [PATCH 1/2] [clang-format] Reorder TokenAnnotator::canBreakBefore
Move the
@@ -6105,6 +6105,35 @@ bool TokenAnnotator::canBreakBefore(const AnnotatedLine
&Line,
return false;
}
+ // We can break before an r_brace if there was a corresponding break after
+ // the l_brace, which is tracked by BreakBeforeClosingBrace, or if we are
+ // in a
owenca wrote:
Ping @mydeveloperday @HazardyKnusperkeks
https://github.com/llvm/llvm-project/pull/118513
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/owenca edited
https://github.com/llvm/llvm-project/pull/119666
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/owenca created
https://github.com/llvm/llvm-project/pull/119666
Also clean up dump_format_style.py and dump_format_help.py.
>From 6105a4ba95e7458623e2bf7363f0d454c3bd1b9a Mon Sep 17 00:00:00 2001
From: Owen Pan
Date: Wed, 11 Dec 2024 23:14:29 -0800
Subject: [PATCH] [clang-fo
Author: Owen Pan
Date: 2024-12-14T19:42:43-08:00
New Revision: 8c681a929b8684f5a4ad2ebd4e3e4f20036a9595
URL:
https://github.com/llvm/llvm-project/commit/8c681a929b8684f5a4ad2ebd4e3e4f20036a9595
DIFF:
https://github.com/llvm/llvm-project/commit/8c681a929b8684f5a4ad2ebd4e3e4f20036a9595.diff
LOG:
owenca wrote:
You should add unit tests in `clang/unittests/Format/`.
https://github.com/llvm/llvm-project/pull/119428
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -19,3 +22,8 @@ config.suffixes = [
".td",
".test"
]
+
+# AIX 'diff' command doesn't support --strip-trailing-cr, but the internal
+# python implementation does, so use that for cross platform compatibility
+if platform.system() == "AIX":
+config.test_format = lit
https://github.com/owenca closed
https://github.com/llvm/llvm-project/pull/119989
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
owenca wrote:
ping
https://github.com/llvm/llvm-project/pull/119522
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Author: Owen Pan
Date: 2024-12-18T19:41:50-08:00
New Revision: fe2685303b215182b1acc5b6fb8be30c24bd6e8e
URL:
https://github.com/llvm/llvm-project/commit/fe2685303b215182b1acc5b6fb8be30c24bd6e8e
DIFF:
https://github.com/llvm/llvm-project/commit/fe2685303b215182b1acc5b6fb8be30c24bd6e8e.diff
LOG:
@@ -217,6 +217,19 @@ TEST_F(MacroCallReconstructorTest, Identifier) {
EXPECT_THAT(std::move(Unexp).takeResult(),
matchesLine(line(U.consume("X";
}
+TEST_F(MacroCallReconstructorTest, EmptyExpansion) {
+ auto Macros = createExpander({"A(x)=y"});
owenca
https://github.com/owenca commented:
Please rebase and run `ninja clang-format-style`.
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
https://github.com/owenca closed
https://github.com/llvm/llvm-project/pull/119666
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Author: Owen Pan
Date: 2024-12-12T23:22:26-08:00
New Revision: ea44647a0b49de826191eeb6e05020262b5a81e9
URL:
https://github.com/llvm/llvm-project/commit/ea44647a0b49de826191eeb6e05020262b5a81e9
DIFF:
https://github.com/llvm/llvm-project/commit/ea44647a0b49de826191eeb6e05020262b5a81e9.diff
LOG:
https://github.com/owenca updated
https://github.com/llvm/llvm-project/pull/119666
>From 8ee6f99cd55cb8d30340e6e89e70c60b54c07aab Mon Sep 17 00:00:00 2001
From: Owen Pan
Date: Thu, 12 Dec 2024 23:27:23 -0800
Subject: [PATCH] [clang-format] Add --strip-trailing-cr to diff in
docs_updated.test
https://github.com/owenca edited
https://github.com/llvm/llvm-project/pull/119666
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
owenca wrote:
> Is the cleanup just running `black`? Would be better committed separately in
> my opinion.
See ea44647a0b49de826191eeb6e05020262b5a81e9.
https://github.com/llvm/llvm-project/pull/119666
___
cfe-commits mailing list
cfe-commits@lists.l
https://github.com/owenca created
https://github.com/llvm/llvm-project/pull/119958
Fixes #59066.
>From 393e153c8ce6ec713ad9653f5f37eacc72b17b39 Mon Sep 17 00:00:00 2001
From: Owen Pan
Date: Sat, 14 Dec 2024 00:33:35 -0800
Subject: [PATCH] [clang-format] Fix a bug in annotating arrows after ini
https://github.com/owenca edited
https://github.com/llvm/llvm-project/pull/119989
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
1901 - 2000 of 2694 matches
Mail list logo