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 | 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 () |
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 | classof (const RecordDecl *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 2626 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 2918 of file Decl.h.
References clang::ParmVarDecl::classofKind(), and clang::Decl::getKind().
Referenced by RecordDecl().
| static bool clang::RecordDecl::classof | ( | const RecordDecl * | D | ) | [inline, static] |
| 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 2666 of file Decl.cpp.
References clang::TagDecl::isCompleteDefinition().
Referenced by clang::Sema::ActOnFields(), clang::ASTContext::BuildByRefType(), 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 2637 of file Decl.cpp.
References clang::ASTContext::getTypeDeclType(), and RecordDecl().
Referenced by clang::Sema::ActOnTag(), CreateRecordDecl(), and clang::ASTNodeImporter::VisitRecordDecl().
| RecordDecl * RecordDecl::CreateDeserialized | ( | const ASTContext & | C, |
| unsigned | ID | ||
| ) | [static] |
Reimplemented in clang::CXXRecordDecl.
Definition at line 2646 of file Decl.cpp.
References clang::Decl::AllocateDeserializedDecl(), RecordDecl(), and clang::TTK_Struct.
| RecordDecl::field_iterator RecordDecl::field_begin | ( | ) | const |
Definition at line 2657 of file Decl.cpp.
References clang::DeclContext::FirstDecl, and clang::DeclContext::hasExternalLexicalStorage().
Referenced by BitsContainNoUserData(), canExpandIndirectArgument(), CanSkipVTablePointerInitialization(), CheckASTMemory(), clang::Sema::CheckCompletedCXXClass(), CheckConstexprCtorInitializer(), clang::Sema::CheckConstexprFunctionBody(), clang::Sema::CheckTransparentUnionArgumentConstraints(), clang::Sema::CodeCompleteConstructorInitializer(), clang::Sema::ComputeDefaultedCopyAssignmentExceptionSpecAndConst(), clang::Sema::ComputeDefaultedCopyCtorExceptionSpecAndConst(), clang::Sema::ComputeDefaultedDefaultCtorExceptionSpec(), clang::Sema::ComputeDefaultedDtorExceptionSpec(), clang::Sema::ComputeDefaultedMoveAssignmentExceptionSpec(), clang::Sema::ComputeDefaultedMoveCtorExceptionSpec(), clang::CodeGen::CodeGenTypes::ComputeRecordLayout(), clang::Sema::DefineImplicitCopyAssignment(), clang::Sema::DefineImplicitMoveAssignment(), DiagnoseBaseOrMemInitializerOrder(), clang::Sema::DiagnoseNontrivial(), DumpCXXRecordLayout(), EmitNullConstant(), clang::CodeGen::CodeGenFunction::EnterDtorCleanups(), FillInNullDataMemberPointers(), FindFirstNamedDataMember(), clang::CodeGen::CodeGenTypes::GetExpandedTypes(), clang::FieldDecl::getFieldIndex(), GetNumNonZeroBytesInInit(), HandleClassZeroInitialization(), HandleConstructorCall(), handleTransparentUnionAttr(), handleVecReturnAttr(), HasTrivialDestructorBody(), isEmptyRecord(), isHomogeneousAggregate(), isIntegerLikeType(), isRecordWithSSEVectorType(), isSafeToConvert(), isSingleElementStruct(), IsStructurallyEquivalent(), clang::IsTransparentUnionStandardConversion(), clang::LayoutOverrideSource::layoutRecordType(), clang::Sema::MarkBaseAndMemberDestructorsReferenced(), clang::ASTContext::mergeTransparentUnionType(), possibleTransparentUnionPointerType(), clang::CodeGen::CGRecordLayout::print(), clang::APValue::printPretty(), clang::Sema::RequireLiteralType(), clang::Sema::ShouldDeleteCopyAssignmentOperator(), clang::Sema::ShouldDeleteDestructor(), clang::Sema::ShouldDeleteMoveAssignmentOperator(), clang::Sema::ShouldDeleteSpecialMember(), and tryMatchRecordTypes().
| field_iterator clang::RecordDecl::field_end | ( | ) | const [inline] |
Definition at line 2904 of file Decl.h.
Referenced by BitsContainNoUserData(), canExpandIndirectArgument(), CanSkipVTablePointerInitialization(), CheckASTMemory(), clang::Sema::CheckCompletedCXXClass(), CheckConstexprCtorInitializer(), clang::Sema::CheckConstexprFunctionBody(), clang::Sema::CheckTransparentUnionArgumentConstraints(), clang::Sema::CodeCompleteConstructorInitializer(), clang::Sema::ComputeDefaultedCopyAssignmentExceptionSpecAndConst(), clang::Sema::ComputeDefaultedCopyCtorExceptionSpecAndConst(), clang::Sema::ComputeDefaultedDefaultCtorExceptionSpec(), clang::Sema::ComputeDefaultedDtorExceptionSpec(), clang::Sema::ComputeDefaultedMoveAssignmentExceptionSpec(), clang::Sema::ComputeDefaultedMoveCtorExceptionSpec(), clang::Sema::DefineImplicitCopyAssignment(), clang::Sema::DefineImplicitMoveAssignment(), DiagnoseBaseOrMemInitializerOrder(), clang::Sema::DiagnoseNontrivial(), DumpCXXRecordLayout(), EmitNullConstant(), clang::CodeGen::CodeGenFunction::EnterDtorCleanups(), FillInNullDataMemberPointers(), FindFirstNamedDataMember(), clang::CodeGen::CodeGenTypes::GetExpandedTypes(), clang::FieldDecl::getFieldIndex(), GetNumNonZeroBytesInInit(), HandleClassZeroInitialization(), HandleConstructorCall(), handleTransparentUnionAttr(), handleVecReturnAttr(), HasTrivialDestructorBody(), isEmptyRecord(), isHomogeneousAggregate(), isIntegerLikeType(), isRecordWithSSEVectorType(), isSafeToConvert(), isSingleElementStruct(), IsStructurallyEquivalent(), clang::IsTransparentUnionStandardConversion(), clang::LayoutOverrideSource::layoutRecordType(), clang::Sema::MarkBaseAndMemberDestructorsReferenced(), clang::ASTContext::mergeTransparentUnionType(), possibleTransparentUnionPointerType(), clang::APValue::printPretty(), clang::Sema::RequireLiteralType(), clang::Sema::ShouldDeleteCopyAssignmentOperator(), clang::Sema::ShouldDeleteDestructor(), clang::Sema::ShouldDeleteMoveAssignmentOperator(), clang::Sema::ShouldDeleteSpecialMember(), 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 2893 of file Decl.h.
References clang::VarDecl::getDefinition().
Referenced by clang::Sema::BuildMicrosoftCAnonymousStruct(), clang::Sema::CheckBaseSpecifier(), clang::Sema::CheckClassTemplate(), clang::CodeGen::CodeGenTypes::ConvertRecordDeclType(), clang::CXXRecordDecl::forallBases(), clang::ASTContext::getASTRecordLayout(), clang::ASTNodeImporter::ImportDefinition(), IsCompleteType(), IsStructurallyEquivalent(), 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 2840 of file Decl.h.
References clang::Redeclarable< VarDecl >::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 2843 of file Decl.h.
References clang::Redeclarable< VarDecl >::getMostRecentDecl().
| const RecordDecl* clang::RecordDecl::getPreviousDecl | ( | ) | const [inline] |
Reimplemented from clang::Redeclarable< TagDecl >.
Reimplemented in clang::CXXRecordDecl.
Definition at line 2833 of file Decl.h.
References clang::Redeclarable< VarDecl >::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 2836 of file Decl.h.
References clang::Redeclarable< VarDecl >::getPreviousDecl().
| bool clang::RecordDecl::hasFlexibleArrayMember | ( | ) | const [inline] |
Definition at line 2847 of file Decl.h.
Referenced by clang::Sema::DefineImplicitCopyAssignment(), clang::Sema::DefineImplicitMoveAssignment(), clang::CodeGen::CodeGenTypes::GetExpandedTypes(), isEmptyRecord(), isHomogeneousAggregate(), isIntegerLikeType(), isSingleElementStruct(), clang::Sema::SetCtorInitializers(), and clang::ASTDeclWriter::VisitRecordDecl().
| bool clang::RecordDecl::hasObjectMember | ( | ) | const [inline] |
Definition at line 2867 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::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 2862 of file Decl.h.
Referenced by clang::Sema::CheckUsingShadowDecl(), FindDeclaringClass(), FindFirstNamedDataMember(), GetKeyForMember(), IsAccessible(), clang::Sema::ShouldDeleteCopyAssignmentOperator(), clang::Sema::ShouldDeleteDestructor(), clang::Sema::ShouldDeleteMoveAssignmentOperator(), clang::Sema::ShouldDeleteSpecialMember(), clang::TemplateDeclInstantiator::VisitCXXRecordDecl(), and clang::ASTDeclWriter::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 2652 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().
| void clang::RecordDecl::setAnonymousStructOrUnion | ( | bool | Anon | ) | [inline] |
Definition at line 2863 of file Decl.h.
Referenced by clang::Sema::BuildAnonymousStructOrUnion(), clang::TemplateDeclInstantiator::VisitCXXRecordDecl(), and clang::ASTDeclReader::VisitRecordDecl().
| void clang::RecordDecl::setHasFlexibleArrayMember | ( | bool | V | ) | [inline] |
Definition at line 2848 of file Decl.h.
Referenced by clang::Sema::ActOnFields(), and clang::ASTDeclReader::VisitRecordDecl().
| void clang::RecordDecl::setHasObjectMember | ( | bool | val | ) | [inline] |
Definition at line 2868 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.