clang
3.9.0
|
Represents one property declaration in an Objective-C interface. More...
#include <DeclObjC.h>
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 } |
![]() | |
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) |
TypeSourceInfo * | getTypeSourceInfo () 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) |
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 |
IdentifierInfo * | getDefaultSynthIvarName (ASTContext &Ctx) const |
Get the default name of the synthesized ivar. More... | |
![]() | |
IdentifierInfo * | getIdentifier () 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< Visibility > | getExplicitVisibility (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... | |
NamedDecl * | getUnderlyingDecl () |
Looks through UsingDecls and ObjCCompatibleAliasDecls for the underlying named decl. More... | |
const NamedDecl * | getUnderlyingDecl () const |
NamedDecl * | getMostRecentDecl () |
const NamedDecl * | getMostRecentDecl () const |
ObjCStringFormatFamily | getObjCFStringFormattingFamily () const |
Static Public Member Functions | |
static ObjCPropertyDecl * | Create (ASTContext &C, DeclContext *DC, SourceLocation L, IdentifierInfo *Id, SourceLocation AtLocation, SourceLocation LParenLocation, QualType T, TypeSourceInfo *TSI, PropertyControl propControl=None) |
static ObjCPropertyDecl * | CreateDeserialized (ASTContext &C, unsigned ID) |
static ObjCPropertyQueryKind | getQueryKind (bool isClassProperty) |
static ObjCPropertyDecl * | findPropertyDecl (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 bool | classof (const Decl *D) |
static bool | classofKind (Kind K) |
Additional Inherited Members | |
![]() | |
NamedDecl (Kind DK, DeclContext *DC, SourceLocation L, DeclarationName N) | |
Represents one property declaration in an Objective-C interface.
For example:
Definition at line 699 of file DeclObjC.h.
anonymous enum |
Enumerator | |
---|---|
NumPropertyAttrsBits |
Number of bits fitting all the property attributes. |
Definition at line 724 of file DeclObjC.h.
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.
Definition at line 893 of file DeclObjC.h.
References classofKind().
Definition at line 894 of file DeclObjC.h.
Referenced by classof().
|
static |
Definition at line 2160 of file DeclObjC.cpp.
Referenced by clang::Sema::CreatePropertyDecl(), and clang::ASTNodeImporter::VisitObjCPropertyDecl().
|
static |
Definition at line 2172 of file DeclObjC.cpp.
|
static |
Lookup a property by name in the specified DeclContext.
Definition at line 154 of file DeclObjC.cpp.
References clang::DeclContextLookupResult::begin(), E, clang::DeclContextLookupResult::end(), clang::ObjCProtocolDecl::getDefinition(), I, clang::DeclContext::lookup(), clang::OBJC_PR_query_class, clang::OBJC_PR_query_instance, and clang::OBJC_PR_query_unknown.
Referenced by clang::CodeCompletionResult::CreateCodeCompletionString(), clang::Sema::CreatePropertyDecl(), DiagnoseAvailabilityOfDecl(), clang::ObjCMethodDecl::findPropertyDecl(), clang::ObjCContainerDecl::FindPropertyDeclaration(), clang::ObjCInterfaceDecl::FindPropertyVisibleInPrimaryClass(), clang::Sema::HandleExprPropertyRefExpr(), and clang::sema::FunctionScopeInfo::markSafeWeakUse().
|
inline |
Definition at line 773 of file DeclObjC.h.
Referenced by checkAllProps(), clang::ASTDeclWriter::VisitObjCPropertyDecl(), and clang::ASTNodeImporter::VisitObjCPropertyDecl().
IdentifierInfo * ObjCPropertyDecl::getDefaultSynthIvarName | ( | ASTContext & | Ctx | ) | const |
Get the default name of the synthesized ivar.
Definition at line 202 of file DeclObjC.cpp.
References clang::IdentifierTable::get(), clang::NamedDecl::getIdentifier(), clang::IdentifierInfo::getName(), and clang::ASTContext::Idents.
Referenced by clang::Sema::DefaultSynthesizeProperties().
|
inline |
Definition at line 860 of file DeclObjC.h.
Referenced by AddObjCKeyValueCompletions(), createObjCPropertyGetter(), clang::Sema::DiagnoseOwningPropertyGetterSynthesis(), clang::CodeGen::CodeGenFunction::GenerateObjCGetter(), clang::CodeGen::CodeGenFunction::generateObjCGetterBody(), clang::ASTDeclWriter::VisitObjCPropertyDecl(), and clang::ASTNodeImporter::VisitObjCPropertyDecl().
|
inline |
Definition at line 854 of file DeclObjC.h.
Referenced by clang::Sema::AtomicPropertySetterGetterRules(), clang::Sema::DefaultSynthesizeProperties(), clang::Sema::DiagnoseOwningPropertyGetterSynthesis(), clang::Sema::DiagnosePropertyMismatch(), clang::Sema::DiagnoseUnimplementedProperties(), clang::ObjCPropertyRefExpr::getGetterSelector(), clang::ASTContext::getObjCEncodingForPropertyDecl(), clang::Sema::HandlePropertyInClassExtension(), clang::Sema::ProcessPropertyDecl(), SuperClassImplementsProperty(), clang::ASTDeclWriter::VisitObjCPropertyDecl(), and clang::ASTNodeImporter::VisitObjCPropertyDecl().
|
inline |
Definition at line 776 of file DeclObjC.h.
Referenced by clang::Sema::AtomicPropertySetterGetterRules(), clang::ASTDeclWriter::VisitObjCPropertyDecl(), and clang::ASTNodeImporter::VisitObjCPropertyDecl().
|
inline |
Definition at line 792 of file DeclObjC.h.
Referenced by clang::Sema::AtomicPropertySetterGetterRules(), checkARCPropertyImpl(), checkAtomicPropertyMismatch(), clang::Sema::checkUnsafeExprAssigns(), createObjCPropertyGetter(), clang::Sema::DefaultSynthesizeProperties(), clang::Sema::DiagnosePropertyMismatch(), clang::CodeGen::CodeGenFunction::GenerateObjCAtomicGetterCopyHelperFunction(), clang::CodeGen::CodeGenFunction::GenerateObjCAtomicSetterCopyHelperFunction(), clang::ASTContext::getObjCEncodingForPropertyDecl(), clang::Sema::HandlePropertyInClassExtension(), clang::Sema::ProcessPropertyDecl(), setImpliedPropertyAttributeForReadOnlyProperty(), SuperClassImplementsProperty(), clang::ASTDeclWriter::VisitObjCPropertyDecl(), and clang::ASTNodeImporter::VisitObjCPropertyDecl().
|
inline |
Definition at line 802 of file DeclObjC.h.
Referenced by clang::Sema::AtomicPropertySetterGetterRules(), checkAllAtProps(), checkAllProps(), checkAtomicPropertyMismatch(), clang::Sema::checkUnsafeExprAssigns(), clang::Sema::HandlePropertyInClassExtension(), hasWrittenStorageAttribute(), clang::ASTDeclWriter::VisitObjCPropertyDecl(), and clang::ASTNodeImporter::VisitObjCPropertyDecl().
|
inline |
Definition at line 870 of file DeclObjC.h.
Referenced by clang::Sema::DefaultSynthesizeProperties(), clang::Sema::DiagnoseUnimplementedProperties(), clang::ASTDeclWriter::VisitObjCPropertyDecl(), and clang::ASTNodeImporter::VisitObjCPropertyDecl().
|
inline |
Definition at line 877 of file DeclObjC.h.
Referenced by findBackingIvar(), clang::Sema::GetIvarBackingPropertyAccessor(), clang::ASTDeclWriter::VisitObjCPropertyDecl(), and clang::ASTNodeImporter::VisitObjCPropertyDecl().
|
inline |
Definition at line 830 of file DeclObjC.h.
References isClassProperty(), clang::OBJC_PR_query_class, and clang::OBJC_PR_query_instance.
Referenced by clang::Sema::AtomicPropertySetterGetterRules(), clang::Sema::CreatePropertyDecl(), clang::Sema::DefaultSynthesizeProperties(), findBackingIvar(), clang::Sema::HandlePropertyInClassExtension(), and clang::ASTNodeImporter::VisitObjCPropertyImplDecl().
|
inlinestatic |
Definition at line 834 of file DeclObjC.h.
References clang::OBJC_PR_query_class, and clang::OBJC_PR_query_instance.
|
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().
|
inline |
Definition at line 863 of file DeclObjC.h.
Referenced by AddObjCKeyValueCompletions(), clang::CodeGen::CodeGenFunction::GenerateObjCSetter(), clang::CodeGen::CodeGenFunction::generateObjCSetterBody(), clang::ASTDeclWriter::VisitObjCPropertyDecl(), and clang::ASTNodeImporter::VisitObjCPropertyDecl().
|
inline |
Definition at line 857 of file DeclObjC.h.
Referenced by clang::Sema::AtomicPropertySetterGetterRules(), clang::Sema::DefaultSynthesizeProperties(), clang::Sema::DiagnosePropertyMismatch(), clang::ASTContext::getObjCEncodingForPropertyDecl(), clang::ObjCPropertyRefExpr::getSetterSelector(), clang::ObjCContainerDecl::HasUserDeclaredSetterMethod(), clang::Sema::ProcessPropertyDecl(), SuperClassImplementsProperty(), clang::ASTDeclWriter::VisitObjCPropertyDecl(), and clang::ASTNodeImporter::VisitObjCPropertyDecl().
|
inlineoverride |
Definition at line 881 of file DeclObjC.h.
|
inline |
Definition at line 781 of file DeclObjC.h.
Referenced by AddObjCKeyValueCompletions(), clang::Sema::CheckObjCPropertyAttributes(), checkPropertyDeclWithOwnership(), clang::Sema::checkUnsafeExprAssigns(), createObjCPropertyGetter(), clang::Sema::DiagnosePropertyMismatch(), DiagnosePropertyMismatchDeclInProtocols(), clang::CodeGen::CodeGenFunction::GenerateObjCAtomicGetterCopyHelperFunction(), clang::CodeGen::CodeGenFunction::generateObjCGetterBody(), clang::ASTContext::getObjCEncodingForPropertyDecl(), getSetterKind(), clang::Sema::HandlePropertyInClassExtension(), clang::ASTDeclWriter::VisitObjCPropertyDecl(), and clang::ASTNodeImporter::VisitObjCPropertyDecl().
|
inline |
Definition at line 779 of file DeclObjC.h.
Referenced by clang::Sema::AtomicPropertySetterGetterRules(), checkAllAtProps(), clang::ASTDeclWriter::VisitObjCPropertyDecl(), and clang::ASTNodeImporter::VisitObjCPropertyDecl().
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().
|
inline |
isAtomic - Return true if the property is atomic.
Definition at line 818 of file DeclObjC.h.
References OBJC_PR_atomic.
|
inline |
Definition at line 829 of file DeclObjC.h.
References OBJC_PR_class.
Referenced by clang::Sema::AtomicPropertySetterGetterRules(), clang::Sema::DefaultSynthesizeProperties(), clang::Sema::DiagnoseOwningPropertyGetterSynthesis(), DiagnoseUnimplementedAccessor(), getQueryKind(), and isInstanceProperty().
|
inline |
Definition at line 828 of file DeclObjC.h.
References isClassProperty().
|
inline |
isReadOnly - Return true iff the property has a setter.
Definition at line 813 of file DeclObjC.h.
References OBJC_PR_readonly.
Referenced by findBackingIvar(), clang::ASTContext::getObjCEncodingForPropertyDecl(), clang::Sema::HandlePropertyInClassExtension(), hasWrittenStorageAttribute(), and clang::Sema::ProcessPropertyDecl().
|
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.
|
inline |
Definition at line 798 of file DeclObjC.h.
Referenced by checkAtomicPropertyMismatch().
|
inline |
Definition at line 774 of file DeclObjC.h.
Referenced by clang::ASTDeclReader::VisitObjCPropertyDecl().
|
inline |
Definition at line 861 of file DeclObjC.h.
Referenced by clang::ASTNodeImporter::VisitObjCPropertyDecl(), and clang::ASTDeclReader::VisitObjCPropertyDecl().
|
inline |
Definition at line 855 of file DeclObjC.h.
Referenced by clang::ASTNodeImporter::VisitObjCPropertyDecl(), and clang::ASTDeclReader::VisitObjCPropertyDecl().
|
inline |
Definition at line 777 of file DeclObjC.h.
Referenced by clang::ASTDeclReader::VisitObjCPropertyDecl().
|
inline |
Definition at line 795 of file DeclObjC.h.
Referenced by clang::Sema::CheckObjCPropertyAttributes(), clang::ASTNodeImporter::VisitObjCPropertyDecl(), and clang::ASTDeclReader::VisitObjCPropertyDecl().
|
inline |
Definition at line 806 of file DeclObjC.h.
Referenced by clang::ASTNodeImporter::VisitObjCPropertyDecl(), and clang::ASTDeclReader::VisitObjCPropertyDecl().
|
inline |
Definition at line 867 of file DeclObjC.h.
Referenced by clang::ASTDeclReader::VisitObjCPropertyDecl().
|
inline |
Definition at line 874 of file DeclObjC.h.
Referenced by clang::ASTNodeImporter::VisitObjCPropertyDecl(), and clang::ASTDeclReader::VisitObjCPropertyDecl().
|
inline |
Definition at line 864 of file DeclObjC.h.
Referenced by clang::ASTNodeImporter::VisitObjCPropertyDecl(), and clang::ASTDeclReader::VisitObjCPropertyDecl().
|
inline |
Definition at line 858 of file DeclObjC.h.
Referenced by clang::ASTNodeImporter::VisitObjCPropertyDecl(), and clang::ASTDeclReader::VisitObjCPropertyDecl().
|
inline |
Definition at line 783 of file DeclObjC.h.
Referenced by clang::ASTDeclReader::VisitObjCPropertyDecl().