#include "clang/AST/ASTMutationListener.h"
#include "clang/AST/DeclObjC.h"
#include "clang/AST/ExprCXX.h"
#include "clang/AST/ExprObjC.h"
#include "clang/Basic/SourceManager.h"
#include "clang/Lex/Lexer.h"
#include "clang/Lex/Preprocessor.h"
#include "clang/Sema/Initialization.h"
#include "clang/Sema/SemaInternal.h"
#include "clang/Sema/SemaObjC.h"
#include "llvm/ADT/DenseSet.h"
#include "llvm/ADT/SmallString.h"
usingnamespaceclang;
static Qualifiers::ObjCLifetime
getImpliedARCOwnership(ObjCPropertyAttribute::Kind attrs, QualType type) { … }
static void checkPropertyDeclWithOwnership(Sema &S,
ObjCPropertyDecl *property) { … }
static void
CheckPropertyAgainstProtocol(Sema &S, ObjCPropertyDecl *Prop,
ObjCProtocolDecl *Proto,
llvm::SmallPtrSetImpl<ObjCProtocolDecl *> &Known) { … }
static unsigned deducePropertyOwnershipFromType(Sema &S, QualType T) { … }
static const unsigned OwnershipMask = …;
static unsigned getOwnershipRule(unsigned attr) { … }
Decl *SemaObjC::ActOnProperty(Scope *S, SourceLocation AtLoc,
SourceLocation LParenLoc, FieldDeclarator &FD,
ObjCDeclSpec &ODS, Selector GetterSel,
Selector SetterSel,
tok::ObjCKeywordKind MethodImplKind,
DeclContext *lexicalDC) { … }
static ObjCPropertyAttribute::Kind
makePropertyAttributesAsWritten(unsigned Attributes) { … }
static bool LocPropertyAttribute( ASTContext &Context, const char *attrName,
SourceLocation LParenLoc, SourceLocation &Loc) { … }
static void checkAtomicPropertyMismatch(Sema &S,
ObjCPropertyDecl *OldProperty,
ObjCPropertyDecl *NewProperty,
bool PropagateAtomicity) { … }
ObjCPropertyDecl *SemaObjC::HandlePropertyInClassExtension(
Scope *S, SourceLocation AtLoc, SourceLocation LParenLoc,
FieldDeclarator &FD, Selector GetterSel, SourceLocation GetterNameLoc,
Selector SetterSel, SourceLocation SetterNameLoc, const bool isReadWrite,
unsigned &Attributes, const unsigned AttributesAsWritten, QualType T,
TypeSourceInfo *TSI, tok::ObjCKeywordKind MethodImplKind) { … }
ObjCPropertyDecl *SemaObjC::CreatePropertyDecl(
Scope *S, ObjCContainerDecl *CDecl, SourceLocation AtLoc,
SourceLocation LParenLoc, FieldDeclarator &FD, Selector GetterSel,
SourceLocation GetterNameLoc, Selector SetterSel,
SourceLocation SetterNameLoc, const bool isReadWrite,
const unsigned Attributes, const unsigned AttributesAsWritten, QualType T,
TypeSourceInfo *TInfo, tok::ObjCKeywordKind MethodImplKind,
DeclContext *lexicalDC) { … }
static void checkARCPropertyImpl(Sema &S, SourceLocation propertyImplLoc,
ObjCPropertyDecl *property,
ObjCIvarDecl *ivar) { … }
static void setImpliedPropertyAttributeForReadOnlyProperty(
ObjCPropertyDecl *property, ObjCIvarDecl *ivar) { … }
static bool isIncompatiblePropertyAttribute(unsigned Attr1, unsigned Attr2,
ObjCPropertyAttribute::Kind Kind) { … }
static bool areIncompatiblePropertyAttributes(unsigned Attr1, unsigned Attr2,
unsigned Kinds) { … }
static ObjCPropertyDecl *
SelectPropertyForSynthesisFromProtocols(Sema &S, SourceLocation AtLoc,
ObjCInterfaceDecl *ClassDecl,
ObjCPropertyDecl *Property) { … }
static bool hasWrittenStorageAttribute(ObjCPropertyDecl *Prop,
ObjCPropertyQueryKind QueryKind) { … }
static ObjCMethodDecl *
RedeclarePropertyAccessor(ASTContext &Context, ObjCImplementationDecl *Impl,
ObjCMethodDecl *AccessorDecl, SourceLocation AtLoc,
SourceLocation PropertyLoc) { … }
Decl *SemaObjC::ActOnPropertyImplDecl(
Scope *S, SourceLocation AtLoc, SourceLocation PropertyLoc, bool Synthesize,
IdentifierInfo *PropertyId, IdentifierInfo *PropertyIvar,
SourceLocation PropertyIvarLoc, ObjCPropertyQueryKind QueryKind) { … }
void SemaObjC::DiagnosePropertyMismatch(ObjCPropertyDecl *Property,
ObjCPropertyDecl *SuperProperty,
const IdentifierInfo *inheritedName,
bool OverridingProtocolProperty) { … }
bool SemaObjC::DiagnosePropertyAccessorMismatch(ObjCPropertyDecl *property,
ObjCMethodDecl *GetterMethod,
SourceLocation Loc) { … }
static void
CollectImmediateProperties(ObjCContainerDecl *CDecl,
ObjCContainerDecl::PropertyMap &PropMap,
ObjCContainerDecl::PropertyMap &SuperPropMap,
bool CollectClassPropsOnly = false,
bool IncludeProtocols = true) { … }
static void CollectSuperClassPropertyImplementations(ObjCInterfaceDecl *CDecl,
ObjCInterfaceDecl::PropertyMap &PropMap) { … }
bool SemaObjC::IvarBacksCurrentMethodAccessor(ObjCInterfaceDecl *IFace,
ObjCMethodDecl *Method,
ObjCIvarDecl *IV) { … }
static bool SuperClassImplementsProperty(ObjCInterfaceDecl *IDecl,
ObjCPropertyDecl *Prop) { … }
void SemaObjC::DefaultSynthesizeProperties(Scope *S, ObjCImplDecl *IMPDecl,
ObjCInterfaceDecl *IDecl,
SourceLocation AtEnd) { … }
void SemaObjC::DefaultSynthesizeProperties(Scope *S, Decl *D,
SourceLocation AtEnd) { … }
static void DiagnoseUnimplementedAccessor(
Sema &S, ObjCInterfaceDecl *PrimaryClass, Selector Method,
ObjCImplDecl *IMPDecl, ObjCContainerDecl *CDecl, ObjCCategoryDecl *C,
ObjCPropertyDecl *Prop,
llvm::SmallPtrSet<const ObjCMethodDecl *, 8> &SMap) { … }
void SemaObjC::DiagnoseUnimplementedProperties(Scope *S, ObjCImplDecl *IMPDecl,
ObjCContainerDecl *CDecl,
bool SynthesizeProperties) { … }
void SemaObjC::diagnoseNullResettableSynthesizedSetters(
const ObjCImplDecl *impDecl) { … }
void SemaObjC::AtomicPropertySetterGetterRules(ObjCImplDecl *IMPDecl,
ObjCInterfaceDecl *IDecl) { … }
void SemaObjC::DiagnoseOwningPropertyGetterSynthesis(
const ObjCImplementationDecl *D) { … }
void SemaObjC::DiagnoseMissingDesignatedInitOverrides(
const ObjCImplementationDecl *ImplD, const ObjCInterfaceDecl *IFD) { … }
static void AddPropertyAttrs(Sema &S, ObjCMethodDecl *PropertyMethod,
ObjCPropertyDecl *Property) { … }
void SemaObjC::ProcessPropertyDecl(ObjCPropertyDecl *property) { … }
void SemaObjC::CheckObjCPropertyAttributes(Decl *PDecl, SourceLocation Loc,
unsigned &Attributes,
bool propertyInPrimaryClass) { … }