clang
3.9.0
|
ObjCIvarDecl - Represents an ObjC instance variable. More...
#include <DeclObjC.h>
Public Types | |
enum | AccessControl { None, Private, Protected, Public, Package } |
![]() | |
enum | ExplicitVisibilityKind { VisibilityForType, VisibilityForValue } |
Kinds of explicit visibility. More... | |
Public Member Functions | |
const ObjCInterfaceDecl * | getContainingInterface () const |
Return the class interface that this ivar is logically contained in; this is either the interface where the ivar was declared, or the interface the ivar is conceptually a part of in the case of synthesized ivars. More... | |
ObjCIvarDecl * | getNextIvar () |
const ObjCIvarDecl * | getNextIvar () const |
void | setNextIvar (ObjCIvarDecl *ivar) |
void | setAccessControl (AccessControl ac) |
AccessControl | getAccessControl () const |
AccessControl | getCanonicalAccessControl () const |
void | setSynthesize (bool synth) |
bool | getSynthesize () const |
QualType | getUsageType (QualType objectType) const |
Retrieve the type of this instance variable when viewed as a member of a specific object type. More... | |
![]() | |
unsigned | getFieldIndex () const |
getFieldIndex - Returns the index of this field within its record, as appropriate for passing to ASTRecordLayout::getFieldOffset. More... | |
bool | isMutable () const |
isMutable - Determines whether this field is mutable (C++ only). More... | |
bool | isBitField () const |
Determines whether this field is a bitfield. More... | |
bool | isUnnamedBitfield () const |
Determines whether this is an unnamed bitfield. More... | |
bool | isAnonymousStructOrUnion () const |
isAnonymousStructOrUnion - Determines whether this field is a representative for an anonymous struct or union. More... | |
Expr * | getBitWidth () const |
unsigned | getBitWidthValue (const ASTContext &Ctx) const |
void | setBitWidth (Expr *Width) |
setBitWidth - Set the bit-field width for this member. More... | |
void | removeBitWidth () |
removeBitWidth - Remove the bit-field width from this member. More... | |
InClassInitStyle | getInClassInitStyle () const |
getInClassInitStyle - Get the kind of (C++11) in-class initializer which this field has. More... | |
bool | hasInClassInitializer () const |
hasInClassInitializer - Determine whether this member has a C++11 in-class initializer. More... | |
Expr * | getInClassInitializer () const |
getInClassInitializer - Get the C++11 in-class initializer for this member, or null if one has not been set. More... | |
void | setInClassInitializer (Expr *Init) |
setInClassInitializer - Set the C++11 in-class initializer for this member. More... | |
void | removeInClassInitializer () |
removeInClassInitializer - Remove the C++11 in-class initializer from this member. More... | |
bool | hasCapturedVLAType () const |
Determine whether this member captures the variable length array type. More... | |
const VariableArrayType * | getCapturedVLAType () const |
Get the captured variable length array type. More... | |
void | setCapturedVLAType (const VariableArrayType *VLAType) |
Set the captured variable length array type for this field. More... | |
const RecordDecl * | getParent () const |
getParent - Returns the parent of this field declaration, which is the struct in which this method is defined. More... | |
RecordDecl * | getParent () |
SourceRange | getSourceRange () const override LLVM_READONLY |
FieldDecl * | getCanonicalDecl () override |
Retrieves the canonical declaration of this field. More... | |
const FieldDecl * | getCanonicalDecl () const |
![]() | |
TypeSourceInfo * | getTypeSourceInfo () const |
void | setTypeSourceInfo (TypeSourceInfo *TI) |
SourceLocation | getInnerLocStart () const |
getInnerLocStart - Return SourceLocation representing start of source range ignoring outer template declarations. More... | |
void | setInnerLocStart (SourceLocation L) |
SourceLocation | getOuterLocStart () const |
getOuterLocStart - Return SourceLocation representing start of source range taking into account any outer template declarations. More... | |
SourceRange | getSourceRange () const override LLVM_READONLY |
SourceLocation | getLocStart () const LLVM_READONLY |
NestedNameSpecifier * | getQualifier () const |
Retrieve the nested-name-specifier that qualifies the name of this declaration, if it was present in the source. More... | |
NestedNameSpecifierLoc | getQualifierLoc () const |
Retrieve the nested-name-specifier (with source-location information) that qualifies the name of this declaration, if it was present in the source. More... | |
void | setQualifierInfo (NestedNameSpecifierLoc QualifierLoc) |
unsigned | getNumTemplateParameterLists () const |
TemplateParameterList * | getTemplateParameterList (unsigned index) const |
void | setTemplateParameterListsInfo (ASTContext &Context, ArrayRef< TemplateParameterList * > TPLists) |
SourceLocation | getTypeSpecStartLoc () const |
![]() | |
QualType | getType () const |
void | setType (QualType newType) |
bool | isWeak () const |
Determine whether this symbol is weakly-imported, or declared with the weak or weak-ref attr. 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 |
![]() | |
Mergeable () | |
FieldDecl * | getFirstDecl () |
Return the first declaration of this declaration or itself if this is the only declaration. More... | |
const FieldDecl * | getFirstDecl () const |
Return the first declaration of this declaration or itself if this is the only declaration. More... | |
bool | isFirstDecl () const |
Returns true if this is the first declaration. More... | |
Static Public Member Functions | |
static ObjCIvarDecl * | Create (ASTContext &C, ObjCContainerDecl *DC, SourceLocation StartLoc, SourceLocation IdLoc, IdentifierInfo *Id, QualType T, TypeSourceInfo *TInfo, AccessControl ac, Expr *BW=nullptr, bool synthesized=false) |
static ObjCIvarDecl * | CreateDeserialized (ASTContext &C, unsigned ID) |
static bool | classof (const Decl *D) |
static bool | classofKind (Kind K) |
![]() | |
static FieldDecl * | Create (const ASTContext &C, DeclContext *DC, SourceLocation StartLoc, SourceLocation IdLoc, IdentifierInfo *Id, QualType T, TypeSourceInfo *TInfo, Expr *BW, bool Mutable, InClassInitStyle InitStyle) |
static FieldDecl * | CreateDeserialized (ASTContext &C, unsigned ID) |
static bool | classof (const Decl *D) |
static bool | classofKind (Kind K) |
![]() | |
static bool | classof (const Decl *D) |
static bool | classofKind (Kind K) |
![]() | |
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 | |
![]() | |
FieldDecl (Kind DK, DeclContext *DC, SourceLocation StartLoc, SourceLocation IdLoc, IdentifierInfo *Id, QualType T, TypeSourceInfo *TInfo, Expr *BW, bool Mutable, InClassInitStyle InitStyle) | |
![]() | |
DeclaratorDecl (Kind DK, DeclContext *DC, SourceLocation L, DeclarationName N, QualType T, TypeSourceInfo *TInfo, SourceLocation StartL) | |
![]() | |
ValueDecl (Kind DK, DeclContext *DC, SourceLocation L, DeclarationName N, QualType T) | |
![]() | |
NamedDecl (Kind DK, DeclContext *DC, SourceLocation L, DeclarationName N) | |
ObjCIvarDecl - Represents an ObjC instance variable.
In general, ObjC instance variables are identical to C. The only exception is Objective-C supports C++ style access control. For example:
@interface IvarExample : NSObject { id defaultToProtected; @public: id canBePublic; // same as C++. @protected: id canBeProtected; // same as C++. @package: id canBePackage; // framework visibility (not available in C++). }
Definition at line 1849 of file DeclObjC.h.
Enumerator | |
---|---|
None | |
Private | |
Protected | |
Public | |
Package |
Definition at line 1853 of file DeclObjC.h.
Definition at line 1902 of file DeclObjC.h.
References classofKind().
Definition at line 1903 of file DeclObjC.h.
Referenced by classof(), and clang::ASTDeclWriter::VisitFieldDecl().
|
static |
Definition at line 1677 of file DeclObjC.cpp.
References ID, and clang::ObjCInterfaceDecl::setIvarList().
Referenced by clang::Sema::ActOnIvar(), clang::Sema::ActOnLastBitfield(), clang::Sema::ActOnPropertyImplDecl(), and clang::ASTNodeImporter::VisitObjCIvarDecl().
|
static |
Definition at line 1713 of file DeclObjC.cpp.
|
inline |
Definition at line 1888 of file DeclObjC.h.
Referenced by checkARCPropertyImpl(), clang::Sema::LookupInObjCMethod(), LookupMemberExpr(), clang::ASTDeclWriter::VisitObjCIvarDecl(), and clang::ASTNodeImporter::VisitObjCIvarDecl().
|
inline |
Definition at line 1890 of file DeclObjC.h.
const ObjCInterfaceDecl * ObjCIvarDecl::getContainingInterface | ( | ) | const |
Return the class interface that this ivar is logically contained in; this is either the interface where the ivar was declared, or the interface the ivar is conceptually a part of in the case of synthesized ivars.
Definition at line 1719 of file DeclObjC.cpp.
References clang::ObjCCategoryDecl::getClassInterface(), and clang::ObjCCategoryDecl::IsClassExtension().
Referenced by createObjCPropertyGetter(), and LookupFieldBitOffset().
|
inline |
Definition at line 1882 of file DeclObjC.h.
Referenced by clang::Sema::CodeCompleteObjCPropertySynthesizeIvar(), clang::Sema::CollectIvarsToConstructOrDestruct(), clang::ASTContext::DeepCollectObjCIvars(), DiagnoseWeakIvars(), emitCXXDestructMethod(), FindIvarInterface(), hasMRCWeakIvars(), LookupFieldBitOffset(), and needsDestructMethod().
|
inline |
Definition at line 1883 of file DeclObjC.h.
|
inline |
Definition at line 1895 of file DeclObjC.h.
Referenced by clang::Sema::ActOnPropertyImplDecl(), clang::Sema::IvarBacksCurrentMethodAccessor(), clang::ASTDeclWriter::VisitObjCIvarDecl(), and clang::ASTNodeImporter::VisitObjCIvarDecl().
Retrieve the type of this instance variable when viewed as a member of a specific object type.
Definition at line 1743 of file DeclObjC.cpp.
References clang::ValueDecl::getType(), clang::Property, and clang::QualType::substObjCMemberType().
Referenced by clang::Sema::ActOnPropertyImplDecl(), clang::Sema::LookupInObjCMethod(), and LookupMemberExpr().
|
inline |
Definition at line 1886 of file DeclObjC.h.
Referenced by clang::ASTDeclReader::VisitObjCIvarDecl().
|
inline |
Definition at line 1884 of file DeclObjC.h.
Referenced by clang::ObjCInterfaceDecl::all_declared_ivar_begin(), and clang::ASTDeclReader::VisitObjCIvarDecl().
|
inline |
Definition at line 1894 of file DeclObjC.h.
Referenced by clang::ASTDeclReader::VisitObjCIvarDecl().