aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Format/FormatToken.cpp
diff options
context:
space:
mode:
authorGedare Bloom <gedare@rtems.org>2025-02-07 23:10:35 -0700
committerGitHub <noreply@github.com>2025-02-07 22:10:35 -0800
commite0a21e23a7aa6acf3e07b866c3c599db5eb4b67f (patch)
treee692ea44452bf322e295173c53cb74ee7b45da1c /clang/lib/Format/FormatToken.cpp
parentde12bf508970ef9c0612c3950410530c4b822e6e (diff)
downloadllvm-e0a21e23a7aa6acf3e07b866c3c599db5eb4b67f.zip
llvm-e0a21e23a7aa6acf3e07b866c3c599db5eb4b67f.tar.gz
llvm-e0a21e23a7aa6acf3e07b866c3c599db5eb4b67f.tar.bz2
[clang-format] Add BinPackLongBracedList style option (#112482)
The use of Cpp11BracedListStyle with BinPackArguments=False avoids bin packing until reaching a hard-coded limit of 20 items. This is an arbitrary choice. Introduce a new style option to allow disabling this limit.
Diffstat (limited to 'clang/lib/Format/FormatToken.cpp')
-rw-r--r--clang/lib/Format/FormatToken.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Format/FormatToken.cpp b/clang/lib/Format/FormatToken.cpp
index 99bce1f..fb040a0 100644
--- a/clang/lib/Format/FormatToken.cpp
+++ b/clang/lib/Format/FormatToken.cpp
@@ -175,7 +175,7 @@ void CommaSeparatedList::precomputeFormattingInfos(const FormatToken *Token) {
// have many items (20 or more) or we allow bin-packing of function call
// arguments.
if (Style.Cpp11BracedListStyle && !Style.BinPackArguments &&
- Commas.size() < 19) {
+ (Commas.size() < 19 || !Style.BinPackLongBracedList)) {
return;
}