clang API Documentation
#include <Decl.h>


Public Types | |
| typedef specific_decl_iterator < FieldDecl > | field_iterator |
Public Member Functions | |
| const RecordDecl * | getPreviousDecl () const |
| RecordDecl * | getPreviousDecl () |
| Return the previous declaration of this declaration or NULL if this is the first declaration. | |
| const RecordDecl * | getMostRecentDecl () const |
| Returns the most recent (re)declaration of this declaration. | |
| RecordDecl * | getMostRecentDecl () |
| Returns the most recent (re)declaration of this declaration. | |
| bool | hasFlexibleArrayMember () const |
| void | setHasFlexibleArrayMember (bool V) |
| bool | isAnonymousStructOrUnion () const |
| void | setAnonymousStructOrUnion (bool Anon) |
| bool | hasObjectMember () const |
| void | setHasObjectMember (bool val) |
| bool | hasVolatileMember () const |
| void | setHasVolatileMember (bool val) |
| bool | isInjectedClassName () const |
| Determines whether this declaration represents the injected class name. | |
| RecordDecl * | getDefinition () const |
| field_iterator | field_begin () const |
| field_iterator | field_end () const |
| bool | field_empty () const |
| virtual void | completeDefinition () |
| bool | isMsStruct (const ASTContext &C) const |
Static Public Member Functions | |
| static RecordDecl * | Create (const ASTContext &C, TagKind TK, DeclContext *DC, SourceLocation StartLoc, SourceLocation IdLoc, IdentifierInfo *Id, RecordDecl *PrevDecl=0) |
| static RecordDecl * | CreateDeserialized (const ASTContext &C, unsigned ID) |
| static bool | classof (const Decl *D) |
| static bool | classofKind (Kind K) |
Protected Member Functions | |
| RecordDecl (Kind DK, TagKind TK, DeclContext *DC, SourceLocation StartLoc, SourceLocation IdLoc, IdentifierInfo *Id, RecordDecl *PrevDecl) | |
Friends | |
| class | DeclContext |
RecordDecl - Represents a struct/union/class. For example: struct X; // Forward declaration, no "body". union Y { int A, B; }; // Has body with members A and B (FieldDecls). This decl will be marked invalid if *any* members are invalid.
| RecordDecl::RecordDecl | ( | Kind | DK, |
| TagKind | TK, | ||
| DeclContext * | DC, | ||
| SourceLocation | StartLoc, | ||
| SourceLocation | IdLoc, | ||
| IdentifierInfo * | Id, | ||
| RecordDecl * | PrevDecl | ||
| ) | [protected] |
Definition at line 3092 of file Decl.cpp.
References classof().
Referenced by Create(), and CreateDeserialized().
| static bool clang::RecordDecl::classof | ( | const Decl * | D | ) | [inline, static] |
Reimplemented from clang::TagDecl.
Reimplemented in clang::ClassTemplatePartialSpecializationDecl, clang::ClassTemplateSpecializationDecl, and clang::CXXRecordDecl.
Definition at line 3023 of file Decl.h.
References clang::Decl::getKind().
Referenced by RecordDecl().
| static bool clang::RecordDecl::classofKind | ( | Kind | K | ) | [inline, static] |
Reimplemented from clang::TagDecl.
Reimplemented in clang::ClassTemplatePartialSpecializationDecl, clang::ClassTemplateSpecializationDecl, and clang::CXXRecordDecl.
| void RecordDecl::completeDefinition | ( | ) | [virtual] |
completeDefinition - Notes that the definition of this type is now complete.
Reimplemented from clang::TagDecl.
Reimplemented in clang::CXXRecordDecl.
Definition at line 3137 of file Decl.cpp.
References clang::TagDecl::isCompleteDefinition().
Referenced by clang::Sema::ActOnCapturedRegionEnd(), clang::Sema::ActOnFields(), CreateAAPCSABIBuiltinVaListDecl(), CreateAArch64ABIBuiltinVaListDecl(), CreatePowerABIBuiltinVaListDecl(), CreateSystemZBuiltinVaListDecl(), CreateX86_64ABIBuiltinVaListDecl(), clang::CodeGen::CodeGenModule::GetAddrOfConstantString(), clang::ASTContext::getBlockDescriptorExtendedType(), clang::ASTContext::getBlockDescriptorType(), clang::ASTContext::getCFConstantStringType(), clang::CodeGen::CodeGenModule::getObjCFastEnumerationStateType(), and clang::ASTNodeImporter::ImportDefinition().
| RecordDecl * RecordDecl::Create | ( | const ASTContext & | C, |
| TagKind | TK, | ||
| DeclContext * | DC, | ||
| SourceLocation | StartLoc, | ||
| SourceLocation | IdLoc, | ||
| IdentifierInfo * | Id, | ||
| RecordDecl * | PrevDecl = 0 |
||
| ) | [static] |
Definition at line 3104 of file Decl.cpp.
References clang::ASTContext::getLangOpts(), clang::ASTContext::getTypeDeclType(), clang::TagDecl::MayHaveOutOfDateDef, and RecordDecl().
Referenced by clang::Sema::ActOnTag(), clang::Sema::CreateCapturedStmtRecordDecl(), CreateRecordDecl(), and clang::ASTNodeImporter::VisitRecordDecl().
| RecordDecl * RecordDecl::CreateDeserialized | ( | const ASTContext & | C, |
| unsigned | ID | ||
| ) | [static] |
Reimplemented in clang::CXXRecordDecl.
Definition at line 3115 of file Decl.cpp.
References clang::Decl::AllocateDeserializedDecl(), clang::ASTContext::getLangOpts(), clang::TagDecl::MayHaveOutOfDateDef, RecordDecl(), and clang::TTK_Struct.
| RecordDecl::field_iterator RecordDecl::field_begin | ( | ) | const |
Definition at line 3128 of file Decl.cpp.
References clang::DeclContext::FirstDecl, and clang::DeclContext::hasExternalLexicalStorage().
Referenced by clang::Sema::ActOnCapturedRegionError(), clang::Sema::ActOnLambdaError(), clang::Sema::ActOnLambdaExpr(), BitsContainNoUserData(), canExpandIndirectArgument(), CanSkipVTablePointerInitialization(), clang::CodeGen::CodeGenFunction::CGCapturedStmtInfo::CGCapturedStmtInfo(), CheckASTMemory(), clang::Sema::CheckCompletedCXXClass(), CheckConstantExpression(), CheckConstexprCtorInitializer(), clang::Sema::CheckConstexprFunctionBody(), clang::Sema::CheckTransparentUnionArgumentConstraints(), checkTrivialClassMembers(), clang::Sema::CodeCompleteConstructorInitializer(), clang::Sema::ComputeDefaultedCopyAssignmentExceptionSpec(), clang::Sema::ComputeDefaultedCopyCtorExceptionSpec(), clang::Sema::ComputeDefaultedDefaultCtorExceptionSpec(), clang::Sema::ComputeDefaultedDtorExceptionSpec(), clang::Sema::ComputeDefaultedMoveAssignmentExceptionSpec(), clang::Sema::ComputeDefaultedMoveCtorExceptionSpec(), clang::Sema::ComputeInheritingCtorExceptionSpec(), clang::CodeGen::CodeGenTypes::ComputeRecordLayout(), defaultedSpecialMemberIsConstexpr(), clang::Sema::DefineImplicitCopyAssignment(), clang::Sema::DefineImplicitMoveAssignment(), DiagnoseBaseOrMemInitializerOrder(), DiagnoseUninitializedReference(), DumpCXXRecordLayout(), clang::CodeGen::CodeGenFunction::EmitLambdaExpr(), EmitNullConstant(), clang::CodeGen::CodeGenFunction::EnterDtorCleanups(), FillInNullDataMemberPointers(), FindFirstNamedDataMember(), clang::ento::MemRegion::getAsOffset(), clang::CXXRecordDecl::getCaptureFields(), clang::CodeGen::CodeGenTypes::GetExpandedTypes(), clang::FieldDecl::getFieldIndex(), GetNumNonZeroBytesInInit(), clang::CodeGen::CodeGenTBAA::getTBAAStructTypeInfo(), HandleClassZeroInitialization(), HandleConstructorCall(), handleTransparentUnionAttr(), handleVecReturnAttr(), HasTrivialDestructorBody(), InitCapturedStruct(), isCallbackArg(), isEmptyRecord(), isHomogeneousAggregate(), isIntegerLikeType(), isRecordWithSSEVectorType(), isSafeToConvert(), isSingleElementStruct(), IsStructurallyEquivalent(), clang::IsTransparentUnionStandardConversion(), clang::LayoutOverrideSource::layoutRecordType(), clang::Sema::MarkBaseAndMemberDestructorsReferenced(), clang::ASTContext::mergeTransparentUnionType(), PopulateKeysForFields(), possibleTransparentUnionPointerType(), clang::CodeGen::CGRecordLayout::print(), clang::APValue::printPretty(), clang::Sema::RequireLiteralType(), clang::Sema::ShouldDeleteSpecialMember(), subobjectsHaveMoveOrTrivialCopy(), and tryMatchRecordTypes().
| field_iterator clang::RecordDecl::field_end | ( | ) | const [inline] |
Definition at line 3009 of file Decl.h.
Referenced by clang::Sema::ActOnCapturedRegionError(), clang::Sema::ActOnLambdaError(), clang::Sema::ActOnLambdaExpr(), BitsContainNoUserData(), canExpandIndirectArgument(), CanSkipVTablePointerInitialization(), CheckASTMemory(), clang::Sema::CheckCompletedCXXClass(), CheckConstantExpression(), CheckConstexprCtorInitializer(), clang::Sema::CheckConstexprFunctionBody(), clang::Sema::CheckTransparentUnionArgumentConstraints(), checkTrivialClassMembers(), clang::Sema::CodeCompleteConstructorInitializer(), clang::Sema::ComputeDefaultedCopyAssignmentExceptionSpec(), clang::Sema::ComputeDefaultedCopyCtorExceptionSpec(), clang::Sema::ComputeDefaultedDefaultCtorExceptionSpec(), clang::Sema::ComputeDefaultedDtorExceptionSpec(), clang::Sema::ComputeDefaultedMoveAssignmentExceptionSpec(), clang::Sema::ComputeDefaultedMoveCtorExceptionSpec(), clang::Sema::ComputeInheritingCtorExceptionSpec(), defaultedSpecialMemberIsConstexpr(), clang::Sema::DefineImplicitCopyAssignment(), clang::Sema::DefineImplicitMoveAssignment(), DiagnoseBaseOrMemInitializerOrder(), DiagnoseUninitializedReference(), DumpCXXRecordLayout(), EmitNullConstant(), clang::CodeGen::CodeGenFunction::EnterDtorCleanups(), FillInNullDataMemberPointers(), FindFirstNamedDataMember(), clang::ento::MemRegion::getAsOffset(), clang::CodeGen::CodeGenTypes::GetExpandedTypes(), clang::FieldDecl::getFieldIndex(), GetNumNonZeroBytesInInit(), clang::CodeGen::CodeGenTBAA::getTBAAStructTypeInfo(), HandleClassZeroInitialization(), HandleConstructorCall(), handleTransparentUnionAttr(), handleVecReturnAttr(), HasTrivialDestructorBody(), isCallbackArg(), isEmptyRecord(), isHomogeneousAggregate(), isIntegerLikeType(), isRecordWithSSEVectorType(), isSafeToConvert(), isSingleElementStruct(), IsStructurallyEquivalent(), clang::IsTransparentUnionStandardConversion(), clang::LayoutOverrideSource::layoutRecordType(), clang::Sema::MarkBaseAndMemberDestructorsReferenced(), clang::ASTContext::mergeTransparentUnionType(), PopulateKeysForFields(), possibleTransparentUnionPointerType(), clang::APValue::printPretty(), clang::Sema::RequireLiteralType(), clang::Sema::ShouldDeleteSpecialMember(), subobjectsHaveMoveOrTrivialCopy(), and tryMatchRecordTypes().
| RecordDecl* clang::RecordDecl::getDefinition | ( | ) | const [inline] |
getDefinition - Returns the RecordDecl that actually defines this struct/union/class. When determining whether or not a struct/union/class is completely defined, one should use this method as opposed to 'isCompleteDefinition'. 'isCompleteDefinition' indicates whether or not a specific RecordDecl is a completed definition, not whether or not the record type is defined. This method returns NULL if there is no RecordDecl that defines the struct/union/tag.
Reimplemented from clang::TagDecl.
Reimplemented in clang::CXXRecordDecl.
Definition at line 2998 of file Decl.h.
References getDefinition().
Referenced by clang::Sema::BuildMicrosoftCAnonymousStruct(), clang::Sema::CheckBaseSpecifier(), clang::Sema::CheckClassTemplate(), clang::CodeGen::CodeGenTypes::ConvertRecordDeclType(), clang::CXXRecordDecl::forallBases(), clang::ASTContext::getASTRecordLayout(), clang::CodeGen::CodeGenTBAA::getTBAAStructTypeInfo(), clang::ASTNodeImporter::ImportDefinition(), IsCompleteType(), IsStructurallyEquivalent(), isTBAAPathStruct(), and clang::ASTNodeImporter::VisitRecordDecl().
| const RecordDecl* clang::RecordDecl::getMostRecentDecl | ( | ) | const [inline] |
Returns the most recent (re)declaration of this declaration.
Reimplemented from clang::Redeclarable< TagDecl >.
Reimplemented in clang::CXXRecordDecl.
Definition at line 2942 of file Decl.h.
References clang::Redeclarable< TagDecl >::getMostRecentDecl().
Referenced by clang::ASTDeclWriter::VisitRecordDecl().
| RecordDecl* clang::RecordDecl::getMostRecentDecl | ( | ) | [inline] |
Returns the most recent (re)declaration of this declaration.
Reimplemented from clang::Redeclarable< TagDecl >.
Reimplemented in clang::ClassTemplatePartialSpecializationDecl, clang::ClassTemplateSpecializationDecl, and clang::CXXRecordDecl.
Definition at line 2945 of file Decl.h.
References clang::Redeclarable< TagDecl >::getMostRecentDecl().
| const RecordDecl* clang::RecordDecl::getPreviousDecl | ( | ) | const [inline] |
Reimplemented from clang::Redeclarable< TagDecl >.
Reimplemented in clang::CXXRecordDecl.
Definition at line 2935 of file Decl.h.
References getPreviousDecl().
Referenced by clang::ASTContext::getRecordType().
| RecordDecl* clang::RecordDecl::getPreviousDecl | ( | ) | [inline] |
Return the previous declaration of this declaration or NULL if this is the first declaration.
Reimplemented from clang::Redeclarable< TagDecl >.
Reimplemented in clang::CXXRecordDecl.
Definition at line 2938 of file Decl.h.
References getPreviousDecl().
| bool clang::RecordDecl::hasFlexibleArrayMember | ( | ) | const [inline] |
Definition at line 2949 of file Decl.h.
Referenced by clang::Sema::DefineImplicitCopyAssignment(), clang::Sema::DefineImplicitMoveAssignment(), clang::CodeGen::CodeGenTypes::GetExpandedTypes(), isEmptyRecord(), isHomogeneousAggregate(), isIntegerLikeType(), isSingleElementStruct(), isTBAAPathStruct(), clang::Sema::SetCtorInitializers(), and clang::ASTDeclWriter::VisitRecordDecl().
| bool clang::RecordDecl::hasObjectMember | ( | ) | const [inline] |
Definition at line 2969 of file Decl.h.
Referenced by clang::Sema::ActOnFields(), clang::Sema::CheckNontrivialField(), clang::CXXRecordDecl::completeDefinition(), clang::CodeGen::CodeGenFunction::EmitAggregateCopy(), clang::CXXRecordDecl::setBases(), and clang::ASTDeclWriter::VisitRecordDecl().
| bool clang::RecordDecl::hasVolatileMember | ( | ) | const [inline] |
Definition at line 2972 of file Decl.h.
Referenced by clang::Sema::ActOnFields(), clang::CodeGen::CodeGenFunction::hasVolatileMember(), clang::CXXRecordDecl::setBases(), and clang::ASTDeclWriter::VisitRecordDecl().
| bool clang::RecordDecl::isAnonymousStructOrUnion | ( | ) | const [inline] |
isAnonymousStructOrUnion - Whether this is an anonymous struct or union. To be an anonymous struct or union, it must have been declared without a name and there must be no objects of this type declared, e.g.,
union { int i; float f; };
is an anonymous union but neither of the following are:
union X { int i; float f; }; union { int i; float f; } obj;
Definition at line 2964 of file Decl.h.
Referenced by clang::Sema::CheckUsingShadowDecl(), clang::CodeGen::CodeGenFunction::EnterDtorCleanups(), FindDeclaringClass(), FindFirstNamedDataMember(), IsStructurallyEquivalent(), clang::Sema::MarkBaseAndMemberDestructorsReferenced(), PopulateKeysForFields(), clang::Sema::ShouldDeleteSpecialMember(), clang::TemplateDeclInstantiator::VisitCXXRecordDecl(), clang::ASTDeclWriter::VisitRecordDecl(), and clang::ASTNodeImporter::VisitRecordDecl().
| bool RecordDecl::isInjectedClassName | ( | ) | const |
Determines whether this declaration represents the injected class name.
The injected class name in C++ is the name of the class that appears inside the class itself. For example:
struct C { // C is implicitly declared here as a synonym for the class name. }; C::C c; // same as "C c;"
Definition at line 3123 of file Decl.cpp.
References clang::Decl::getDeclContext(), clang::NamedDecl::getDeclName(), clang::Decl::isImplicit(), and clang::DeclContext::isRecord().
Referenced by clang::Sema::ActOnStartCXXMemberDeclarations(), clang::ClassTemplateSpecializationDecl::getMostRecentDecl(), and clang::TemplateDeclInstantiator::VisitCXXRecordDecl().
| bool RecordDecl::isMsStruct | ( | const ASTContext & | C | ) | const |
isMsStrust - Get whether or not this is an ms_struct which can be turned on with an attribute, pragma, or -mms-bitfields commandline option.
isMsStruct - Get whether or not this record uses ms_struct layout. This which can be turned on with an attribute, pragma, or the -mms-bitfields command-line option.
Definition at line 3145 of file Decl.cpp.
References clang::ASTContext::getLangOpts().
Referenced by clang::CodeGen::CodeGenTypes::ComputeRecordLayout(), clang::FieldDecl::getFieldIndex(), and clang::CodeGen::CodeGenTBAA::getTBAAStructTypeInfo().
| void clang::RecordDecl::setAnonymousStructOrUnion | ( | bool | Anon | ) | [inline] |
Definition at line 2965 of file Decl.h.
Referenced by clang::Sema::BuildAnonymousStructOrUnion(), clang::TemplateDeclInstantiator::VisitCXXRecordDecl(), clang::ASTNodeImporter::VisitRecordDecl(), and clang::ASTDeclReader::VisitRecordDecl().
| void clang::RecordDecl::setHasFlexibleArrayMember | ( | bool | V | ) | [inline] |
Definition at line 2950 of file Decl.h.
Referenced by clang::Sema::ActOnFields(), and clang::ASTDeclReader::VisitRecordDecl().
| void clang::RecordDecl::setHasObjectMember | ( | bool | val | ) | [inline] |
Definition at line 2970 of file Decl.h.
Referenced by clang::Sema::ActOnFields(), clang::CXXRecordDecl::setBases(), and clang::ASTDeclReader::VisitRecordDecl().
| void clang::RecordDecl::setHasVolatileMember | ( | bool | val | ) | [inline] |
Definition at line 2973 of file Decl.h.
Referenced by clang::Sema::ActOnFields(), clang::CXXRecordDecl::setBases(), and clang::ASTDeclReader::VisitRecordDecl().
friend class DeclContext [friend] |
Reimplemented from clang::TypeDecl.
Reimplemented in clang::CXXRecordDecl.