summaryrefslogtreecommitdiffstats
path: root/clang/lib/Format/Format.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2012-12-17 11:29:41 +0000
committerDaniel Jasper <djasper@google.com>2012-12-17 11:29:41 +0000
commite25509f85774529e2fe3e9631ada2200569f7698 (patch)
tree4e0ee02db0725abfff71499d5891187d4bb4ec27 /clang/lib/Format/Format.cpp
parent1aae0e67fa09e04406539abbec65dddfa6dc7e99 (diff)
downloadbcm5719-llvm-e25509f85774529e2fe3e9631ada2200569f7698.tar.gz
bcm5719-llvm-e25509f85774529e2fe3e9631ada2200569f7698.zip
Fix several formatting problems.
More specifically: - Improve formatting of static initializers. - Fix formatting of lines comments in enums. - Fix formmating of trailing line comments. llvm-svn: 170316
Diffstat (limited to 'clang/lib/Format/Format.cpp')
-rw-r--r--clang/lib/Format/Format.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/clang/lib/Format/Format.cpp b/clang/lib/Format/Format.cpp
index e8faa12a263..eb077d39e58 100644
--- a/clang/lib/Format/Format.cpp
+++ b/clang/lib/Format/Format.cpp
@@ -734,15 +734,16 @@ private:
}
bool canBreakBetween(const FormatToken &Left, const FormatToken &Right) {
- if (Right.Tok.is(tok::r_paren))
+ if (Right.Tok.is(tok::r_paren) || Right.Tok.is(tok::l_brace) ||
+ Right.Tok.is(tok::comment) || Right.Tok.is(tok::greater))
return false;
if (isBinaryOperator(Left))
return true;
if (Right.Tok.is(tok::lessless))
return true;
- return Right.Tok.is(tok::colon) || Left.Tok.is(tok::comma) ||
- Left.Tok.is(tok::semi) || Left.Tok.is(tok::equal) ||
- Left.Tok.is(tok::ampamp) || Left.Tok.is(tok::pipepipe) ||
+ return Right.Tok.is(tok::colon) || Left.Tok.is(tok::comma) || Left.Tok.is(
+ tok::semi) || Left.Tok.is(tok::equal) || Left.Tok.is(tok::ampamp) ||
+ Left.Tok.is(tok::pipepipe) || Left.Tok.is(tok::l_brace) ||
(Left.Tok.is(tok::l_paren) && !Right.Tok.is(tok::r_paren));
}
OpenPOWER on IntegriCloud