aboutsummaryrefslogtreecommitdiff
path: root/lib/Format/Format.cpp
diff options
context:
space:
mode:
authorNico Weber <nicolasweber@gmx.de>2013-01-17 06:14:50 +0000
committerNico Weber <nicolasweber@gmx.de>2013-01-17 06:14:50 +0000
commitaab60054553c35f6761cf96f3476997f250f1f4a (patch)
tree837765901b2490611ddef11d9f28478ed2fc3874 /lib/Format/Format.cpp
parent93c8617bec98aeb769ee9f569d7ed439eec03249 (diff)
Revert most of r172140.
r172140 changed the formatter to produce "-(id) foo" instead of "- (id)foo" in google style, with a link to http://google-styleguide.googlecode.com/svn/trunk/objcguide.xml#Method_Declarations_and_Definitions as reference. But now that I look at that link again, it seems I didn't read it very carefully the first time round. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172703 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Format/Format.cpp')
-rw-r--r--lib/Format/Format.cpp13
1 files changed, 1 insertions, 12 deletions
diff --git a/lib/Format/Format.cpp b/lib/Format/Format.cpp
index 069d2dae71..b839c686af 100644
--- a/lib/Format/Format.cpp
+++ b/lib/Format/Format.cpp
@@ -46,7 +46,6 @@ enum TokenType {
TT_ObjCDecl,
TT_ObjCMethodSpecifier,
TT_ObjCMethodExpr,
- TT_ObjCSelectorStart,
TT_ObjCProperty,
TT_OverloadedOperator,
TT_PointerOrReference,
@@ -152,7 +151,6 @@ FormatStyle getLLVMStyle() {
LLVMStyle.ConstructorInitializerAllOnOneLineOrOnePerLine = false;
LLVMStyle.AllowShortIfStatementsOnASingleLine = false;
LLVMStyle.ObjCSpaceBeforeProtocolList = true;
- LLVMStyle.ObjCSpaceBeforeReturnType = true;
return LLVMStyle;
}
@@ -169,7 +167,6 @@ FormatStyle getGoogleStyle() {
GoogleStyle.ConstructorInitializerAllOnOneLineOrOnePerLine = true;
GoogleStyle.AllowShortIfStatementsOnASingleLine = false;
GoogleStyle.ObjCSpaceBeforeProtocolList = false;
- GoogleStyle.ObjCSpaceBeforeReturnType = false;
return GoogleStyle;
}
@@ -892,14 +889,8 @@ public:
Tok->Type = TT_ObjCMethodExpr;
break;
case tok::l_paren: {
- bool ParensWereObjCReturnType = Tok->Parent && Tok->Parent->Type ==
- TT_ObjCMethodSpecifier;
if (!parseParens())
return false;
- if (CurrentToken != NULL && ParensWereObjCReturnType) {
- CurrentToken->Type = TT_ObjCSelectorStart;
- next();
- }
} break;
case tok::l_square:
if (!parseSquare())
@@ -1308,9 +1299,7 @@ private:
if (Tok.is(tok::colon))
return false;
if (Tok.Parent->Type == TT_ObjCMethodSpecifier)
- return Style.ObjCSpaceBeforeReturnType || Tok.isNot(tok::l_paren);
- if (Tok.Type == TT_ObjCSelectorStart)
- return !Style.ObjCSpaceBeforeReturnType;
+ return true;
if (Tok.Parent->is(tok::r_paren) && Tok.is(tok::identifier))
// Don't space between ')' and <id>
return false;