clang  3.9.0
Public Types | Public Member Functions | Static Public Member Functions | List of all members
clang::ObjCPropertyDecl Class Reference

Represents one property declaration in an Objective-C interface. More...

#include <DeclObjC.h>

Inheritance diagram for clang::ObjCPropertyDecl:
[legend]
Collaboration diagram for clang::ObjCPropertyDecl:
[legend]

Public Types

enum  PropertyAttributeKind {
  OBJC_PR_noattr = 0x00, OBJC_PR_readonly = 0x01, OBJC_PR_getter = 0x02, OBJC_PR_assign = 0x04,
  OBJC_PR_readwrite = 0x08, OBJC_PR_retain = 0x10, OBJC_PR_copy = 0x20, OBJC_PR_nonatomic = 0x40,
  OBJC_PR_setter = 0x80, OBJC_PR_atomic = 0x100, OBJC_PR_weak = 0x200, OBJC_PR_strong = 0x400,
  OBJC_PR_unsafe_unretained = 0x800, OBJC_PR_nullability = 0x1000, OBJC_PR_null_resettable = 0x2000, OBJC_PR_class = 0x4000
}
 
enum  { NumPropertyAttrsBits = 15 }
 
enum  SetterKind { Assign, Retain, Copy, Weak }
 
enum  PropertyControl { None, Required, Optional }
 
- Public Types inherited from clang::NamedDecl
enum  ExplicitVisibilityKind { VisibilityForType, VisibilityForValue }
 Kinds of explicit visibility. More...
 

Public Member Functions

SourceLocation getAtLoc () const
 
void setAtLoc (SourceLocation L)
 
SourceLocation getLParenLoc () const
 
void setLParenLoc (SourceLocation L)
 
TypeSourceInfogetTypeSourceInfo () const
 
QualType getType () const
 
void setType (QualType T, TypeSourceInfo *TSI)
 
QualType getUsageType (QualType objectType) const
 Retrieve the type when this property is used with a specific base object type. More...
 
PropertyAttributeKind getPropertyAttributes () const
 
void setPropertyAttributes (PropertyAttributeKind PRVal)
 
void overwritePropertyAttributes (unsigned PRVal)
 
PropertyAttributeKind getPropertyAttributesAsWritten () const
 
void setPropertyAttributesAsWritten (PropertyAttributeKind PRVal)
 
bool isReadOnly () const
 isReadOnly - Return true iff the property has a setter. More...
 
bool isAtomic () const
 isAtomic - Return true if the property is atomic. More...
 
bool isRetaining () const
 isRetaining - Return true if the property retains its value. More...
 
bool isInstanceProperty () const
 
bool isClassProperty () const
 
ObjCPropertyQueryKind getQueryKind () const
 
SetterKind getSetterKind () const
 getSetterKind - Return the method used for doing assignment in the property setter. More...
 
Selector getGetterName () const
 
void setGetterName (Selector Sel)
 
Selector getSetterName () const
 
void setSetterName (Selector Sel)
 
ObjCMethodDeclgetGetterMethodDecl () const
 
void setGetterMethodDecl (ObjCMethodDecl *gDecl)
 
ObjCMethodDeclgetSetterMethodDecl () const
 
void setSetterMethodDecl (ObjCMethodDecl *gDecl)
 
void setPropertyImplementation (PropertyControl pc)
 
PropertyControl getPropertyImplementation () const
 
void setPropertyIvarDecl (ObjCIvarDecl *Ivar)
 
ObjCIvarDeclgetPropertyIvarDecl () const
 
SourceRange getSourceRange () const override LLVM_READONLY
 
IdentifierInfogetDefaultSynthIvarName (ASTContext &Ctx) const
 Get the default name of the synthesized ivar. More...
 
- Public Member Functions inherited from clang::NamedDecl
IdentifierInfogetIdentifier () const
 getIdentifier - Get the identifier that names this declaration, if there is one. More...
 
StringRef getName () const
 getName - Get the name of identifier for this declaration as a StringRef. More...
 
std::string getNameAsString () const
 getNameAsString - Get a human-readable name for the declaration, even if it is one of the special kinds of names (C++ constructor, Objective-C selector, etc). More...
 
void printName (raw_ostream &os) const
 
DeclarationName getDeclName () const
 getDeclName - Get the actual, stored name of the declaration, which may be a special name. More...
 
void setDeclName (DeclarationName N)
 Set the name of this declaration. More...
 
void printQualifiedName (raw_ostream &OS) const
 printQualifiedName - Returns human-readable qualified name for declaration, like A::B::i, for i being member of namespace A::B. More...
 
void printQualifiedName (raw_ostream &OS, const PrintingPolicy &Policy) const
 
std::string getQualifiedNameAsString () const
 
virtual void getNameForDiagnostic (raw_ostream &OS, const PrintingPolicy &Policy, bool Qualified) const
 getNameForDiagnostic - Appends a human-readable name for this declaration into the given stream. More...
 
bool declarationReplaces (NamedDecl *OldD, bool IsKnownNewer=true) const
 Determine whether this declaration, if known to be well-formed within its context, will replace the declaration OldD if introduced into scope. More...
 
bool hasLinkage () const
 Determine whether this declaration has linkage. More...
 
bool isHidden () const
 Determine whether this declaration is hidden from name lookup. More...
 
void setHidden (bool Hide)
 Set whether this declaration is hidden from name lookup. More...
 
bool isCXXClassMember () const
 Determine whether this declaration is a C++ class member. More...
 
bool isCXXInstanceMember () const
 Determine whether the given declaration is an instance member of a C++ class. More...
 
Linkage getLinkageInternal () const
 Determine what kind of linkage this entity has. More...
 
Linkage getFormalLinkage () const
 Get the linkage from a semantic point of view. More...
 
bool hasExternalFormalLinkage () const
 True if this decl has external linkage. More...
 
bool isExternallyVisible () const
 
Visibility getVisibility () const
 Determines the visibility of this entity. More...
 
LinkageInfo getLinkageAndVisibility () const
 Determines the linkage and visibility of this entity. More...
 
Optional< VisibilitygetExplicitVisibility (ExplicitVisibilityKind kind) const
 If visibility was explicitly specified for this declaration, return that visibility. More...
 
bool isLinkageValid () const
 True if the computed linkage is valid. More...
 
bool hasLinkageBeenComputed () const
 True if something has required us to compute the linkage of this declaration. More...
 
NamedDeclgetUnderlyingDecl ()
 Looks through UsingDecls and ObjCCompatibleAliasDecls for the underlying named decl. More...
 
const NamedDeclgetUnderlyingDecl () const
 
NamedDeclgetMostRecentDecl ()
 
const NamedDeclgetMostRecentDecl () const
 
ObjCStringFormatFamily getObjCFStringFormattingFamily () const
 

Static Public Member Functions

static ObjCPropertyDeclCreate (ASTContext &C, DeclContext *DC, SourceLocation L, IdentifierInfo *Id, SourceLocation AtLocation, SourceLocation LParenLocation, QualType T, TypeSourceInfo *TSI, PropertyControl propControl=None)
 
static ObjCPropertyDeclCreateDeserialized (ASTContext &C, unsigned ID)
 
static ObjCPropertyQueryKind getQueryKind (bool isClassProperty)
 
static ObjCPropertyDeclfindPropertyDecl (const DeclContext *DC, const IdentifierInfo *propertyID, ObjCPropertyQueryKind queryKind)
 Lookup a property by name in the specified DeclContext. More...
 
static bool classof (const Decl *D)
 
static bool classofKind (Kind K)
 
- Static Public Member Functions inherited from clang::NamedDecl
static bool classof (const Decl *D)
 
static bool classofKind (Kind K)
 

Additional Inherited Members

- Protected Member Functions inherited from clang::NamedDecl
 NamedDecl (Kind DK, DeclContext *DC, SourceLocation L, DeclarationName N)
 

Detailed Description

Represents one property declaration in an Objective-C interface.

For example:

\@property (assign, readwrite) int MyProperty;

Definition at line 699 of file DeclObjC.h.

Member Enumeration Documentation

anonymous enum
Enumerator
NumPropertyAttrsBits 

Number of bits fitting all the property attributes.

Definition at line 724 of file DeclObjC.h.

Enumerator
OBJC_PR_noattr 
OBJC_PR_readonly 
OBJC_PR_getter 
OBJC_PR_assign 
OBJC_PR_readwrite 
OBJC_PR_retain 
OBJC_PR_copy 
OBJC_PR_nonatomic 
OBJC_PR_setter 
OBJC_PR_atomic 
OBJC_PR_weak 
OBJC_PR_strong 
OBJC_PR_unsafe_unretained 
OBJC_PR_nullability 

Indicates that the nullability of the type was spelled with a property attribute rather than a type qualifier.

OBJC_PR_null_resettable 
OBJC_PR_class 

Definition at line 702 of file DeclObjC.h.

Enumerator
None 
Required 
Optional 

Definition at line 730 of file DeclObjC.h.

Enumerator
Assign 
Retain 
Copy 
Weak 

Definition at line 729 of file DeclObjC.h.

Member Function Documentation

static bool clang::ObjCPropertyDecl::classof ( const Decl D)
inlinestatic

Definition at line 893 of file DeclObjC.h.

References classofKind().

static bool clang::ObjCPropertyDecl::classofKind ( Kind  K)
inlinestatic

Definition at line 894 of file DeclObjC.h.

Referenced by classof().

ObjCPropertyDecl * ObjCPropertyDecl::Create ( ASTContext C,
DeclContext DC,
SourceLocation  L,
IdentifierInfo Id,
SourceLocation  AtLocation,
SourceLocation  LParenLocation,
QualType  T,
TypeSourceInfo TSI,
PropertyControl  propControl = None 
)
static
ObjCPropertyDecl * ObjCPropertyDecl::CreateDeserialized ( ASTContext C,
unsigned  ID 
)
static

Definition at line 2172 of file DeclObjC.cpp.

References ID, and None.

ObjCPropertyDecl * ObjCPropertyDecl::findPropertyDecl ( const DeclContext DC,
const IdentifierInfo propertyID,
ObjCPropertyQueryKind  queryKind 
)
static
SourceLocation clang::ObjCPropertyDecl::getAtLoc ( ) const
inline
IdentifierInfo * ObjCPropertyDecl::getDefaultSynthIvarName ( ASTContext Ctx) const
ObjCMethodDecl* clang::ObjCPropertyDecl::getGetterMethodDecl ( ) const
inline
Selector clang::ObjCPropertyDecl::getGetterName ( ) const
inline
SourceLocation clang::ObjCPropertyDecl::getLParenLoc ( ) const
inline
PropertyAttributeKind clang::ObjCPropertyDecl::getPropertyAttributes ( ) const
inline
PropertyAttributeKind clang::ObjCPropertyDecl::getPropertyAttributesAsWritten ( ) const
inline
PropertyControl clang::ObjCPropertyDecl::getPropertyImplementation ( ) const
inline
ObjCIvarDecl* clang::ObjCPropertyDecl::getPropertyIvarDecl ( ) const
inline
ObjCPropertyQueryKind clang::ObjCPropertyDecl::getQueryKind ( ) const
inline
static ObjCPropertyQueryKind clang::ObjCPropertyDecl::getQueryKind ( bool  isClassProperty)
inlinestatic

Definition at line 834 of file DeclObjC.h.

References clang::OBJC_PR_query_class, and clang::OBJC_PR_query_instance.

SetterKind clang::ObjCPropertyDecl::getSetterKind ( ) const
inline

getSetterKind - Return the method used for doing assignment in the property setter.

This is only valid if the property has been defined to have a setter.

Definition at line 842 of file DeclObjC.h.

References Assign, Copy, getType(), clang::Type::isBlockPointerType(), OBJC_PR_copy, OBJC_PR_retain, OBJC_PR_strong, OBJC_PR_weak, Retain, and Weak.

Referenced by clang::ASTContext::getObjCEncodingForPropertyDecl().

ObjCMethodDecl* clang::ObjCPropertyDecl::getSetterMethodDecl ( ) const
inline
Selector clang::ObjCPropertyDecl::getSetterName ( ) const
inline
SourceRange clang::ObjCPropertyDecl::getSourceRange ( ) const
inlineoverride

Definition at line 881 of file DeclObjC.h.

QualType clang::ObjCPropertyDecl::getType ( ) const
inline
TypeSourceInfo* clang::ObjCPropertyDecl::getTypeSourceInfo ( ) const
inline
QualType ObjCPropertyDecl::getUsageType ( QualType  objectType) const

Retrieve the type when this property is used with a specific base object type.

Definition at line 2179 of file DeclObjC.cpp.

References clang::Property, and clang::QualType::substObjCMemberType().

bool clang::ObjCPropertyDecl::isAtomic ( ) const
inline

isAtomic - Return true if the property is atomic.

Definition at line 818 of file DeclObjC.h.

References OBJC_PR_atomic.

bool clang::ObjCPropertyDecl::isClassProperty ( ) const
inline
bool clang::ObjCPropertyDecl::isInstanceProperty ( ) const
inline

Definition at line 828 of file DeclObjC.h.

References isClassProperty().

bool clang::ObjCPropertyDecl::isReadOnly ( ) const
inline
bool clang::ObjCPropertyDecl::isRetaining ( ) const
inline

isRetaining - Return true if the property retains its value.

Definition at line 823 of file DeclObjC.h.

References OBJC_PR_copy, OBJC_PR_retain, and OBJC_PR_strong.

void clang::ObjCPropertyDecl::overwritePropertyAttributes ( unsigned  PRVal)
inline

Definition at line 798 of file DeclObjC.h.

Referenced by checkAtomicPropertyMismatch().

void clang::ObjCPropertyDecl::setAtLoc ( SourceLocation  L)
inline

Definition at line 774 of file DeclObjC.h.

Referenced by clang::ASTDeclReader::VisitObjCPropertyDecl().

void clang::ObjCPropertyDecl::setGetterMethodDecl ( ObjCMethodDecl gDecl)
inline
void clang::ObjCPropertyDecl::setGetterName ( Selector  Sel)
inline
void clang::ObjCPropertyDecl::setLParenLoc ( SourceLocation  L)
inline

Definition at line 777 of file DeclObjC.h.

Referenced by clang::ASTDeclReader::VisitObjCPropertyDecl().

void clang::ObjCPropertyDecl::setPropertyAttributes ( PropertyAttributeKind  PRVal)
inline
void clang::ObjCPropertyDecl::setPropertyAttributesAsWritten ( PropertyAttributeKind  PRVal)
inline
void clang::ObjCPropertyDecl::setPropertyImplementation ( PropertyControl  pc)
inline

Definition at line 867 of file DeclObjC.h.

Referenced by clang::ASTDeclReader::VisitObjCPropertyDecl().

void clang::ObjCPropertyDecl::setPropertyIvarDecl ( ObjCIvarDecl Ivar)
inline
void clang::ObjCPropertyDecl::setSetterMethodDecl ( ObjCMethodDecl gDecl)
inline
void clang::ObjCPropertyDecl::setSetterName ( Selector  Sel)
inline
void clang::ObjCPropertyDecl::setType ( QualType  T,
TypeSourceInfo TSI 
)
inline

Definition at line 783 of file DeclObjC.h.

Referenced by clang::ASTDeclReader::VisitObjCPropertyDecl().


The documentation for this class was generated from the following files: