aboutsummaryrefslogtreecommitdiff
path: root/lib/Parse/ParseObjc.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-10-20 07:39:53 +0000
committerChris Lattner <sabre@nondot.org>2008-10-20 07:39:53 +0000
commite00da7c2f47d4a3d9615c1056a8a65e459113de3 (patch)
tree97718e34fa49923a8672f54b521a2d399ab55b2b /lib/Parse/ParseObjc.cpp
parent156b061e4918a5e7ecd8eb317975de0e6be2688b (diff)
rearrange some code.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57816 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseObjc.cpp')
-rw-r--r--lib/Parse/ParseObjc.cpp33
1 files changed, 16 insertions, 17 deletions
diff --git a/lib/Parse/ParseObjc.cpp b/lib/Parse/ParseObjc.cpp
index 4b3ecbc89a..fa6b1a3fee 100644
--- a/lib/Parse/ParseObjc.cpp
+++ b/lib/Parse/ParseObjc.cpp
@@ -392,10 +392,21 @@ void Parser::ParseObjCPropertyAttribute(ObjCDeclSpec &DS) {
SourceLocation AttrName = ConsumeToken(); // consume last attribute name
- // getter/setter require extra treatment.
- if (II == ObjCPropertyAttrs[objc_getter] ||
- II == ObjCPropertyAttrs[objc_setter]) {
-
+ if (II == ObjCPropertyAttrs[objc_readonly])
+ DS.setPropertyAttributes(ObjCDeclSpec::DQ_PR_readonly);
+ else if (II == ObjCPropertyAttrs[objc_assign])
+ DS.setPropertyAttributes(ObjCDeclSpec::DQ_PR_assign);
+ else if (II == ObjCPropertyAttrs[objc_readwrite])
+ DS.setPropertyAttributes(ObjCDeclSpec::DQ_PR_readwrite);
+ else if (II == ObjCPropertyAttrs[objc_retain])
+ DS.setPropertyAttributes(ObjCDeclSpec::DQ_PR_retain);
+ else if (II == ObjCPropertyAttrs[objc_copy])
+ DS.setPropertyAttributes(ObjCDeclSpec::DQ_PR_copy);
+ else if (II == ObjCPropertyAttrs[objc_nonatomic])
+ DS.setPropertyAttributes(ObjCDeclSpec::DQ_PR_nonatomic);
+ else if (II == ObjCPropertyAttrs[objc_getter] ||
+ II == ObjCPropertyAttrs[objc_setter]) {
+ // getter/setter require extra treatment.
if (ExpectAndConsume(tok::equal, diag::err_objc_expected_equal, "",
tok::r_paren))
return;
@@ -419,19 +430,7 @@ void Parser::ParseObjCPropertyAttribute(ObjCDeclSpec &DS) {
DS.setGetterName(Tok.getIdentifierInfo());
ConsumeToken(); // consume method name
}
- } else if (II == ObjCPropertyAttrs[objc_readonly])
- DS.setPropertyAttributes(ObjCDeclSpec::DQ_PR_readonly);
- else if (II == ObjCPropertyAttrs[objc_assign])
- DS.setPropertyAttributes(ObjCDeclSpec::DQ_PR_assign);
- else if (II == ObjCPropertyAttrs[objc_readwrite])
- DS.setPropertyAttributes(ObjCDeclSpec::DQ_PR_readwrite);
- else if (II == ObjCPropertyAttrs[objc_retain])
- DS.setPropertyAttributes(ObjCDeclSpec::DQ_PR_retain);
- else if (II == ObjCPropertyAttrs[objc_copy])
- DS.setPropertyAttributes(ObjCDeclSpec::DQ_PR_copy);
- else if (II == ObjCPropertyAttrs[objc_nonatomic])
- DS.setPropertyAttributes(ObjCDeclSpec::DQ_PR_nonatomic);
- else {
+ } else {
Diag(AttrName, diag::err_objc_expected_property_attr, II->getName());
SkipUntil(tok::r_paren);
return;