diff options
author | Daniel Jasper <djasper@google.com> | 2015-12-21 18:31:15 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2015-12-21 18:31:15 +0000 |
commit | eb65e912aaa0cb0bb7adf138495f3e25fb2ecdf6 (patch) | |
tree | 146c6e7dde2bfebec447e5008736aed6662a17e9 /clang/lib | |
parent | 3e88a3200ce111ee6491fedd5a48c5308afc3cad (diff) | |
download | bcm5719-llvm-eb65e912aaa0cb0bb7adf138495f3e25fb2ecdf6.tar.gz bcm5719-llvm-eb65e912aaa0cb0bb7adf138495f3e25fb2ecdf6.zip |
clang-format: Properly set the BlockKind for more blocks.
Before:
void f() { struct Dummy { };
f();
}
After:
void f() {
struct Dummy {};
f();
}
llvm-svn: 256175
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/Format/UnwrappedLineParser.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/Format/UnwrappedLineParser.cpp b/clang/lib/Format/UnwrappedLineParser.cpp index e06903c306c..ac534a2abe5 100644 --- a/clang/lib/Format/UnwrappedLineParser.cpp +++ b/clang/lib/Format/UnwrappedLineParser.cpp @@ -321,7 +321,7 @@ void UnwrappedLineParser::calculateBraceTypes(bool ExpectClassBody) { SmallVector<FormatToken *, 8> LBraceStack; assert(Tok->Tok.is(tok::l_brace)); do { - // Get next none-comment token. + // Get next non-comment token. FormatToken *NextTok; unsigned ReadTokens = 0; do { @@ -403,6 +403,7 @@ void UnwrappedLineParser::parseBlock(bool MustBeDeclaration, bool AddLevel, assert(FormatTok->isOneOf(tok::l_brace, TT_MacroBlockBegin) && "'{' or macro block token expected"); const bool MacroBlock = FormatTok->is(TT_MacroBlockBegin); + FormatTok->BlockKind = BK_Block; unsigned InitialLevel = Line->Level; nextToken(); @@ -421,6 +422,7 @@ void UnwrappedLineParser::parseBlock(bool MustBeDeclaration, bool AddLevel, if (MacroBlock ? !FormatTok->is(TT_MacroBlockEnd) : !FormatTok->is(tok::r_brace)) { Line->Level = InitialLevel; + FormatTok->BlockKind = BK_Block; return; } |