summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorKrasimir Georgiev <krasimir@google.com>2018-03-27 13:14:29 +0000
committerKrasimir Georgiev <krasimir@google.com>2018-03-27 13:14:29 +0000
commit03e69f5cb43cef2e4e11b2f607b9e8db2e275383 (patch)
tree769d1c4d253b105a53121656c9f4c14c3cfc4536 /clang/lib
parent5f7ab4fedf8ffeb50e5cf33b44ee5bb9e340c8d0 (diff)
downloadbcm5719-llvm-03e69f5cb43cef2e4e11b2f607b9e8db2e275383.tar.gz
bcm5719-llvm-03e69f5cb43cef2e4e11b2f607b9e8db2e275383.zip
Revert "[clang-format] Remove empty lines before }[;] // comment"
This reverts commit r327861. The empty line before namespaces is desired in some places. We need a better approach to handle this. llvm-svn: 328621
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Format/UnwrappedLineFormatter.cpp6
1 files changed, 1 insertions, 5 deletions
diff --git a/clang/lib/Format/UnwrappedLineFormatter.cpp b/clang/lib/Format/UnwrappedLineFormatter.cpp
index b0da0028bf3..2ce39fb04c6 100644
--- a/clang/lib/Format/UnwrappedLineFormatter.cpp
+++ b/clang/lib/Format/UnwrappedLineFormatter.cpp
@@ -1133,12 +1133,8 @@ void UnwrappedLineFormatter::formatFirstToken(const AnnotatedLine &Line,
std::min(RootToken.NewlinesBefore, Style.MaxEmptyLinesToKeep + 1);
// Remove empty lines before "}" where applicable.
if (RootToken.is(tok::r_brace) &&
- // Look for "}", "} // comment", "};" or "}; // comment".
(!RootToken.Next ||
- (RootToken.Next->is(tok::comment) && !RootToken.Next->Next) ||
- (RootToken.Next->is(tok::semi) &&
- (!RootToken.Next->Next || (RootToken.Next->Next->is(tok::comment) &&
- !RootToken.Next->Next->Next)))))
+ (RootToken.Next->is(tok::semi) && !RootToken.Next->Next)))
Newlines = std::min(Newlines, 1u);
// Remove empty lines at the start of nested blocks (lambdas/arrow functions)
if (PreviousLine == nullptr && Line.Level > 0)
OpenPOWER on IntegriCloud