summaryrefslogtreecommitdiffstats
path: root/clang/lib/Format/UnwrappedLineParser.cpp
diff options
context:
space:
mode:
authorManuel Klimek <klimek@google.com>2013-08-07 19:20:45 +0000
committerManuel Klimek <klimek@google.com>2013-08-07 19:20:45 +0000
commita027f306a62626a48104096d53c538503ef0e10a (patch)
treebfbc9061f81b3d82817bab7ec3b1cb5547763d9f /clang/lib/Format/UnwrappedLineParser.cpp
parent89c862f29868fefd9d49fec214df52250fb82759 (diff)
downloadbcm5719-llvm-a027f306a62626a48104096d53c538503ef0e10a.tar.gz
bcm5719-llvm-a027f306a62626a48104096d53c538503ef0e10a.zip
Fixes a couple of bugs with the Allman brace breaking.
In particular, left braces after an enum declaration now occur on their own line. Further, when short ifs/whiles are allowed these no longer cause the left brace to be on the same line as the if/while when a brace is included. Patch by Thomas Gibson-Robinson. llvm-svn: 187901
Diffstat (limited to 'clang/lib/Format/UnwrappedLineParser.cpp')
-rw-r--r--clang/lib/Format/UnwrappedLineParser.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/Format/UnwrappedLineParser.cpp b/clang/lib/Format/UnwrappedLineParser.cpp
index c80c297de22..56fe81f3f2b 100644
--- a/clang/lib/Format/UnwrappedLineParser.cpp
+++ b/clang/lib/Format/UnwrappedLineParser.cpp
@@ -930,6 +930,8 @@ void UnwrappedLineParser::parseEnum() {
nextToken();
}
if (FormatTok->Tok.is(tok::l_brace)) {
+ if (Style.BreakBeforeBraces == FormatStyle::BS_Allman)
+ addUnwrappedLine();
nextToken();
addUnwrappedLine();
++Line->Level;
OpenPOWER on IntegriCloud