diff options
author | Daniel Jasper <djasper@google.com> | 2013-01-07 13:26:07 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2013-01-07 13:26:07 +0000 |
commit | cd162384a552ef4e4913244f4f14b9a3e5a791e1 (patch) | |
tree | 62809bc6826e5e3360aa2f24e54d1e28668479de /lib/Format/Format.cpp | |
parent | 9cda8000434be3360abb38fe1690fa24ae3d48be (diff) |
Reformat clang-formats source code.
All changes done by clang-format itself. No functional changes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171732 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Format/Format.cpp')
-rw-r--r-- | lib/Format/Format.cpp | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/lib/Format/Format.cpp b/lib/Format/Format.cpp index 471021a370..4a34ad8e1d 100644 --- a/lib/Format/Format.cpp +++ b/lib/Format/Format.cpp @@ -263,7 +263,7 @@ private: // constructs. State.Column = Line.Level * 2 + 2; } else if (Current.Tok.is(tok::string_literal) && - Previous.Tok.is(tok::string_literal)) { + Previous.Tok.is(tok::string_literal)) { State.Column = State.Column - Previous.TokenLength; } else if (Current.Tok.is(tok::lessless) && State.FirstLessLess[ParenLevel] != 0) { @@ -484,17 +484,17 @@ private: unsigned Spaces, unsigned WhitespaceStartColumn) { std::string NewLineText; if (NewLines > 0) { - unsigned Offset = - std::min<int>(Style.ColumnLimit - 1, WhitespaceStartColumn); + unsigned Offset = std::min<int>(Style.ColumnLimit - 1, + WhitespaceStartColumn); for (unsigned i = 0; i < NewLines; ++i) { NewLineText += std::string(Style.ColumnLimit - Offset - 1, ' '); NewLineText += "\\\n"; Offset = 0; } } - Replaces.insert(tooling::Replacement( - SourceMgr, Tok.WhiteSpaceStart, Tok.WhiteSpaceLength, - NewLineText + std::string(Spaces, ' '))); + Replaces.insert(tooling::Replacement(SourceMgr, Tok.WhiteSpaceStart, + Tok.WhiteSpaceLength, NewLineText + + std::string(Spaces, ' '))); } /// \brief Add a new line and the required indent before the first Token @@ -505,8 +505,8 @@ private: if (!Token.WhiteSpaceStart.isValid() || StructuralError) return SourceMgr.getSpellingColumnNumber(Token.Tok.getLocation()) - 1; - unsigned Newlines = - std::min(Token.NewlinesBefore, Style.MaxEmptyLinesToKeep + 1); + unsigned Newlines = std::min(Token.NewlinesBefore, + Style.MaxEmptyLinesToKeep + 1); if (Newlines == 0 && !Token.IsFirst) Newlines = 1; unsigned Indent = Line.Level * 2; @@ -1084,8 +1084,8 @@ public: // Consume and record whitespace until we find a significant token. while (FormatTok.Tok.is(tok::unknown)) { FormatTok.NewlinesBefore += Text.count('\n'); - FormatTok.HasUnescapedNewline = - Text.count("\\\n") != FormatTok.NewlinesBefore; + FormatTok.HasUnescapedNewline = Text.count("\\\n") != + FormatTok.NewlinesBefore; FormatTok.WhiteSpaceLength += FormatTok.Tok.getLength(); if (FormatTok.Tok.is(tok::eof)) @@ -1157,8 +1157,8 @@ public: for (std::vector<UnwrappedLine>::iterator I = UnwrappedLines.begin(), E = UnwrappedLines.end(); I != E; ++I) - PreviousEndOfLineColumn = - formatUnwrappedLine(*I, PreviousEndOfLineColumn); + PreviousEndOfLineColumn = formatUnwrappedLine(*I, + PreviousEndOfLineColumn); return Replaces; } @@ -1170,11 +1170,11 @@ private: unsigned formatUnwrappedLine(const UnwrappedLine &TheLine, unsigned PreviousEndOfLineColumn) { if (TheLine.Tokens.empty()) - return 0; // FIXME: Find out how this can ever happen. + return 0; // FIXME: Find out how this can ever happen. - CharSourceRange LineRange = - CharSourceRange::getTokenRange(TheLine.Tokens.front().Tok.getLocation(), - TheLine.Tokens.back().Tok.getLocation()); + CharSourceRange LineRange = CharSourceRange::getTokenRange( + TheLine.Tokens.front().Tok.getLocation(), + TheLine.Tokens.back().Tok.getLocation()); for (unsigned i = 0, e = Ranges.size(); i != e; ++i) { if (SourceMgr.isBeforeInTranslationUnit(LineRange.getEnd(), @@ -1218,5 +1218,5 @@ tooling::Replacements reformat(const FormatStyle &Style, Lexer &Lex, return formatter.format(); } -} // namespace format -} // namespace clang +} // namespace format +} // namespace clang |