This patch fixes all issues mentioned in clattner's feedback of
September 28, 2007 4:39:24 PM PDT
Please let me know if I missed anything.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42473 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Sema/SemaDecl.cpp b/Sema/SemaDecl.cpp
index c6c1b1e..ac2be7f 100644
--- a/Sema/SemaDecl.cpp
+++ b/Sema/SemaDecl.cpp
@@ -1678,12 +1678,11 @@
QualType resultDeclType = QualType::getFromOpaquePtr(ReturnType);
ObjcMethodDecl* ObjcMethod = new ObjcMethodDecl(MethodLoc, Sel,
resultDeclType, 0, -1, AttrList,
- MethodType == tok::minus);
+ MethodType == tok::minus,
+ MethodDeclKind == tok::objc_optional ?
+ ObjcMethodDecl::Optional :
+ ObjcMethodDecl::Required);
ObjcMethod->setMethodParams(&Params[0], Sel.getNumArgs());
- if (MethodDeclKind == tok::objc_optional)
- ObjcMethod->setDeclImplementation(ObjcMethodDecl::Optional);
- else
- ObjcMethod->setDeclImplementation(ObjcMethodDecl::Required);
return ObjcMethod;
}