diff options
| author | Nico Weber <nicolasweber@gmx.de> | 2013-02-10 21:08:31 +0000 |
|---|---|---|
| committer | Nico Weber <nicolasweber@gmx.de> | 2013-02-10 21:08:31 +0000 |
| commit | da2b868f1e4800555c94b3c912e06f9661047f38 (patch) | |
| tree | 7406c302545448afb584d10e3e8a0917bdfccdff /clang/lib | |
| parent | 0448b4dd872f37193fdc5099daa31277527b15a5 (diff) | |
| download | bcm5719-llvm-da2b868f1e4800555c94b3c912e06f9661047f38.tar.gz bcm5719-llvm-da2b868f1e4800555c94b3c912e06f9661047f38.zip | |
Formatter: Remove now-unneeded code for formatting ':'s in ObjC method decls.
The more general code for formatting ObjC method exprs does this and more,
it's no longer necessary to special-case this. No behavior change.
llvm-svn: 174843
Diffstat (limited to 'clang/lib')
| -rw-r--r-- | clang/lib/Format/TokenAnnotator.cpp | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/clang/lib/Format/TokenAnnotator.cpp b/clang/lib/Format/TokenAnnotator.cpp index 641ebd704a4..44146aab9bc 100644 --- a/clang/lib/Format/TokenAnnotator.cpp +++ b/clang/lib/Format/TokenAnnotator.cpp @@ -963,19 +963,11 @@ bool TokenAnnotator::spaceRequiredBetween(const AnnotatedLine &Line, bool TokenAnnotator::spaceRequiredBefore(const AnnotatedLine &Line, const AnnotatedToken &Tok) { if (Line.Type == LT_ObjCMethodDecl) { - if (Tok.is(tok::identifier) && !Tok.Children.empty() && - Tok.Children[0].is(tok::colon) && Tok.Parent->is(tok::identifier)) - return true; - if (Tok.is(tok::colon)) - return false; if (Tok.Parent->Type == TT_ObjCMethodSpecifier) return true; if (Tok.Parent->is(tok::r_paren) && Tok.is(tok::identifier)) // Don't space between ')' and <id> return false; - if (Tok.Parent->is(tok::colon) && Tok.is(tok::l_paren)) - // Don't space between ':' and '(' - return false; } if (Line.Type == LT_ObjCProperty && (Tok.is(tok::equal) || Tok.Parent->is(tok::equal))) @@ -1019,19 +1011,6 @@ bool TokenAnnotator::spaceRequiredBefore(const AnnotatedLine &Line, bool TokenAnnotator::canBreakBefore(const AnnotatedLine &Line, const AnnotatedToken &Right) { const AnnotatedToken &Left = *Right.Parent; - if (Line.Type == LT_ObjCMethodDecl) { - if (Right.is(tok::identifier) && !Right.Children.empty() && - Right.Children[0].is(tok::colon) && Left.is(tok::identifier)) - return true; - if (Right.is(tok::identifier) && Left.is(tok::l_paren) && - Left.Parent->is(tok::colon)) - // Don't break this identifier as ':' or identifier - // before it will break. - return false; - if (Right.is(tok::colon) && Left.is(tok::identifier) && Left.CanBreakBefore) - // Don't break at ':' if identifier before it can beak. - return false; - } if (Right.Type == TT_StartOfName && Style.AllowReturnTypeOnItsOwnLine) return true; if (Right.is(tok::colon) && Right.Type == TT_ObjCMethodExpr) |

