https://github.com/owenca closed https://github.com/llvm/llvm-project/pull/95013
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
HazardyKnusperkeks wrote:
Nah, I can't find a better name, which isn't a whole sentence.
https://github.com/llvm/llvm-project/pull/95013
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
owenca wrote:
> Thanks for the review feedback @owenca @HazardyKnusperkeks Please merge this
> PR for me if you feel it is ready as I don't have merge permissions
I wonder if anyone can come up with a better name than `OnePerLine`. See
https://github.com/llvm/llvm-project/pull/101882#issuecomm
ameerj wrote:
Thanks for the review feedback @owenca @HazardyKnusperkeks
Please merge this PR for me if you feel it is ready as I don't have merge
permissions
https://github.com/llvm/llvm-project/pull/95013
___
cfe-commits mailing list
cfe-commits@lis
https://github.com/owenca approved this pull request.
https://github.com/llvm/llvm-project/pull/95013
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/ameerj edited https://github.com/llvm/llvm-project/pull/95013
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/ameerj updated
https://github.com/llvm/llvm-project/pull/95013
>From a50f3d4395efd09eea8ba2e750bb785857f9a550 Mon Sep 17 00:00:00 2001
From: ameerj
Date: Mon, 10 Jun 2024 12:09:40 -0400
Subject: [PATCH 01/19] Add BinPackBinaryOperations
---
clang/include/clang/Format/Format
https://github.com/owenca edited https://github.com/llvm/llvm-project/pull/95013
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -27630,6 +27630,245 @@ TEST_F(FormatTest, SpaceBetweenKeywordAndLiteral) {
verifyFormat("return sizeof \"5\";");
}
+TEST_F(FormatTest, BreakBinaryOperations) {
+ auto Style = getLLVMStyleWithColumns(60);
+ // Logical operations
owenca wrote:
```suggest
@@ -146,6 +147,33 @@ static bool startsNextParameter(const FormatToken &Current,
Style.BreakInheritanceList != FormatStyle::BILS_BeforeComma));
}
+// Returns \c true if \c Token in an alignable binary operator
+static bool isAlignableBinaryOperator(const FormatToken
@@ -27630,6 +27630,245 @@ TEST_F(FormatTest, SpaceBetweenKeywordAndLiteral) {
verifyFormat("return sizeof \"5\";");
}
+TEST_F(FormatTest, BreakBinaryOperations) {
+ auto Style = getLLVMStyleWithColumns(60);
+ // Logical operations
+ verifyFormat("if (condition1 && conditi
@@ -2231,6 +2231,41 @@ struct FormatStyle {
/// \version 3.7
bool BreakBeforeTernaryOperators;
+ /// Different ways to break binary operations.
+ enum BreakBinaryOperationsStyle : int8_t {
+/// Don't break binary operations
+/// \code
+///aaa + * ccc
@@ -2231,6 +2231,41 @@ struct FormatStyle {
/// \version 3.7
bool BreakBeforeTernaryOperators;
+ /// Different ways to break binary operations.
+ enum BreakBinaryOperationsStyle : int8_t {
+/// Don't break binary operations
+/// \code
+///aaa + * ccc
@@ -2231,6 +2231,41 @@ struct FormatStyle {
/// \version 3.7
bool BreakBeforeTernaryOperators;
+ /// Different ways to break binary operations.
+ enum BreakBinaryOperationsStyle : int8_t {
+/// Don't break binary operations
+/// \code
+///aaa + * ccc
@@ -27630,6 +27630,245 @@ TEST_F(FormatTest, SpaceBetweenKeywordAndLiteral) {
verifyFormat("return sizeof \"5\";");
}
+TEST_F(FormatTest, BreakBinaryOperations) {
+ auto Style = getLLVMStyleWithColumns(60);
+ // Logical operations
+ verifyFormat("if (condition1 && conditi
https://github.com/owenca commented:
This patch also fixes #58014 and #57280, so you can include them in the commit
message.
https://github.com/llvm/llvm-project/pull/95013
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org
https://github.com/owenca edited https://github.com/llvm/llvm-project/pull/95013
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -146,6 +147,33 @@ static bool startsNextParameter(const FormatToken &Current,
Style.BreakInheritanceList != FormatStyle::BILS_BeforeComma));
}
+// Returns \c true if \c Token in an alignable binary operator
+static bool isAlignableBinaryOperator(const FormatToken
ameerj wrote:
@owenca Can you review once more please?
https://github.com/llvm/llvm-project/pull/95013
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/ameerj updated
https://github.com/llvm/llvm-project/pull/95013
>From a50f3d4395efd09eea8ba2e750bb785857f9a550 Mon Sep 17 00:00:00 2001
From: ameerj
Date: Mon, 10 Jun 2024 12:09:40 -0400
Subject: [PATCH 01/18] Add BinPackBinaryOperations
---
clang/include/clang/Format/Format
ameerj wrote:
> Failed Tests (1):
Fixed in the latest commit
https://github.com/llvm/llvm-project/pull/95013
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/ameerj updated
https://github.com/llvm/llvm-project/pull/95013
>From a50f3d4395efd09eea8ba2e750bb785857f9a550 Mon Sep 17 00:00:00 2001
From: ameerj
Date: Mon, 10 Jun 2024 12:09:40 -0400
Subject: [PATCH 01/17] Add BinPackBinaryOperations
---
clang/include/clang/Format/Format
HazardyKnusperkeks wrote:
Fine by me. The build states:
Failed Tests (1):
Clang-Unit :: Format/./FormatTests/ConfigParseTest/ParsesConfiguration
Is this from this change?
https://github.com/llvm/llvm-project/pull/95013
___
cfe-commits mailing list
cf
https://github.com/mydeveloperday commented:
I have no major objection I'll go with whatever @owenca and
@HazardyKnusperkeks agree
https://github.com/llvm/llvm-project/pull/95013
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.
https://github.com/mydeveloperday commented:
I think the enum is clearer and leave you open to add new options as you did,
thank you,
https://github.com/llvm/llvm-project/pull/95013
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists
https://github.com/ameerj edited https://github.com/llvm/llvm-project/pull/95013
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/ameerj edited https://github.com/llvm/llvm-project/pull/95013
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
27 matches
Mail list logo