bool IsInstance : 1;
bool IsVariadic : 1;
+ // Synthesized declaration method for a property setter/getter
+ bool IsSynthesized : 1;
+
// NOTE: VC++ treats enums as signed, avoid using ImplementationControl enum
/// @required/@optional
unsigned DeclImplementation : 2;
Decl *contextDecl,
AttributeList *M = 0, bool isInstance = true,
bool isVariadic = false,
+ bool isSynthesized = false,
ImplementationControl impControl = None)
: Decl(ObjCMethod, beginLoc),
DeclContext(ObjCMethod),
IsInstance(isInstance), IsVariadic(isVariadic),
+ IsSynthesized(isSynthesized),
DeclImplementation(impControl), objcDeclQualifier(OBJC_TQ_None),
MethodContext(static_cast<NamedDecl*>(contextDecl)),
SelName(SelInfo), MethodDeclType(T),
QualType T, Decl *contextDecl,
AttributeList *M = 0, bool isInstance = true,
bool isVariadic = false,
+ bool isSynthesized = false,
ImplementationControl impControl = None);
ObjCDeclQualifier getObjCDeclQualifier() const {
bool isInstance() const { return IsInstance; }
bool isVariadic() const { return IsVariadic; }
+ bool isSynthesized() const { return IsSynthesized; }
+
// Related to protocols declared in @protocol
void setDeclImplementation(ImplementationControl ic) {
DeclImplementation = ic;
Decl *contextDecl,
AttributeList *M, bool isInstance,
bool isVariadic,
+ bool isSynthesized,
ImplementationControl impControl) {
void *Mem = C.getAllocator().Allocate<ObjCMethodDecl>();
return new (Mem) ObjCMethodDecl(beginLoc, endLoc,
SelInfo, T, contextDecl,
M, isInstance,
- isVariadic, impControl);
+ isVariadic, isSynthesized, impControl);
}
ObjCInterfaceDecl *ObjCInterfaceDecl::Create(ASTContext &C,
property->getLocation(),
property->getGetterName(), resultDeclType,
this, 0,
- true, false, ObjCMethodDecl::Required);
+ true, false, true, ObjCMethodDecl::Required);
property->setGetterMethodDecl(ObjCMethod);
insMethods.push_back(ObjCMethod);
}
bool IncompleteImpl = false;
for (ObjCInterfaceDecl::instmeth_iterator I = IDecl->instmeth_begin(),
E = IDecl->instmeth_end(); I != E; ++I)
- if (!InsMap.count((*I)->getSelector()))
+ if (!(*I)->isSynthesized() && !InsMap.count((*I)->getSelector()))
WarnUndefinedMethod(IMPDecl->getLocation(), *I, IncompleteImpl);
llvm::DenseSet<Selector> ClsMap;
ObjCMethodDecl::Create(Context, MethodLoc, EndLoc, Sel, resultDeclType,
ClassDecl, AttrList,
MethodType == tok::minus, isVariadic,
+ false,
MethodDeclKind == tok::objc_optional ?
ObjCMethodDecl::Optional :
ObjCMethodDecl::Required);