forked from OSchip/llvm-project
[clang-format] NFC clang-format the clang-format sources
Summary: In recent patches the clang-format code has become un-formatted, correct this before making additional changes Reviewers: mitchell-stellar, sylvestre.ledru, Abpostelnicu, Wawha, jbcoe Reviewed By: sylvestre.ledru, Abpostelnicu, jbcoe Subscribers: cfe-commits Tags: #clang, #clang-format Differential Revision: https://reviews.llvm.org/D78909
This commit is contained in:
parent
5c8c9905c2
commit
f594e3d2ab
|
@ -1466,10 +1466,11 @@ void ContinuationIndenter::moveStatePastScopeOpener(LineState &State,
|
|||
ParenState(&Current, NewIndent, LastSpace, AvoidBinPacking, NoLineBreak));
|
||||
State.Stack.back().NestedBlockIndent = NestedBlockIndent;
|
||||
State.Stack.back().BreakBeforeParameter = BreakBeforeParameter;
|
||||
State.Stack.back().HasMultipleNestedBlocks = (Current.BlockParameterCount > 1);
|
||||
State.Stack.back().HasMultipleNestedBlocks =
|
||||
(Current.BlockParameterCount > 1);
|
||||
|
||||
if (Style.BraceWrapping.BeforeLambdaBody &&
|
||||
Current.Next != nullptr && Current.Tok.is(tok::l_paren)) {
|
||||
if (Style.BraceWrapping.BeforeLambdaBody && Current.Next != nullptr &&
|
||||
Current.Tok.is(tok::l_paren)) {
|
||||
// Search for any parameter that is a lambda
|
||||
FormatToken const *next = Current.Next;
|
||||
while (next != nullptr) {
|
||||
|
|
|
@ -395,7 +395,7 @@ private:
|
|||
|
||||
if (!AttrTok)
|
||||
return false;
|
||||
|
||||
|
||||
// Allow an attribute to be the only content of a file.
|
||||
AttrTok = AttrTok->Next;
|
||||
if (!AttrTok)
|
||||
|
@ -2837,9 +2837,10 @@ bool TokenAnnotator::spaceRequiredBetween(const AnnotatedLine &Line,
|
|||
// operator std::Foo*()
|
||||
// operator C<T>::D<U>*()
|
||||
// dependent on PointerAlignment style.
|
||||
if (Previous && (Previous->endsSequence(tok::kw_operator) ||
|
||||
Previous->endsSequence(tok::kw_const, tok::kw_operator) ||
|
||||
Previous->endsSequence(tok::kw_volatile, tok::kw_operator)))
|
||||
if (Previous &&
|
||||
(Previous->endsSequence(tok::kw_operator) ||
|
||||
Previous->endsSequence(tok::kw_const, tok::kw_operator) ||
|
||||
Previous->endsSequence(tok::kw_volatile, tok::kw_operator)))
|
||||
return (Style.PointerAlignment != FormatStyle::PAS_Left);
|
||||
}
|
||||
const auto SpaceRequiredForArrayInitializerLSquare =
|
||||
|
@ -3325,22 +3326,20 @@ static bool isOneChildWithoutMustBreakBefore(const FormatToken &Tok) {
|
|||
if (Tok.Children.size() != 1)
|
||||
return false;
|
||||
FormatToken *curElt = Tok.Children[0]->First;
|
||||
while (curElt) {
|
||||
if (curElt->MustBreakBefore)
|
||||
return false;
|
||||
curElt = curElt->Next;
|
||||
}
|
||||
while (curElt) {
|
||||
if (curElt->MustBreakBefore)
|
||||
return false;
|
||||
curElt = curElt->Next;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
static bool
|
||||
isAllmanLambdaBrace(const FormatToken &Tok) {
|
||||
static bool isAllmanLambdaBrace(const FormatToken &Tok) {
|
||||
return (Tok.is(tok::l_brace) && Tok.BlockKind == BK_Block &&
|
||||
!Tok.isOneOf(TT_ObjCBlockLBrace, TT_DictLiteral));
|
||||
!Tok.isOneOf(TT_ObjCBlockLBrace, TT_DictLiteral));
|
||||
}
|
||||
|
||||
static bool
|
||||
isAllmanBraceIncludedBreakableLambda(const FormatToken &Tok,
|
||||
FormatStyle::ShortLambdaStyle ShortLambdaOption) {
|
||||
static bool isAllmanBraceIncludedBreakableLambda(
|
||||
const FormatToken &Tok, FormatStyle::ShortLambdaStyle ShortLambdaOption) {
|
||||
if (!isAllmanLambdaBrace(Tok))
|
||||
return false;
|
||||
|
||||
|
@ -3497,7 +3496,7 @@ bool TokenAnnotator::mustBreakBefore(const AnnotatedLine &Line,
|
|||
if (Style.BraceWrapping.BeforeLambdaBody &&
|
||||
(isAllmanBraceIncludedBreakableLambda(Left, ShortLambdaOption) ||
|
||||
isAllmanBraceIncludedBreakableLambda(Right, ShortLambdaOption))) {
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (isAllmanBrace(Left) || isAllmanBrace(Right))
|
||||
|
|
|
@ -1726,7 +1726,7 @@ bool UnwrappedLineParser::tryToParseBracedList() {
|
|||
bool UnwrappedLineParser::parseBracedList(bool ContinueOnSemicolons,
|
||||
tok::TokenKind ClosingBraceKind) {
|
||||
bool HasError = false;
|
||||
|
||||
|
||||
// FIXME: Once we have an expression parser in the UnwrappedLineParser,
|
||||
// replace this by using parseAssigmentExpression() inside.
|
||||
do {
|
||||
|
|
Loading…
Reference in New Issue