summaryrefslogtreecommitdiffstats
path: root/clang/lib/Format/ContinuationIndenter.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2013-09-06 07:54:20 +0000
committerDaniel Jasper <djasper@google.com>2013-09-06 07:54:20 +0000
commit1c5d9df8d1af0f266923edba8fcb367a51a03d26 (patch)
tree390bc8bac153490c628dc129b01b5f34bd50ec32 /clang/lib/Format/ContinuationIndenter.cpp
parent3b1cc9b858462aa190e3b27089f6f9f8c9dd9bb6 (diff)
downloadbcm5719-llvm-1c5d9df8d1af0f266923edba8fcb367a51a03d26.tar.gz
bcm5719-llvm-1c5d9df8d1af0f266923edba8fcb367a51a03d26.zip
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. llvm-svn: 190123
Diffstat (limited to 'clang/lib/Format/ContinuationIndenter.cpp')
-rw-r--r--clang/lib/Format/ContinuationIndenter.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/lib/Format/ContinuationIndenter.cpp b/clang/lib/Format/ContinuationIndenter.cpp
index 9e84ea770fe..d48cb23da94 100644
--- a/clang/lib/Format/ContinuationIndenter.cpp
+++ b/clang/lib/Format/ContinuationIndenter.cpp
@@ -63,7 +63,8 @@ ContinuationIndenter::ContinuationIndenter(const FormatStyle &Style,
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 @@ LineState ContinuationIndenter::getInitialState(unsigned FirstIndent,
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;
}
OpenPOWER on IntegriCloud