aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/DeclObjC.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/AST/DeclObjC.cpp')
-rw-r--r--lib/AST/DeclObjC.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/AST/DeclObjC.cpp b/lib/AST/DeclObjC.cpp
index 6045fa20c1..a14e3ba068 100644
--- a/lib/AST/DeclObjC.cpp
+++ b/lib/AST/DeclObjC.cpp
@@ -468,7 +468,11 @@ addPropertyMethods(Decl *D,
property->getGetterName(),
property->getType(),
D,
- true, false, true, ObjCMethodDecl::Required);
+ true, false, true,
+ (property->getPropertyImplementation() ==
+ ObjCPropertyDecl::Optional) ?
+ ObjCMethodDecl::Optional :
+ ObjCMethodDecl::Required);
insMethods.push_back(GetterDecl);
InsMap[property->getGetterName()] = GetterDecl;
}
@@ -493,7 +497,11 @@ addPropertyMethods(Decl *D,
property->getSetterName(),
Context.VoidTy,
D,
- true, false, true, ObjCMethodDecl::Required);
+ true, false, true,
+ (property->getPropertyImplementation() ==
+ ObjCPropertyDecl::Optional) ?
+ ObjCMethodDecl::Optional :
+ ObjCMethodDecl::Required);
insMethods.push_back(SetterDecl);
InsMap[property->getSetterName()] = SetterDecl;
// Invent the arguments for the setter. We don't bother making a