summaryrefslogtreecommitdiffstats
path: root/clang/lib/Format/UnwrappedLineParser.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2012-12-05 14:57:28 +0000
committerDaniel Jasper <djasper@google.com>2012-12-05 14:57:28 +0000
commitaa1c920db85e7ac07d09b80eedc66bae7e358f26 (patch)
tree5e271422c3ddb54a4591c1eac6067c6c5a19f780 /clang/lib/Format/UnwrappedLineParser.cpp
parent8b51bab4958c0dddbfbbff92bc2ed0522dfec87b (diff)
downloadbcm5719-llvm-aa1c920db85e7ac07d09b80eedc66bae7e358f26.tar.gz
bcm5719-llvm-aa1c920db85e7ac07d09b80eedc66bae7e358f26.zip
Indentation fixes for clang-format.
- Fix behavior of memoization together with optimization - Correctly attribute the PenaltyIndentLevel (breaking directly after "(" did not count towards the inner level) - Recognize more tokens as assignments Review: http://llvm-reviews.chandlerc.com/D172 llvm-svn: 169384
Diffstat (limited to 'clang/lib/Format/UnwrappedLineParser.cpp')
-rw-r--r--clang/lib/Format/UnwrappedLineParser.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/lib/Format/UnwrappedLineParser.cpp b/clang/lib/Format/UnwrappedLineParser.cpp
index bdea42a2eb4..c2cb5b8027b 100644
--- a/clang/lib/Format/UnwrappedLineParser.cpp
+++ b/clang/lib/Format/UnwrappedLineParser.cpp
@@ -106,6 +106,12 @@ void UnwrappedLineParser::parseComment() {
}
void UnwrappedLineParser::parseStatement() {
+ // Consume leading line comments, e.g. for branches without compounds.
+ while (FormatTok.Tok.is(tok::comment)) {
+ nextToken();
+ addUnwrappedLine();
+ }
+
switch (FormatTok.Tok.getKind()) {
case tok::kw_public:
case tok::kw_protected:
OpenPOWER on IntegriCloud