clang API Documentation

Public Types | Public Member Functions | Static Public Member Functions
clang::ObjCPropertyDecl Class Reference

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

#include <DeclObjC.h>

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

List of all members.

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
}
enum  { NumPropertyAttrsBits = 12 }
enum  SetterKind { Assign, Retain, Copy, Weak }
enum  PropertyControl { None, Required, Optional }

Public Member Functions

SourceLocation getAtLoc () const
void setAtLoc (SourceLocation L)
SourceLocation getLParenLoc () const
void setLParenLoc (SourceLocation L)
TypeSourceInfo * getTypeSourceInfo () const
QualType getType () const
void setType (TypeSourceInfo *T)
PropertyAttributeKind getPropertyAttributes () const
void setPropertyAttributes (PropertyAttributeKind PRVal)
PropertyAttributeKind getPropertyAttributesAsWritten () const
bool hasWrittenStorageAttribute () const
void setPropertyAttributesAsWritten (PropertyAttributeKind PRVal)
void makeitReadWriteAttribute ()
bool isReadOnly () const
 isReadOnly - Return true iff the property has a setter.
bool isAtomic () const
 isAtomic - Return true if the property is atomic.
bool isRetaining () const
 isRetaining - Return true if the property retains its value.
SetterKind getSetterKind () const
Selector getGetterName () const
void setGetterName (Selector Sel)
Selector getSetterName () const
void setSetterName (Selector Sel)
ObjCMethodDecl * getGetterMethodDecl () const
void setGetterMethodDecl (ObjCMethodDecl *gDecl)
ObjCMethodDecl * getSetterMethodDecl () const
void setSetterMethodDecl (ObjCMethodDecl *gDecl)
void setPropertyImplementation (PropertyControl pc)
PropertyControl getPropertyImplementation () const
void setPropertyIvarDecl (ObjCIvarDecl *Ivar)
ObjCIvarDecl * getPropertyIvarDecl () const
SourceRange getSourceRange () const override LLVM_READONLY
 Source range that this declaration covers.
IdentifierInfo * getDefaultSynthIvarName (ASTContext &Ctx) const
 Get the default name of the synthesized ivar.

Static Public Member Functions

static ObjCPropertyDecl * Create (ASTContext &C, DeclContext *DC, SourceLocation L, IdentifierInfo *Id, SourceLocation AtLocation, SourceLocation LParenLocation, TypeSourceInfo *T, PropertyControl propControl=None)
static ObjCPropertyDecl * CreateDeserialized (ASTContext &C, unsigned ID)
static ObjCPropertyDecl * findPropertyDecl (const DeclContext *DC, IdentifierInfo *propertyID)
 Lookup a property by name in the specified DeclContext.
static bool classof (const Decl *D)
static bool classofKind (Kind K)

Detailed Description

Represents one property declaration in an Objective-C interface.

For example:

 {.mm}
 \@property (assign, readwrite) int MyProperty;

Definition at line 2186 of file DeclObjC.h.


Member Enumeration Documentation

anonymous enum
Enumerator:
NumPropertyAttrsBits 

Number of bits fitting all the property attributes.

Definition at line 2206 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 

Definition at line 2189 of file DeclObjC.h.

Enumerator:
None 
Required 
Optional 

Definition at line 2212 of file DeclObjC.h.

Enumerator:
Assign 
Retain 
Copy 
Weak 

Definition at line 2211 of file DeclObjC.h.


Member Function Documentation

static bool clang::ObjCPropertyDecl::classof ( const Decl *  D) [inline, static]

Reimplemented from clang::NamedDecl.

Definition at line 2359 of file DeclObjC.h.

References classofKind(), and clang::Decl::getKind().

static bool clang::ObjCPropertyDecl::classofKind ( Kind  K) [inline, static]

Reimplemented from clang::NamedDecl.

Definition at line 2360 of file DeclObjC.h.

Referenced by classof().

ObjCPropertyDecl * ObjCPropertyDecl::Create ( ASTContext &  C,
DeclContext *  DC,
SourceLocation  L,
IdentifierInfo *  Id,
SourceLocation  AtLocation,
SourceLocation  LParenLocation,
TypeSourceInfo *  T,
PropertyControl  propControl = None 
) [static]

Definition at line 1866 of file DeclObjC.cpp.

References AttributeLangSupport::C.

ObjCPropertyDecl * ObjCPropertyDecl::findPropertyDecl ( const DeclContext *  DC,
IdentifierInfo *  propertyID 
) [static]

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 2309 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 checkObjCDealloc(), clang::ASTContext::getObjCEncodingForPropertyDecl(), and scan_ivar_release().

SourceRange clang::ObjCPropertyDecl::getSourceRange ( ) const [inline, override, virtual]

Source range that this declaration covers.

Reimplemented from clang::Decl.

Definition at line 2348 of file DeclObjC.h.

References clang::Decl::getLocation().

isAtomic - Return true if the property is atomic.

Definition at line 2296 of file DeclObjC.h.

References OBJC_PR_atomic.

isReadOnly - Return true iff the property has a setter.

Definition at line 2291 of file DeclObjC.h.

References OBJC_PR_readonly.

Referenced by checkObjCDealloc(), clang::ASTContext::getObjCEncodingForPropertyDecl(), and clang::Sema::ProcessPropertyDecl().

isRetaining - Return true if the property retains its value.

Definition at line 2301 of file DeclObjC.h.

References OBJC_PR_copy, OBJC_PR_retain, and OBJC_PR_strong.

Definition at line 2283 of file DeclObjC.h.

References OBJC_PR_readonly, and OBJC_PR_readwrite.

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

Definition at line 2253 of file DeclObjC.h.

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

Definition at line 2256 of file DeclObjC.h.

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

Definition at line 2334 of file DeclObjC.h.

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

Definition at line 2260 of file DeclObjC.h.

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


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