diff options
author | Nico Weber <nicolasweber@gmx.de> | 2013-01-10 23:11:41 +0000 |
---|---|---|
committer | Nico Weber <nicolasweber@gmx.de> | 2013-01-10 23:11:41 +0000 |
commit | cd52bdaaf076b0082c07c6b3d88937fb737054f1 (patch) | |
tree | fca5b9845970173d5ca3678e4ff7517407ff14b3 /lib/CodeGen/CGExprConstant.cpp | |
parent | 664566c37f81d70226df22c12aa05d1603b620f3 (diff) |
Formatter: Put spaces in ObjC method decls in the right place for Google style.
Objective-C method declarations look like this:
- (returntype)name:(type)argname anothername:(type)arg2name;
In google style, there's no space after the leading '-' but one after
"(returntype)" instead (but none after the argument types), see
http://google-styleguide.googlecode.com/svn/trunk/objcguide.xml#Method_Declarations_and_Definitions
Not inserting the space after '-' is easy, but to insert the space after the
return type, the formatter needs to know that a closing parenthesis ends the
return type. To do this, I tweaked the code in parse() to check for this, which
in turn required moving detection of TT_ObjCMethodSpecifier from annotate() to
parse(), because parse() runs before annotate().
(To keep things interesting, the return type is optional, but it's almost
always there in practice.)
http://llvm-reviews.chandlerc.com/D280
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172140 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExprConstant.cpp')
0 files changed, 0 insertions, 0 deletions