diff options
| author | Daniel Jasper <djasper@google.com> | 2013-04-05 17:22:09 +0000 |
|---|---|---|
| committer | Daniel Jasper <djasper@google.com> | 2013-04-05 17:22:09 +0000 |
| commit | 83193600993b2c70c1b13949652144dcffe3af81 (patch) | |
| tree | 142b9ba85e238573037206cd392237f9c5cda84b /clang/lib | |
| parent | 54ac8208905d4a8afec1bfebb50272887c6e10af (diff) | |
| download | bcm5719-llvm-83193600993b2c70c1b13949652144dcffe3af81.tar.gz bcm5719-llvm-83193600993b2c70c1b13949652144dcffe3af81.zip | |
Allow breaking after 'class' for classes with looong names.
(Don't ask, this was a user request).
llvm-svn: 178888
Diffstat (limited to 'clang/lib')
| -rw-r--r-- | clang/lib/Format/TokenAnnotator.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/Format/TokenAnnotator.cpp b/clang/lib/Format/TokenAnnotator.cpp index 24e2b1f87ec..44421c4bbec 100644 --- a/clang/lib/Format/TokenAnnotator.cpp +++ b/clang/lib/Format/TokenAnnotator.cpp @@ -939,6 +939,8 @@ unsigned TokenAnnotator::splitPenalty(const AnnotatedLine &Line, return 150; if (Left.is(tok::coloncolon)) return 500; + if (Left.isOneOf(tok::kw_class, tok::kw_struct)) + return 5000; if (Left.Type == TT_RangeBasedForLoopColon || Left.Type == TT_InheritanceColon) @@ -1176,7 +1178,8 @@ bool TokenAnnotator::canBreakBefore(const AnnotatedLine &Line, if (Left.is(tok::identifier) && Right.is(tok::string_literal)) return true; return (isBinaryOperator(Left) && Left.isNot(tok::lessless)) || - Left.isOneOf(tok::comma, tok::coloncolon, tok::semi, tok::l_brace) || + Left.isOneOf(tok::comma, tok::coloncolon, tok::semi, tok::l_brace, + tok::kw_class, tok::kw_struct) || Right.isOneOf(tok::lessless, tok::arrow, tok::period, tok::colon) || (Left.is(tok::r_paren) && Left.Type != TT_CastRParen && Right.isOneOf(tok::identifier, tok::kw___attribute)) || |

