clang 19.0.0git
Functions | Variables
SemaObjCProperty.cpp File Reference
#include "clang/Sema/SemaInternal.h"
#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 "llvm/ADT/DenseSet.h"
#include "llvm/ADT/SmallString.h"

Go to the source code of this file.

Functions

static Qualifiers::ObjCLifetime getImpliedARCOwnership (ObjCPropertyAttribute::Kind attrs, QualType type)
 getImpliedARCOwnership - Given a set of property attributes and a type, infer an expected lifetime.
 
static void checkPropertyDeclWithOwnership (Sema &S, ObjCPropertyDecl *property)
 Check the internal consistency of a property declaration with an explicit ownership qualifier.
 
static void CheckPropertyAgainstProtocol (Sema &S, ObjCPropertyDecl *Prop, ObjCProtocolDecl *Proto, llvm::SmallPtrSetImpl< ObjCProtocolDecl * > &Known)
 Check this Objective-C property against a property declared in the given protocol.
 
static unsigned deducePropertyOwnershipFromType (Sema &S, QualType T)
 
static unsigned getOwnershipRule (unsigned attr)
 
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)
 Check for a mismatch in the atomicity of the given properties.
 
static void checkARCPropertyImpl (Sema &S, SourceLocation propertyImplLoc, ObjCPropertyDecl *property, ObjCIvarDecl *ivar)
 
static void setImpliedPropertyAttributeForReadOnlyProperty (ObjCPropertyDecl *property, ObjCIvarDecl *ivar)
 setImpliedPropertyAttributeForReadOnlyProperty - This routine evaludates life-time attributes for a 'readonly' property with no known lifetime of its own, using backing 'ivar's attribute, if any.
 
static bool isIncompatiblePropertyAttribute (unsigned Attr1, unsigned Attr2, ObjCPropertyAttribute::Kind Kind)
 
static bool areIncompatiblePropertyAttributes (unsigned Attr1, unsigned Attr2, unsigned Kinds)
 
static ObjCPropertyDeclSelectPropertyForSynthesisFromProtocols (Sema &S, SourceLocation AtLoc, ObjCInterfaceDecl *ClassDecl, ObjCPropertyDecl *Property)
 SelectPropertyForSynthesisFromProtocols - Finds the most appropriate property declaration that should be synthesised in all of the inherited protocols.
 
static bool hasWrittenStorageAttribute (ObjCPropertyDecl *Prop, ObjCPropertyQueryKind QueryKind)
 Determine whether any storage attributes were written on the property.
 
static ObjCMethodDeclRedeclarePropertyAccessor (ASTContext &Context, ObjCImplementationDecl *Impl, ObjCMethodDecl *AccessorDecl, SourceLocation AtLoc, SourceLocation PropertyLoc)
 Create a synthesized property accessor stub inside the @implementation.
 
static void CollectImmediateProperties (ObjCContainerDecl *CDecl, ObjCContainerDecl::PropertyMap &PropMap, ObjCContainerDecl::PropertyMap &SuperPropMap, bool CollectClassPropsOnly=false, bool IncludeProtocols=true)
 CollectImmediateProperties - This routine collects all properties in the class and its conforming protocols; but not those in its super class.
 
static void CollectSuperClassPropertyImplementations (ObjCInterfaceDecl *CDecl, ObjCInterfaceDecl::PropertyMap &PropMap)
 CollectSuperClassPropertyImplementations - This routine collects list of properties to be implemented in super class(s) and also coming from their conforming protocols.
 
static bool SuperClassImplementsProperty (ObjCInterfaceDecl *IDecl, ObjCPropertyDecl *Prop)
 
static void DiagnoseUnimplementedAccessor (Sema &S, ObjCInterfaceDecl *PrimaryClass, Selector Method, ObjCImplDecl *IMPDecl, ObjCContainerDecl *CDecl, ObjCCategoryDecl *C, ObjCPropertyDecl *Prop, llvm::SmallPtrSet< const ObjCMethodDecl *, 8 > &SMap)
 
static void AddPropertyAttrs (Sema &S, ObjCMethodDecl *PropertyMethod, ObjCPropertyDecl *Property)
 AddPropertyAttrs - Propagates attributes from a property to the implicitly-declared getter or setter for that property.
 

Variables

static const unsigned OwnershipMask
 

Function Documentation

◆ AddPropertyAttrs()

static void AddPropertyAttrs ( Sema S,
ObjCMethodDecl PropertyMethod,
ObjCPropertyDecl Property 
)
static

AddPropertyAttrs - Propagates attributes from a property to the implicitly-declared getter or setter for that property.

Definition at line 2359 of file SemaObjCProperty.cpp.

References clang::Decl::addAttr(), clang::Sema::Context, and clang::Property.

Referenced by clang::Sema::ProcessPropertyDecl().

◆ areIncompatiblePropertyAttributes()

static bool areIncompatiblePropertyAttributes ( unsigned  Attr1,
unsigned  Attr2,
unsigned  Kinds 
)
static

Definition at line 827 of file SemaObjCProperty.cpp.

Referenced by SelectPropertyForSynthesisFromProtocols().

◆ checkARCPropertyImpl()

static void checkARCPropertyImpl ( Sema S,
SourceLocation  propertyImplLoc,
ObjCPropertyDecl property,
ObjCIvarDecl ivar 
)
static

◆ checkAtomicPropertyMismatch()

static void checkAtomicPropertyMismatch ( Sema S,
ObjCPropertyDecl OldProperty,
ObjCPropertyDecl NewProperty,
bool  PropagateAtomicity 
)
static

◆ CheckPropertyAgainstProtocol()

static void CheckPropertyAgainstProtocol ( Sema S,
ObjCPropertyDecl Prop,
ObjCProtocolDecl Proto,
llvm::SmallPtrSetImpl< ObjCProtocolDecl * > &  Known 
)
static

◆ checkPropertyDeclWithOwnership()

static void checkPropertyDeclWithOwnership ( Sema S,
ObjCPropertyDecl property 
)
static

◆ CollectImmediateProperties()

static void CollectImmediateProperties ( ObjCContainerDecl CDecl,
ObjCContainerDecl::PropertyMap PropMap,
ObjCContainerDecl::PropertyMap SuperPropMap,
bool  CollectClassPropsOnly = false,
bool  IncludeProtocols = true 
)
static

CollectImmediateProperties - This routine collects all properties in the class and its conforming protocols; but not those in its super class.

Definition at line 1754 of file SemaObjCProperty.cpp.

References CollectImmediateProperties(), and clang::NamedDecl::getIdentifier().

Referenced by CollectImmediateProperties(), and clang::Sema::DiagnoseUnimplementedProperties().

◆ CollectSuperClassPropertyImplementations()

static void CollectSuperClassPropertyImplementations ( ObjCInterfaceDecl CDecl,
ObjCInterfaceDecl::PropertyMap &  PropMap 
)
static

CollectSuperClassPropertyImplementations - This routine collects list of properties to be implemented in super class(s) and also coming from their conforming protocols.

Definition at line 1821 of file SemaObjCProperty.cpp.

References clang::ObjCInterfaceDecl::getSuperClass().

Referenced by clang::Sema::DefaultSynthesizeProperties(), and clang::Sema::DiagnoseUnimplementedProperties().

◆ deducePropertyOwnershipFromType()

static unsigned deducePropertyOwnershipFromType ( Sema S,
QualType  T 
)
static

◆ DiagnoseUnimplementedAccessor()

static void DiagnoseUnimplementedAccessor ( Sema S,
ObjCInterfaceDecl PrimaryClass,
Selector  Method,
ObjCImplDecl IMPDecl,
ObjCContainerDecl CDecl,
ObjCCategoryDecl C,
ObjCPropertyDecl Prop,
llvm::SmallPtrSet< const ObjCMethodDecl *, 8 > &  SMap 
)
static

◆ getImpliedARCOwnership()

static Qualifiers::ObjCLifetime getImpliedARCOwnership ( ObjCPropertyAttribute::Kind  attrs,
QualType  type 
)
static

◆ getOwnershipRule()

static unsigned getOwnershipRule ( unsigned  attr)
static

◆ hasWrittenStorageAttribute()

static bool hasWrittenStorageAttribute ( ObjCPropertyDecl Prop,
ObjCPropertyQueryKind  QueryKind 
)
static

◆ isIncompatiblePropertyAttribute()

static bool isIncompatiblePropertyAttribute ( unsigned  Attr1,
unsigned  Attr2,
ObjCPropertyAttribute::Kind  Kind 
)
static

Definition at line 822 of file SemaObjCProperty.cpp.

Referenced by SelectPropertyForSynthesisFromProtocols().

◆ LocPropertyAttribute()

static bool LocPropertyAttribute ( ASTContext Context,
const char *  attrName,
SourceLocation  LParenLoc,
SourceLocation Loc 
)
static

◆ makePropertyAttributesAsWritten()

static ObjCPropertyAttribute::Kind makePropertyAttributesAsWritten ( unsigned  Attributes)
static

◆ RedeclarePropertyAccessor()

static ObjCMethodDecl * RedeclarePropertyAccessor ( ASTContext Context,
ObjCImplementationDecl Impl,
ObjCMethodDecl AccessorDecl,
SourceLocation  AtLoc,
SourceLocation  PropertyLoc 
)
static

◆ SelectPropertyForSynthesisFromProtocols()

static ObjCPropertyDecl * SelectPropertyForSynthesisFromProtocols ( Sema S,
SourceLocation  AtLoc,
ObjCInterfaceDecl ClassDecl,
ObjCPropertyDecl Property 
)
static

◆ setImpliedPropertyAttributeForReadOnlyProperty()

static void setImpliedPropertyAttributeForReadOnlyProperty ( ObjCPropertyDecl property,
ObjCIvarDecl ivar 
)
static

setImpliedPropertyAttributeForReadOnlyProperty - This routine evaludates life-time attributes for a 'readonly' property with no known lifetime of its own, using backing 'ivar's attribute, if any.

If no backing 'ivar', property's life-time is assumed 'strong'.

Definition at line 800 of file SemaObjCProperty.cpp.

References getImpliedARCOwnership(), clang::QualType::getObjCLifetime(), clang::ObjCPropertyDecl::getPropertyAttributes(), clang::ValueDecl::getType(), clang::ObjCPropertyDecl::getType(), clang::ObjCPropertyAttribute::kind_strong, clang::ObjCPropertyAttribute::kind_weak, clang::Qualifiers::OCL_None, clang::Qualifiers::OCL_Strong, and clang::Qualifiers::OCL_Weak.

Referenced by clang::Sema::ActOnPropertyImplDecl().

◆ SuperClassImplementsProperty()

static bool SuperClassImplementsProperty ( ObjCInterfaceDecl IDecl,
ObjCPropertyDecl Prop 
)
static

Variable Documentation

◆ OwnershipMask

const unsigned OwnershipMask
static