diff options
| author | Alexander Kornienko <alexfh@google.com> | 2013-12-12 09:49:52 +0000 |
|---|---|---|
| committer | Alexander Kornienko <alexfh@google.com> | 2013-12-12 09:49:52 +0000 |
| commit | 3a33f0292bcadc2eaf980ec7581dbe260f0e092b (patch) | |
| tree | 05922d09cc643457235fb3203c2d84f3cd999fc2 /clang/lib/Format/TokenAnnotator.cpp | |
| parent | a92e2311bb1345c60f6c90180028b8adf252897c (diff) | |
| download | bcm5719-llvm-3a33f0292bcadc2eaf980ec7581dbe260f0e092b.tar.gz bcm5719-llvm-3a33f0292bcadc2eaf980ec7581dbe260f0e092b.zip | |
Implemented GNU-style formatting for compound statements.
Summary:
Added BraceBreakingStyle::BS_GNU. I'm not sure about the correctness of
static initializer formatting, but compound statements should be fine.
Reviewers: djasper
Reviewed By: djasper
CC: cfe-commits, klimek
Differential Revision: http://llvm-reviews.chandlerc.com/D2372
llvm-svn: 197138
Diffstat (limited to 'clang/lib/Format/TokenAnnotator.cpp')
| -rw-r--r-- | clang/lib/Format/TokenAnnotator.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Format/TokenAnnotator.cpp b/clang/lib/Format/TokenAnnotator.cpp index b8905a9bfd3..37ad7336513 100644 --- a/clang/lib/Format/TokenAnnotator.cpp +++ b/clang/lib/Format/TokenAnnotator.cpp @@ -1410,7 +1410,8 @@ bool TokenAnnotator::mustBreakBefore(const AnnotatedLine &Line, Right.Previous->isNot(tok::r_brace) && Right.isNot(tok::r_brace)) { return true; } else if (Right.is(tok::l_brace) && (Right.BlockKind == BK_Block)) { - return Style.BreakBeforeBraces == FormatStyle::BS_Allman; + return Style.BreakBeforeBraces == FormatStyle::BS_Allman || + Style.BreakBeforeBraces == FormatStyle::BS_GNU; } return false; } |

