diff options
| author | Daniel Jasper <djasper@google.com> | 2015-02-17 10:05:15 +0000 |
|---|---|---|
| committer | Daniel Jasper <djasper@google.com> | 2015-02-17 10:05:15 +0000 |
| commit | 699631298ed4324225011b1e26f9bf5c3ba9aa3b (patch) | |
| tree | 49b323a6f4bc6f09ed2277763b9b67528204942e /clang/lib | |
| parent | d97d5d5cf75133ac8872a49f7615e357ab1e13da (diff) | |
| download | bcm5719-llvm-699631298ed4324225011b1e26f9bf5c3ba9aa3b.tar.gz bcm5719-llvm-699631298ed4324225011b1e26f9bf5c3ba9aa3b.zip | |
clang-format: Don't force a break after "endl" if everything fits on one line.
llvm-svn: 229486
Diffstat (limited to 'clang/lib')
| -rw-r--r-- | clang/lib/Format/ContinuationIndenter.cpp | 4 | ||||
| -rw-r--r-- | clang/lib/Format/TokenAnnotator.cpp | 3 |
2 files changed, 4 insertions, 3 deletions
diff --git a/clang/lib/Format/ContinuationIndenter.cpp b/clang/lib/Format/ContinuationIndenter.cpp index a02cb680728..7b36cac5dc1 100644 --- a/clang/lib/Format/ContinuationIndenter.cpp +++ b/clang/lib/Format/ContinuationIndenter.cpp @@ -232,6 +232,10 @@ bool ContinuationIndenter::mustBreak(const LineState &State) { Previous.is(tok::l_brace) && !Current.isOneOf(tok::r_brace, tok::comment)) return true; + if (Current.is(tok::lessless) && Previous.is(tok::identifier) && + Previous.TokenText == "endl") + return true; + return false; } diff --git a/clang/lib/Format/TokenAnnotator.cpp b/clang/lib/Format/TokenAnnotator.cpp index e00db2127d6..dc48d865510 100644 --- a/clang/lib/Format/TokenAnnotator.cpp +++ b/clang/lib/Format/TokenAnnotator.cpp @@ -1903,9 +1903,6 @@ bool TokenAnnotator::mustBreakBefore(const AnnotatedLine &Line, return true; if (Left.is(TT_ObjCBlockLBrace) && !Style.AllowShortBlocksOnASingleLine) return true; - if (Right.is(tok::lessless) && Left.is(tok::identifier) && - Left.TokenText == "endl") - return true; if (Style.Language == FormatStyle::LK_JavaScript) { // FIXME: This might apply to other languages and token kinds. |

