summaryrefslogtreecommitdiffstats
path: root/clang/lib/Format
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2015-02-17 10:05:15 +0000
committerDaniel Jasper <djasper@google.com>2015-02-17 10:05:15 +0000
commit699631298ed4324225011b1e26f9bf5c3ba9aa3b (patch)
tree49b323a6f4bc6f09ed2277763b9b67528204942e /clang/lib/Format
parentd97d5d5cf75133ac8872a49f7615e357ab1e13da (diff)
downloadbcm5719-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/Format')
-rw-r--r--clang/lib/Format/ContinuationIndenter.cpp4
-rw-r--r--clang/lib/Format/TokenAnnotator.cpp3
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.
OpenPOWER on IntegriCloud