clang-format: Fix comment formatting bugs in nested blocks.
This fixes two issues:
1) The indent of a line comment was not adapted to the subsequent
statement as it would be outside of a nested block.
2) A missing DryRun flag caused actualy breaks to be inserted in
overly long comments while trying to come up with the best line
breaking decisions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190123 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Format/ContinuationIndenter.cpp b/lib/Format/ContinuationIndenter.cpp
index 9e84ea7..d48cb23 100644
--- a/lib/Format/ContinuationIndenter.cpp
+++ b/lib/Format/ContinuationIndenter.cpp
@@ -63,7 +63,8 @@
BinPackInconclusiveFunctions(BinPackInconclusiveFunctions) {}
LineState ContinuationIndenter::getInitialState(unsigned FirstIndent,
- const AnnotatedLine *Line) {
+ const AnnotatedLine *Line,
+ bool DryRun) {
LineState State;
State.FirstIndent = FirstIndent;
State.Column = FirstIndent;
@@ -80,8 +81,7 @@
State.IgnoreStackForComparison = false;
// The first token has already been indented and thus consumed.
- moveStateToNextToken(State, /*DryRun=*/false,
- /*Newline=*/false);
+ moveStateToNextToken(State, DryRun, /*Newline=*/false);
return State;
}