[cfe-commits] r57816 - /cfe/trunk/lib/Parse/ParseObjc.cpp
Chris Lattner
sabre at nondot.org
Mon Oct 20 00:39:53 PDT 2008
Author: lattner
Date: Mon Oct 20 02:39:53 2008
New Revision: 57816
URL: http://llvm.org/viewvc/llvm-project?rev=57816&view=rev
Log:
rearrange some code.
Modified:
cfe/trunk/lib/Parse/ParseObjc.cpp
Modified: cfe/trunk/lib/Parse/ParseObjc.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseObjc.cpp?rev=57816&r1=57815&r2=57816&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseObjc.cpp (original)
+++ cfe/trunk/lib/Parse/ParseObjc.cpp Mon Oct 20 02:39:53 2008
@@ -392,10 +392,21 @@
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 @@
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;
More information about the cfe-commits
mailing list