summaryrefslogtreecommitdiffstats
path: root/clang/lib/Format/TokenAnnotator.cpp
diff options
context:
space:
mode:
authorManuel Klimek <klimek@google.com>2015-07-28 15:50:24 +0000
committerManuel Klimek <klimek@google.com>2015-07-28 15:50:24 +0000
commit9e32199861c082d36b0439756f616ee91855dd6e (patch)
treec4384666af27058c1a441e9d2e47a3483032519a /clang/lib/Format/TokenAnnotator.cpp
parent7d47b7a29466ecfa7c9907243e1d375225a78fb0 (diff)
downloadbcm5719-llvm-9e32199861c082d36b0439756f616ee91855dd6e.tar.gz
bcm5719-llvm-9e32199861c082d36b0439756f616ee91855dd6e.zip
Do not force linebreaks when MaxEmptyLinesToKeep is 0.
Previously we would format call( p); as call( p); with MaxEmptyLinesToKeep == 0. Now we format it as: call(p); llvm-svn: 243429
Diffstat (limited to 'clang/lib/Format/TokenAnnotator.cpp')
-rw-r--r--clang/lib/Format/TokenAnnotator.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Format/TokenAnnotator.cpp b/clang/lib/Format/TokenAnnotator.cpp
index 36856eaeea9..bd6fde09113 100644
--- a/clang/lib/Format/TokenAnnotator.cpp
+++ b/clang/lib/Format/TokenAnnotator.cpp
@@ -2065,7 +2065,7 @@ static bool isAllmanBrace(const FormatToken &Tok) {
bool TokenAnnotator::mustBreakBefore(const AnnotatedLine &Line,
const FormatToken &Right) {
const FormatToken &Left = *Right.Previous;
- if (Right.NewlinesBefore > 1)
+ if (Right.NewlinesBefore > 1 && Style.MaxEmptyLinesToKeep > 0)
return true;
if (Style.Language == FormatStyle::LK_JavaScript) {
OpenPOWER on IntegriCloud