clang
3.9.0
|
FieldDecl - An instance of this class is created by Sema::ActOnField to represent a member of a struct/union/class. More...
#include <Decl.h>
Public Member Functions | |
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 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) |
Protected Member Functions | |
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) | |
Friends | |
class | ASTDeclReader |
class | ASTDeclWriter |
Additional Inherited Members | |
![]() | |
enum | ExplicitVisibilityKind { VisibilityForType, VisibilityForValue } |
Kinds of explicit visibility. More... | |
FieldDecl - An instance of this class is created by Sema::ActOnField to represent a member of a struct/union/class.
|
inlineprotected |
Definition at line 2334 of file Decl.h.
References clang::ICIS_NoInit.
Referenced by Create(), and CreateDeserialized().
Definition at line 2470 of file Decl.h.
References clang::ParmVarDecl::classofKind().
|
static |
Definition at line 3443 of file Decl.cpp.
References FieldDecl().
Referenced by addAsFieldToClosureType(), addFieldToRecordDecl(), clang::Sema::BuildAnonymousStructOrUnion(), clang::Sema::buildInitCaptureField(), clang::Sema::BuildMicrosoftCAnonymousStruct(), captureInCapturedRegion(), captureThis(), captureVariablyModifiedType(), clang::Sema::CheckFieldDecl(), CreateAAPCSABIBuiltinVaListDecl(), CreateAArch64ABIBuiltinVaListDecl(), CreatePowerABIBuiltinVaListDecl(), CreateSystemZBuiltinVaListDecl(), CreateX86_64ABIBuiltinVaListDecl(), clang::CodeGen::CodeGenModule::GetAddrOfConstantString(), clang::ASTContext::getBlockDescriptorExtendedType(), clang::ASTContext::getBlockDescriptorType(), clang::ASTContext::getCFConstantStringDecl(), clang::CodeGen::CodeGenModule::getObjCFastEnumerationStateType(), and clang::ASTNodeImporter::VisitFieldDecl().
|
static |
Definition at line 3452 of file Decl.cpp.
References FieldDecl(), clang::ICIS_NoInit, and ID.
|
inline |
Definition at line 2375 of file Decl.h.
Referenced by clang::Sema::ActOnDefs(), clang::Sema::CheckImplementationIvars(), clang::ASTDeclWriter::VisitFieldDecl(), clang::ASTNodeImporter::VisitFieldDecl(), clang::ASTDeclWriter::VisitObjCIvarDecl(), and clang::ASTNodeImporter::VisitObjCIvarDecl().
unsigned FieldDecl::getBitWidthValue | ( | const ASTContext & | Ctx | ) | const |
Definition at line 3468 of file Decl.cpp.
References clang::Expr::EvaluateKnownConstInt(), and isBitField().
Referenced by clang::Sema::ActOnLastBitfield(), BuildImplicitMemberInitializer(), clang::Sema::CheckImplementationIvars(), clang::CodeGen::CodeGenTypes::ComputeRecordLayout(), clang::Sema::DefineImplicitCopyAssignment(), clang::Sema::DefineImplicitMoveAssignment(), DumpRecordLayout(), clang::CodeGen::CGObjCRuntime::EmitValueForIvarAtOffset(), EncodeBitField(), clang::ASTContext::isPromotableBitField(), IsStructurallyEquivalent(), and truncateBitfieldValue().
|
inlineoverride |
Retrieves the canonical declaration of this field.
Definition at line 2466 of file Decl.h.
References clang::Redeclarable< VarDecl >::getFirstDecl().
Referenced by CollectFieldInitializer(), findSubobject(), clang::CodeGen::CGRecordLayout::getBitFieldInfo(), getFieldIndex(), GetKeyForMember(), clang::CodeGen::CGRecordLayout::getLLVMFieldNo(), PopulateKeysForFields(), and clang::Sema::SetCtorInitializers().
|
inline |
Definition at line 2467 of file Decl.h.
References clang::Redeclarable< VarDecl >::getFirstDecl().
|
inline |
Get the captured variable length array type.
Definition at line 2445 of file Decl.h.
Referenced by clang::ento::ExprEngine::VisitLambdaExpr().
unsigned FieldDecl::getFieldIndex | ( | ) | const |
getFieldIndex - Returns the index of this field within its record, as appropriate for passing to ASTRecordLayout::getFieldOffset.
Definition at line 3474 of file Decl.cpp.
References clang::RecordDecl::fields(), getCanonicalDecl(), getFieldIndex(), and getParent().
Referenced by emitAddrOfFieldStorage(), clang::CodeGen::CodeGenFunction::EmitLValueForField(), EncodeBitField(), getFieldIndex(), getFieldOffset(), HandleConstructorCall(), HandleLValueMember(), isDesignatorAtObjectEnd(), and clang::Sema::LookupInlineAsmField().
|
inline |
getInClassInitializer - Get the C++11 in-class initializer for this member, or null if one has not been set.
If a valid declaration has an in-class initializer, but this returns null, then we have not parsed and attached it yet.
Definition at line 2416 of file Decl.h.
Referenced by clang::Sema::BuildCXXDefaultInitExpr(), clang::CXXDefaultInitExpr::getExpr(), clang::CXXCtorInitializer::getSourceRange(), clang::Expr::HasSideEffects(), clang::Sema::InstantiateInClassInitializer(), and clang::ASTNodeImporter::VisitFieldDecl().
|
inline |
getInClassInitStyle - Get the kind of (C++11) in-class initializer which this field has.
Definition at line 2400 of file Decl.h.
References clang::ICIS_NoInit.
Referenced by clang::Sema::ActOnFinishCXXInClassMemberInitializer(), clang::Sema::InstantiateInClassInitializer(), and clang::ASTNodeImporter::VisitFieldDecl().
|
inline |
getParent - Returns the parent of this field declaration, which is the struct in which this method is defined.
Definition at line 2455 of file Decl.h.
Referenced by clang::Sema::ActOnCXXMemberDeclarator(), clang::Sema::BuildBuiltinOffsetOf(), clang::Sema::BuildCXXDefaultInitExpr(), BuildImplicitMemberInitializer(), clang::Sema::CheckNontrivialField(), clang::Sema::DefineImplicitCopyAssignment(), clang::Sema::DefineImplicitMoveAssignment(), emitAddrOfFieldStorage(), EmitCapturedFieldLValue(), clang::CodeGen::CodeGenFunction::EmitLValueForField(), clang::CodeGen::CodeGenFunction::EmitLValueForLambdaField(), EncodeBitField(), evalBinOpFieldRegionFieldRegion(), clang::ento::MemRegion::getAsOffset(), getFieldIndex(), getFieldOffset(), HandleConstructorCall(), HandleLValueMember(), clang::Sema::InstantiateInClassInitializer(), isDesignatorAtObjectEnd(), isUnionField(), setCapturedVLAType(), and clang::Sema::SetCtorInitializers().
|
inline |
|
override |
Definition at line 3493 of file Decl.cpp.
References E, clang::DeclaratorDecl::getInnerLocStart(), and clang::DeclaratorDecl::getSourceRange().
Referenced by clang::ento::MemRegion::sourceRange().
|
inline |
Determine whether this member captures the variable length array type.
Definition at line 2440 of file Decl.h.
Referenced by clang::ento::ExprEngine::VisitLambdaExpr().
|
inline |
hasInClassInitializer - Determine whether this member has a C++11 in-class initializer.
Definition at line 2408 of file Decl.h.
References clang::ICIS_NoInit.
Referenced by clang::Sema::BuildCXXDefaultInitExpr(), CollectFieldInitializer(), clang::Sema::InstantiateInClassInitializer(), and clang::ASTDeclWriter::VisitFieldDecl().
bool FieldDecl::isAnonymousStructOrUnion | ( | ) | const |
isAnonymousStructOrUnion - Determines whether this field is a representative for an anonymous struct or union.
Such fields are unnamed and are implicitly generated by the implementation to store the data for the anonymous union or struct.
Definition at line 3458 of file Decl.cpp.
References clang::NamedDecl::getDeclName(), and clang::ValueDecl::getType().
Referenced by clang::Sema::ActOnFields(), CheckConstexprCtorInitializer(), and IsStructurallyEquivalent().
|
inline |
Determines whether this field is a bitfield.
Definition at line 2361 of file Decl.h.
Referenced by clang::Sema::ActOnLastBitfield(), clang::Sema::BuildBuiltinOffsetOf(), BuildFieldReferenceExpr(), BuildImplicitMemberInitializer(), clang::Sema::CheckImplementationIvars(), clang::CodeGen::CodeGenTypes::ComputeRecordLayout(), clang::Sema::DefineImplicitCopyAssignment(), clang::Sema::DefineImplicitMoveAssignment(), DumpRecordLayout(), clang::CodeGen::CodeGenFunction::EmitAsanPrologueOrEpilogue(), clang::CodeGen::CodeGenFunction::EmitLValueForField(), EmitNullConstant(), clang::CodeGen::CGObjCRuntime::EmitValueForIvarAtOffset(), EncodeBitField(), findSubobject(), clang::CodeGen::CGRecordLayout::getBitFieldInfo(), getBitWidthValue(), HandleConstructorCall(), isIntegerLikeType(), IsStructurallyEquivalent(), and truncateBitfieldValue().
|
inline |
isMutable - Determines whether this field is mutable (C++ only).
Definition at line 2358 of file Decl.h.
Referenced by BuildFieldReferenceExpr(), clang::ASTDeclWriter::VisitFieldDecl(), and clang::ASTNodeImporter::VisitFieldDecl().
|
inline |
Determines whether this is an unnamed bitfield.
Definition at line 2367 of file Decl.h.
References clang::NamedDecl::getDeclName().
Referenced by CheckConstexprCtorInitializer(), clang::Sema::DefineImplicitCopyAssignment(), clang::Sema::DefineImplicitMoveAssignment(), DiagnoseBaseOrMemInitializerOrder(), GetNumNonZeroBytesInInit(), and isEmptyField().
|
inline |
|
inline |
removeInClassInitializer - Remove the C++11 in-class initializer from this member.
Definition at line 2433 of file Decl.h.
Referenced by clang::Sema::ActOnFinishCXXInClassMemberInitializer().
|
inline |
void FieldDecl::setCapturedVLAType | ( | const VariableArrayType * | VLAType | ) |
Set the captured variable length array type for this field.
Definition at line 3509 of file Decl.cpp.
References getParent().
|
inline |
setInClassInitializer - Set the C++11 in-class initializer for this member.
Definition at line 2424 of file Decl.h.
Referenced by clang::Sema::ActOnFinishCXXInClassMemberInitializer(), and clang::ASTNodeImporter::VisitFieldDecl().
|
friend |
|
friend |