[clang] [clang-format] Change BinPackParameters to an enum to add a BreakAlways (PR #101882)
via cfe-commits
cfe-commits at lists.llvm.org
Sat Aug 17 02:09:06 PDT 2024
================
@@ -128,25 +128,6 @@ static bool startsSegmentOfBuilderTypeCall(const FormatToken &Tok) {
return Tok.isMemberAccess() && Tok.Previous && Tok.Previous->closesScope();
}
-// Returns \c true if \c Current starts a new parameter.
-static bool startsNextParameter(const FormatToken &Current,
- const FormatStyle &Style) {
- assert(Current.Previous);
- const auto &Previous = *Current.Previous;
- if (Current.is(TT_CtorInitializerComma) &&
- Style.BreakConstructorInitializers == FormatStyle::BCIS_BeforeComma) {
- return true;
- }
- if (Style.Language == FormatStyle::LK_Proto && Current.is(TT_SelectorName))
- return true;
- return Previous.is(tok::comma) && !Current.isTrailingComment() &&
- ((Previous.isNot(TT_CtorInitializerComma) ||
- Style.BreakConstructorInitializers !=
- FormatStyle::BCIS_BeforeComma) &&
- (Previous.isNot(TT_InheritanceComma) ||
- Style.BreakInheritanceList != FormatStyle::BILS_BeforeComma));
-}
-
----------------
VolatileAcorn wrote:
I'm not sure what the alternative is here?
I moved it so that it could be used in TokenAnnotator.cpp for the always break behavior.
https://github.com/llvm/llvm-project/pull/101882
More information about the cfe-commits
mailing list