From 48dc980847b25384511276e37c02c7edcf9e3d3a Mon Sep 17 00:00:00 2001 From: Sam McCall Date: Mon, 21 Feb 2022 22:42:35 +0100 Subject: [PATCH] [Format] Remove unused LineContainsContinuedForLoopSection. NFC Differential Revision: https://reviews.llvm.org/D120282 --- clang/lib/Format/ContinuationIndenter.cpp | 3 --- clang/lib/Format/ContinuationIndenter.h | 6 ------ 2 files changed, 9 deletions(-) diff --git a/clang/lib/Format/ContinuationIndenter.cpp b/clang/lib/Format/ContinuationIndenter.cpp index f4a7552..ec268e7 100644 --- a/clang/lib/Format/ContinuationIndenter.cpp +++ b/clang/lib/Format/ContinuationIndenter.cpp @@ -253,7 +253,6 @@ LineState ContinuationIndenter::getInitialState(unsigned FirstIndent, State.Stack.push_back(ParenState(/*Tok=*/nullptr, FirstIndent, FirstIndent, /*AvoidBinPacking=*/false, /*NoLineBreak=*/false)); - State.LineContainsContinuedForLoopSection = false; State.NoContinuation = false; State.StartOfStringLiteral = 0; State.StartOfLineLevel = 0; @@ -343,8 +342,6 @@ bool ContinuationIndenter::mustBreak(const LineState &State) { return true; if (CurrentState.BreakBeforeClosingParen && Current.is(tok::r_paren)) return true; - if (Previous.is(tok::semi) && State.LineContainsContinuedForLoopSection) - return true; if (Style.Language == FormatStyle::LK_ObjC && Style.ObjCBreakBeforeNestedBlockParam && Current.ObjCSelectorNameParts > 1 && diff --git a/clang/lib/Format/ContinuationIndenter.h b/clang/lib/Format/ContinuationIndenter.h index 0eb53cb..494a972 100644 --- a/clang/lib/Format/ContinuationIndenter.h +++ b/clang/lib/Format/ContinuationIndenter.h @@ -419,9 +419,6 @@ struct LineState { /// The token that needs to be next formatted. FormatToken *NextToken; - /// \c true if this line contains a continued for-loop section. - bool LineContainsContinuedForLoopSection; - /// \c true if \p NextToken should not continue this line. bool NoContinuation; @@ -468,9 +465,6 @@ struct LineState { return NextToken < Other.NextToken; if (Column != Other.Column) return Column < Other.Column; - if (LineContainsContinuedForLoopSection != - Other.LineContainsContinuedForLoopSection) - return LineContainsContinuedForLoopSection; if (NoContinuation != Other.NoContinuation) return NoContinuation; if (StartOfLineLevel != Other.StartOfLineLevel) -- 2.7.4