clang API Documentation

Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Friends
clang::CXXRecordDecl Class Reference

#include <DeclCXX.h>

Inheritance diagram for clang::CXXRecordDecl:
Inheritance graph
[legend]
Collaboration diagram for clang::CXXRecordDecl:
Collaboration graph
[legend]

List of all members.

Classes

struct  DefinitionData
class  friend_iterator
 An iterator over the friend declarations of a class. More...

Public Types

typedef CXXBaseSpecifierbase_class_iterator
typedef const CXXBaseSpecifierbase_class_const_iterator
typedef std::reverse_iterator
< base_class_iterator
reverse_base_class_iterator
typedef std::reverse_iterator
< base_class_const_iterator
reverse_base_class_const_iterator
typedef specific_decl_iterator
< CXXMethodDecl
method_iterator
typedef specific_decl_iterator
< CXXConstructorDecl
ctor_iterator
 Iterator access to constructor members.
typedef UnresolvedSetImpl::iterator conversion_iterator
typedef bool ForallBasesCallback (const CXXRecordDecl *BaseDefinition, void *UserData)
 Function type used by forallBases() as a callback.
typedef bool BaseMatchesCallback (const CXXBaseSpecifier *Specifier, CXXBasePath &Path, void *UserData)
 Function type used by lookupInBases() to determine whether a specific base class subobject matches the lookup criteria.

Public Member Functions

virtual CXXRecordDeclgetCanonicalDecl ()
 Retrieves the "canonical" declaration of the given declaration.
virtual const CXXRecordDeclgetCanonicalDecl () const
const CXXRecordDeclgetPreviousDecl () const
CXXRecordDeclgetPreviousDecl ()
 Return the previous declaration of this declaration or NULL if this is the first declaration.
const CXXRecordDeclgetMostRecentDecl () const
 Returns the most recent (re)declaration of this declaration.
CXXRecordDeclgetMostRecentDecl ()
 Returns the most recent (re)declaration of this declaration.
CXXRecordDeclgetDefinition () const
bool hasDefinition () const
bool isDynamicClass () const
void setBases (CXXBaseSpecifier const *const *Bases, unsigned NumBases)
 setBases - Sets the base classes of this struct or class.
unsigned getNumBases () const
base_class_iterator bases_begin ()
base_class_const_iterator bases_begin () const
base_class_iterator bases_end ()
base_class_const_iterator bases_end () const
reverse_base_class_iterator bases_rbegin ()
reverse_base_class_const_iterator bases_rbegin () const
reverse_base_class_iterator bases_rend ()
reverse_base_class_const_iterator bases_rend () const
unsigned getNumVBases () const
base_class_iterator vbases_begin ()
base_class_const_iterator vbases_begin () const
base_class_iterator vbases_end ()
base_class_const_iterator vbases_end () const
reverse_base_class_iterator vbases_rbegin ()
reverse_base_class_const_iterator vbases_rbegin () const
reverse_base_class_iterator vbases_rend ()
reverse_base_class_const_iterator vbases_rend () const
bool hasAnyDependentBases () const
 Determine whether this class has any dependent base classes.
method_iterator method_begin () const
method_iterator method_end () const
 method_end - Method end iterator.
ctor_iterator ctor_begin () const
ctor_iterator ctor_end () const
friend_iterator friend_begin () const
friend_iterator friend_end () const
void pushFriendDecl (FriendDecl *FD)
bool hasFriends () const
 Determines whether this record has any friends.
bool needsImplicitDefaultConstructor () const
 Determine if we need to declare a default constructor for this class.
bool hasDeclaredDefaultConstructor () const
bool hasConstCopyConstructor () const
CXXConstructorDeclgetCopyConstructor (unsigned TypeQuals) const
 getCopyConstructor - Returns the copy constructor for this class
CXXConstructorDeclgetMoveConstructor () const
 getMoveConstructor - Returns the move constructor for this class
CXXMethodDeclgetCopyAssignmentOperator (bool ArgIsConst) const
 Retrieve the copy-assignment operator for this class, if available.
CXXMethodDeclgetMoveAssignmentOperator () const
bool hasUserDeclaredConstructor () const
bool hasUserProvidedDefaultConstructor () const
bool hasUserDeclaredCopyConstructor () const
bool hasDeclaredCopyConstructor () const
 Determine whether this class has had its copy constructor declared, either via the user or via an implicit declaration.
bool hasUserDeclaredMoveOperation () const
bool hasUserDeclaredMoveConstructor () const
 Determine whether this class has had a move constructor declared by the user.
bool hasDeclaredMoveConstructor () const
 Determine whether this class has had a move constructor declared.
bool hasFailedImplicitMoveConstructor () const
 Determine whether implicit move constructor generation for this class has failed before.
void setFailedImplicitMoveConstructor (bool Failed=true)
 Set whether implicit move constructor generation for this class has failed before.
bool needsImplicitMoveConstructor () const
 Determine whether this class should get an implicit move constructor or if any existing special member function inhibits this.
bool hasUserDeclaredCopyAssignment () const
bool hasDeclaredCopyAssignment () const
 Determine whether this class has had its copy assignment operator declared, either via the user or via an implicit declaration.
bool hasUserDeclaredMoveAssignment () const
 Determine whether this class has had a move assignment declared by the user.
bool hasDeclaredMoveAssignment () const
bool hasFailedImplicitMoveAssignment () const
 Determine whether implicit move assignment generation for this class has failed before.
void setFailedImplicitMoveAssignment (bool Failed=true)
 Set whether implicit move assignment generation for this class has failed before.
bool needsImplicitMoveAssignment () const
 Determine whether this class should get an implicit move assignment operator or if any existing special member function inhibits this.
bool hasUserDeclaredDestructor () const
bool hasDeclaredDestructor () const
 Determine whether this class has had its destructor declared, either via the user or via an implicit declaration.
bool isLambda () const
 Determine whether this class describes a lambda function object.
void setLambda (bool Lambda=true)
UnresolvedSetImplgetConversionFunctions ()
const UnresolvedSetImplgetConversionFunctions () const
conversion_iterator conversion_begin () const
conversion_iterator conversion_end () const
void removeConversion (const NamedDecl *Old)
const UnresolvedSetImplgetVisibleConversionFunctions ()
bool isAggregate () const
bool isPOD () const
bool isCLike () const
 True if this class is C-like, without C++-specific features, e.g. it contains only public fields, no bases, tag kind is not 'class', etc.
bool isEmpty () const
bool isPolymorphic () const
bool isAbstract () const
bool isStandardLayout () const
bool hasMutableFields () const
 Whether this class, or any of its class subobjects, contains a mutable field.
bool hasTrivialDefaultConstructor () const
bool hasConstexprNonCopyMoveConstructor () const
bool defaultedDefaultConstructorIsConstexpr () const
bool defaultedCopyConstructorIsConstexpr () const
bool defaultedMoveConstructorIsConstexpr () const
bool hasConstexprDefaultConstructor () const
bool hasConstexprCopyConstructor () const
bool hasConstexprMoveConstructor () const
bool hasTrivialCopyConstructor () const
bool hasTrivialMoveConstructor () const
bool hasTrivialCopyAssignment () const
bool hasTrivialMoveAssignment () const
bool hasTrivialDestructor () const
bool hasNonLiteralTypeFieldsOrBases () const
bool isTriviallyCopyable () const
bool isTrivial () const
bool isLiteral () const
CXXRecordDeclgetInstantiatedFromMemberClass () const
 If this record is an instantiation of a member class, retrieves the member class from which it was instantiated.
MemberSpecializationInfogetMemberSpecializationInfo () const
 If this class is an instantiation of a member class of a class template specialization, retrieves the member specialization information.
void setInstantiationOfMemberClass (CXXRecordDecl *RD, TemplateSpecializationKind TSK)
 Specify that this record is an instantiation of the member class RD.
ClassTemplateDeclgetDescribedClassTemplate () const
 Retrieves the class template that is described by this class declaration.
void setDescribedClassTemplate (ClassTemplateDecl *Template)
TemplateSpecializationKind getTemplateSpecializationKind () const
 Determine whether this particular class is a specialization or instantiation of a class template or member class of a class template, and how it was instantiated or specialized.
void setTemplateSpecializationKind (TemplateSpecializationKind TSK)
 Set the kind of specialization or template instantiation this is.
CXXDestructorDeclgetDestructor () const
 getDestructor - Returns the destructor decl for this class.
const FunctionDeclisLocalClass () const
bool isDerivedFrom (const CXXRecordDecl *Base) const
 Determine whether this class is derived from the class Base.
bool isDerivedFrom (const CXXRecordDecl *Base, CXXBasePaths &Paths) const
 Determine whether this class is derived from the type Base.
bool isVirtuallyDerivedFrom (CXXRecordDecl *Base) const
 Determine whether this class is virtually derived from the class Base.
bool isProvablyNotDerivedFrom (const CXXRecordDecl *Base) const
 Determine whether this class is provably not derived from the type Base.
bool forallBases (ForallBasesCallback *BaseMatches, void *UserData, bool AllowShortCircuit=true) const
 Determines if the given callback holds for all the direct or indirect base classes of this type.
bool lookupInBases (BaseMatchesCallback *BaseMatches, void *UserData, CXXBasePaths &Paths) const
 Look for entities within the base classes of this C++ class, transitively searching all base class subobjects.
void getFinalOverriders (CXXFinalOverriderMap &FinaOverriders) const
 Retrieve the final overriders for each virtual member function in the class hierarchy where this class is the most-derived class in the class hierarchy.
void getIndirectPrimaryBases (CXXIndirectPrimaryBaseSet &Bases) const
 Get the indirect primary bases for this class.
void viewInheritance (ASTContext &Context) const
virtual void completeDefinition ()
 Indicates that the definition of this class is now complete.
void completeDefinition (CXXFinalOverriderMap *FinalOverriders)
 Indicates that the definition of this class is now complete, and provides a final overrider map to help determine.
bool mayBeAbstract () const
 Determine whether this class may end up being abstract, even though it is not yet known to be abstract.

Static Public Member Functions

static CXXRecordDeclCreate (const ASTContext &C, TagKind TK, DeclContext *DC, SourceLocation StartLoc, SourceLocation IdLoc, IdentifierInfo *Id, CXXRecordDecl *PrevDecl=0, bool DelayTypeCreation=false)
static CXXRecordDeclCreateDeserialized (const ASTContext &C, unsigned ID)
static bool FindBaseClass (const CXXBaseSpecifier *Specifier, CXXBasePath &Path, void *BaseRecord)
 Base-class lookup callback that determines whether the given base class specifier refers to a specific class declaration.
static bool FindVirtualBaseClass (const CXXBaseSpecifier *Specifier, CXXBasePath &Path, void *BaseRecord)
 Base-class lookup callback that determines whether the given base class specifier refers to a specific class declaration and describes virtual derivation.
static bool FindTagMember (const CXXBaseSpecifier *Specifier, CXXBasePath &Path, void *Name)
 Base-class lookup callback that determines whether there exists a tag with the given name.
static bool FindOrdinaryMember (const CXXBaseSpecifier *Specifier, CXXBasePath &Path, void *Name)
 Base-class lookup callback that determines whether there exists a member with the given name.
static bool FindNestedNameSpecifierMember (const CXXBaseSpecifier *Specifier, CXXBasePath &Path, void *UserData)
 Base-class lookup callback that determines whether there exists a member with the given name that can be used in a nested-name-specifier.
static AccessSpecifier MergeAccess (AccessSpecifier PathAccess, AccessSpecifier DeclAccess)
static bool classof (const Decl *D)
static bool classofKind (Kind K)
static bool classof (const CXXRecordDecl *D)
static bool classof (const ClassTemplateSpecializationDecl *D)

Protected Member Functions

 CXXRecordDecl (Kind K, TagKind TK, DeclContext *DC, SourceLocation StartLoc, SourceLocation IdLoc, IdentifierInfo *Id, CXXRecordDecl *PrevDecl)

Friends

class DeclContext
class ASTNodeImporter
class ASTDeclReader
class ASTDeclWriter
class ASTReader
class ASTWriter
void TagDecl::startDefinition ()
void FunctionDecl::setPure (bool)

Detailed Description

CXXRecordDecl - Represents a C++ struct/union/class. FIXME: This class will disappear once we've properly taught RecordDecl to deal with C++-specific things.

Definition at line 265 of file DeclCXX.h.


Member Typedef Documentation

base_class_const_iterator - Iterator that traverses the base classes of a class.

Definition at line 603 of file DeclCXX.h.

base_class_iterator - Iterator that traverses the base classes of a class.

Definition at line 599 of file DeclCXX.h.

typedef bool clang::CXXRecordDecl::BaseMatchesCallback(const CXXBaseSpecifier *Specifier, CXXBasePath &Path, void *UserData)

Function type used by lookupInBases() to determine whether a specific base class subobject matches the lookup criteria.

Parameters:
Specifierthe base-class specifier that describes the inheritance from the base class we are trying to match.
Paththe current path, from the most-derived class down to the base named by the Specifier.
UserDataa single pointer to user-specified data, provided to lookupInBases().
Returns:
true if this base matched the search criteria, false otherwise.

Definition at line 1270 of file DeclCXX.h.

Definition at line 939 of file DeclCXX.h.

Iterator access to constructor members.

Definition at line 721 of file DeclCXX.h.

typedef bool clang::CXXRecordDecl::ForallBasesCallback(const CXXRecordDecl *BaseDefinition, void *UserData)

Function type used by forallBases() as a callback.

Parameters:
Basethe definition of the base class
Returns:
true if this base matched the search criteria

Definition at line 1242 of file DeclCXX.h.

Iterator access to method members. The method iterator visits all method members of the class, including non-instance methods, special methods, etc.

Definition at line 708 of file DeclCXX.h.

reverse_base_class_iterator = Iterator that traverses the base classes of a class in reverse order.

Definition at line 613 of file DeclCXX.h.

reverse_base_class_iterator = Iterator that traverses the base classes of a class in reverse order.

Definition at line 608 of file DeclCXX.h.


Constructor & Destructor Documentation

CXXRecordDecl::CXXRecordDecl ( Kind  K,
TagKind  TK,
DeclContext DC,
SourceLocation  StartLoc,
SourceLocation  IdLoc,
IdentifierInfo Id,
CXXRecordDecl PrevDecl 
) [protected]

Definition at line 65 of file DeclCXX.cpp.

Referenced by Create(), and CreateDeserialized().


Member Function Documentation

base_class_iterator clang::CXXRecordDecl::bases_begin ( ) [inline]

Definition at line 660 of file DeclCXX.h.

References data().

Referenced by addAssociatedClassesAndNamespaces(), AddIndirectPrimaryBases(), bases_end(), bases_rend(), CanUseSingleInheritance(), clang::Sema::CheckInheritedConstructorUsingDecl(), clang::Sema::CodeCompleteConstructorInitializer(), CollectVisibleConversions(), clang::Sema::ComputeDefaultedCopyAssignmentExceptionSpecAndConst(), clang::Sema::ComputeDefaultedCopyCtorExceptionSpecAndConst(), clang::Sema::ComputeDefaultedDefaultCtorExceptionSpec(), clang::Sema::ComputeDefaultedDtorExceptionSpec(), clang::Sema::ComputeDefaultedMoveAssignmentExceptionSpec(), clang::Sema::ComputeDefaultedMoveCtorExceptionSpec(), ComputeVMIClassTypeInfoFlags(), clang::Sema::DeclareInheritedConstructors(), DeduceTemplateArgumentsByTypeMatch(), clang::Sema::DefineImplicitCopyAssignment(), clang::Sema::DefineImplicitMoveAssignment(), DiagnoseBaseOrMemInitializerOrder(), clang::Sema::DiagnoseNontrivial(), DumpCXXRecordLayout(), EmitNullConstant(), clang::CodeGen::CodeGenFunction::EnterDtorCleanups(), FillInNullDataMemberPointers(), FindBaseInitializer(), forallBases(), getBaseIndex(), getIndirectPrimaryBases(), getVisibleConversionFunctions(), HandleConstructorCall(), HasTrivialDestructorBody(), clang::ASTNodeImporter::ImportDefinition(), clang::CodeGen::CodeGenFunction::InitializeVTablePointers(), IsDerivedFromInclusive(), clang::Sema::isMicrosoftMissingTypename(), IsPartOfAST(), IsProvablyNotDerivedFrom(), clang::Sema::MarkBaseAndMemberDestructorsReferenced(), clang::Sema::MarkVirtualMembersReferenced(), mayBeAbstract(), clang::APValue::printPretty(), clang::Sema::RequireLiteralType(), clang::Sema::SetCtorInitializers(), clang::Sema::ShouldDeleteCopyAssignmentOperator(), clang::Sema::ShouldDeleteDestructor(), clang::Sema::ShouldDeleteMoveAssignmentOperator(), clang::Sema::SubstBaseSpecifiers(), and clang::InheritanceHierarchyWriter::WriteNode().

base_class_const_iterator clang::CXXRecordDecl::bases_begin ( ) const [inline]

Definition at line 661 of file DeclCXX.h.

References data().

base_class_iterator clang::CXXRecordDecl::bases_end ( ) [inline]

Definition at line 662 of file DeclCXX.h.

References bases_begin(), and data().

Referenced by addAssociatedClassesAndNamespaces(), AddIndirectPrimaryBases(), bases_rbegin(), clang::Sema::CheckInheritedConstructorUsingDecl(), clang::Sema::CodeCompleteConstructorInitializer(), CollectVisibleConversions(), clang::Sema::ComputeDefaultedCopyAssignmentExceptionSpecAndConst(), clang::Sema::ComputeDefaultedCopyCtorExceptionSpecAndConst(), clang::Sema::ComputeDefaultedDefaultCtorExceptionSpec(), clang::Sema::ComputeDefaultedDtorExceptionSpec(), clang::Sema::ComputeDefaultedMoveAssignmentExceptionSpec(), clang::Sema::ComputeDefaultedMoveCtorExceptionSpec(), ComputeVMIClassTypeInfoFlags(), clang::Sema::DeclareInheritedConstructors(), DeduceTemplateArgumentsByTypeMatch(), clang::Sema::DefineImplicitCopyAssignment(), clang::Sema::DefineImplicitMoveAssignment(), DiagnoseBaseOrMemInitializerOrder(), clang::Sema::DiagnoseNontrivial(), DumpCXXRecordLayout(), EmitNullConstant(), clang::CodeGen::CodeGenFunction::EnterDtorCleanups(), FillInNullDataMemberPointers(), FindBaseInitializer(), forallBases(), getBaseIndex(), getIndirectPrimaryBases(), getVisibleConversionFunctions(), HasTrivialDestructorBody(), clang::ASTNodeImporter::ImportDefinition(), clang::CodeGen::CodeGenFunction::InitializeVTablePointers(), IsDerivedFromInclusive(), clang::Sema::isMicrosoftMissingTypename(), IsPartOfAST(), IsProvablyNotDerivedFrom(), clang::Sema::MarkBaseAndMemberDestructorsReferenced(), clang::Sema::MarkVirtualMembersReferenced(), mayBeAbstract(), clang::APValue::printPretty(), clang::Sema::RequireLiteralType(), clang::Sema::SetCtorInitializers(), clang::Sema::ShouldDeleteCopyAssignmentOperator(), clang::Sema::ShouldDeleteDestructor(), clang::Sema::ShouldDeleteMoveAssignmentOperator(), clang::Sema::SubstBaseSpecifiers(), and clang::InheritanceHierarchyWriter::WriteNode().

base_class_const_iterator clang::CXXRecordDecl::bases_end ( ) const [inline]

Definition at line 663 of file DeclCXX.h.

References bases_begin(), and data().

reverse_base_class_iterator clang::CXXRecordDecl::bases_rbegin ( ) [inline]

Definition at line 666 of file DeclCXX.h.

References bases_end().

reverse_base_class_const_iterator clang::CXXRecordDecl::bases_rbegin ( ) const [inline]

Definition at line 669 of file DeclCXX.h.

References bases_end().

reverse_base_class_iterator clang::CXXRecordDecl::bases_rend ( ) [inline]

Definition at line 672 of file DeclCXX.h.

References bases_begin().

reverse_base_class_const_iterator clang::CXXRecordDecl::bases_rend ( ) const [inline]

Definition at line 675 of file DeclCXX.h.

References bases_begin().

static bool clang::CXXRecordDecl::classof ( const Decl D) [inline, static]
static bool clang::CXXRecordDecl::classof ( const CXXRecordDecl D) [inline, static]

Definition at line 1394 of file DeclCXX.h.

static bool clang::CXXRecordDecl::classof ( const ClassTemplateSpecializationDecl D) [inline, static]

Reimplemented in clang::ClassTemplateSpecializationDecl.

Definition at line 1395 of file DeclCXX.h.

static bool clang::CXXRecordDecl::classofKind ( Kind  K) [inline, static]
void CXXRecordDecl::completeDefinition ( ) [virtual]

Indicates that the definition of this class is now complete.

Reimplemented from clang::RecordDecl.

Definition at line 1207 of file DeclCXX.cpp.

Referenced by completeDefinition().

void CXXRecordDecl::completeDefinition ( CXXFinalOverriderMap FinalOverriders)

Indicates that the definition of this class is now complete, and provides a final overrider map to help determine.

Parameters:
FinalOverridersThe final overrider map for this class, which can be provided as an optimization for abstract-class checking. If NULL, final overriders will be computed if they are needed to complete the definition.

Definition at line 1211 of file DeclCXX.cpp.

References completeDefinition(), data(), clang::Decl::getASTContext(), getFinalOverriders(), clang::RecordDecl::hasObjectMember(), and mayBeAbstract().

conversion_iterator clang::CXXRecordDecl::conversion_begin ( ) const [inline]

Definition at line 940 of file DeclCXX.h.

References clang::UnresolvedSetImpl::begin(), and getConversionFunctions().

conversion_iterator clang::CXXRecordDecl::conversion_end ( ) const [inline]

Definition at line 943 of file DeclCXX.h.

References clang::UnresolvedSetImpl::end(), and getConversionFunctions().

CXXRecordDecl * CXXRecordDecl::Create ( const ASTContext C,
TagKind  TK,
DeclContext DC,
SourceLocation  StartLoc,
SourceLocation  IdLoc,
IdentifierInfo Id,
CXXRecordDecl PrevDecl = 0,
bool  DelayTypeCreation = false 
) [static]
CXXRecordDecl * CXXRecordDecl::CreateDeserialized ( const ASTContext C,
unsigned  ID 
) [static]

Reimplemented from clang::RecordDecl.

Definition at line 87 of file DeclCXX.cpp.

References clang::Decl::AllocateDeserializedDecl(), CXXRecordDecl(), and clang::TTK_Struct.

ctor_iterator clang::CXXRecordDecl::ctor_begin ( ) const [inline]
ctor_iterator clang::CXXRecordDecl::ctor_end ( ) const [inline]
bool clang::CXXRecordDecl::defaultedCopyConstructorIsConstexpr ( ) const [inline]

defaultedCopyConstructorIsConstexpr - Whether a defaulted copy constructor for this class would be constexpr.

Definition at line 1018 of file DeclCXX.h.

References data().

Referenced by clang::Sema::CheckExplicitlyDefaultedCopyConstructor(), and clang::Sema::DeclareImplicitCopyConstructor().

bool clang::CXXRecordDecl::defaultedDefaultConstructorIsConstexpr ( ) const [inline]

defaultedDefaultConstructorIsConstexpr - Whether a defaulted default constructor for this class would be constexpr.

Definition at line 1012 of file DeclCXX.h.

References data().

Referenced by clang::Sema::CheckExplicitlyDefaultedDefaultConstructor(), clang::Sema::DeclareImplicitDefaultConstructor(), and hasConstexprNonCopyMoveConstructor().

bool clang::CXXRecordDecl::defaultedMoveConstructorIsConstexpr ( ) const [inline]

defaultedMoveConstructorIsConstexpr - Whether a defaulted move constructor for this class would be constexpr.

Definition at line 1024 of file DeclCXX.h.

References data().

Referenced by clang::Sema::CheckExplicitlyDefaultedMoveConstructor(), and clang::Sema::DeclareImplicitMoveConstructor().

bool CXXRecordDecl::FindBaseClass ( const CXXBaseSpecifier Specifier,
CXXBasePath Path,
void *  BaseRecord 
) [static]

Base-class lookup callback that determines whether the given base class specifier refers to a specific class declaration.

This callback can be used with lookupInBases() to determine whether a given derived class has is a base class subobject of a particular type. The user data pointer should refer to the canonical CXXRecordDecl of the base class that we are searching for.

Definition at line 355 of file CXXInheritance.cpp.

References getCanonicalDecl(), and clang::CXXBaseSpecifier::getType().

Referenced by isDerivedFrom().

bool CXXRecordDecl::FindNestedNameSpecifierMember ( const CXXBaseSpecifier Specifier,
CXXBasePath Path,
void *  UserData 
) [static]

Base-class lookup callback that determines whether there exists a member with the given name that can be used in a nested-name-specifier.

This callback can be used with lookupInBases() to find membes of the given name within a C++ class hierarchy that can occur within nested-name-specifiers.

Definition at line 408 of file CXXInheritance.cpp.

References clang::CXXBasePath::Decls, clang::DeclarationName::getFromOpaquePtr(), clang::CXXBaseSpecifier::getType(), clang::Decl::IDNS_Tag, clang::Decl::isInIdentifierNamespace(), and clang::DeclContext::lookup().

Referenced by clang::Sema::LookupQualifiedName().

bool CXXRecordDecl::FindOrdinaryMember ( const CXXBaseSpecifier Specifier,
CXXBasePath Path,
void *  Name 
) [static]

Base-class lookup callback that determines whether there exists a member with the given name.

This callback can be used with lookupInBases() to find members of the given name within a C++ class hierarchy. The user data pointer is an opaque DeclarationName pointer.

Definition at line 390 of file CXXInheritance.cpp.

References clang::CXXBasePath::Decls, clang::DeclarationName::getFromOpaquePtr(), clang::CXXBaseSpecifier::getType(), clang::Decl::IDNS_Member, clang::Decl::IDNS_Ordinary, clang::Decl::IDNS_Tag, and clang::DeclContext::lookup().

Referenced by clang::Sema::LookupQualifiedName().

bool CXXRecordDecl::FindTagMember ( const CXXBaseSpecifier Specifier,
CXXBasePath Path,
void *  Name 
) [static]

Base-class lookup callback that determines whether there exists a tag with the given name.

This callback can be used with lookupInBases() to find tag members of the given name within a C++ class hierarchy. The user data pointer is an opaque DeclarationName pointer.

Definition at line 374 of file CXXInheritance.cpp.

References clang::CXXBasePath::Decls, clang::DeclarationName::getFromOpaquePtr(), clang::CXXBaseSpecifier::getType(), clang::Decl::IDNS_Tag, and clang::DeclContext::lookup().

Referenced by clang::Sema::LookupQualifiedName().

bool CXXRecordDecl::FindVirtualBaseClass ( const CXXBaseSpecifier Specifier,
CXXBasePath Path,
void *  BaseRecord 
) [static]

Base-class lookup callback that determines whether the given base class specifier refers to a specific class declaration and describes virtual derivation.

This callback can be used with lookupInBases() to determine whether a given derived class has is a virtual base class subobject of a particular type. The user data pointer should refer to the canonical CXXRecordDecl of the base class that we are searching for.

Definition at line 364 of file CXXInheritance.cpp.

References getCanonicalDecl(), clang::CXXBaseSpecifier::getType(), and clang::CXXBaseSpecifier::isVirtual().

Referenced by isVirtuallyDerivedFrom().

bool CXXRecordDecl::forallBases ( ForallBasesCallback BaseMatches,
void *  UserData,
bool  AllowShortCircuit = true 
) const

Determines if the given callback holds for all the direct or indirect base classes of this type.

The class itself does not count as a base class. This routine returns false if the class has non-computable base classes.

Parameters:
AllowShortCircuitif false, forces the callback to be called for every base class, even if a dependent or non-matching base was found.

Definition at line 119 of file CXXInheritance.cpp.

References bases_begin(), bases_end(), clang::Type::getAs(), clang::RecordType::getDecl(), and clang::RecordDecl::getDefinition().

Referenced by clang::Sema::CheckUsingDeclQualifier(), hasAnyDependentBases(), and isProvablyNotDerivedFrom().

CXXRecordDecl::friend_iterator clang::CXXRecordDecl::friend_begin ( ) const [inline]

Definition at line 181 of file DeclFriend.h.

References data().

Referenced by GetFriendKind().

CXXRecordDecl::friend_iterator clang::CXXRecordDecl::friend_end ( ) const [inline]

Definition at line 185 of file DeclFriend.h.

Referenced by GetFriendKind().

virtual CXXRecordDecl* clang::CXXRecordDecl::getCanonicalDecl ( ) [inline, virtual]
virtual const CXXRecordDecl* clang::CXXRecordDecl::getCanonicalDecl ( ) const [inline, virtual]

Reimplemented from clang::TagDecl.

Definition at line 618 of file DeclCXX.h.

References getCanonicalDecl().

UnresolvedSetImpl* clang::CXXRecordDecl::getConversionFunctions ( ) [inline]

getConversions - Retrieve the overload set containing all of the conversion functions in this class.

Definition at line 932 of file DeclCXX.h.

References data().

Referenced by CollectVisibleConversions(), conversion_begin(), conversion_end(), LookupDirect(), and removeConversion().

const UnresolvedSetImpl* clang::CXXRecordDecl::getConversionFunctions ( ) const [inline]

Definition at line 935 of file DeclCXX.h.

References data().

CXXMethodDecl * CXXRecordDecl::getCopyAssignmentOperator ( bool  ArgIsConst) const

Retrieve the copy-assignment operator for this class, if available.

This routine attempts to find the copy-assignment operator for this class, using a simplistic form of overload resolution.

Parameters:
ArgIsConstWhether the argument to the copy-assignment operator is const-qualified.
Returns:
The copy-assignment operator that can be invoked, or NULL if a unique copy-assignment operator could not be found.

Definition at line 395 of file DeclCXX.cpp.

References clang::Qualifiers::Const, clang::ASTContext::DeclarationNames, clang::Qualifiers::fromCVRMask(), clang::FunctionProtoType::getArgType(), clang::Decl::getASTContext(), GetBestOverloadCandidateSimple(), clang::DeclarationNameTable::getCXXOperatorName(), clang::FunctionProtoType::getNumArgs(), clang::FunctionDecl::getPrimaryTemplate(), clang::QualType::getQualifiers(), clang::ValueDecl::getType(), clang::ASTContext::getTypeDeclType(), clang::ASTContext::hasSameUnqualifiedType(), clang::QualType::isConstQualified(), clang::CXXMethodDecl::isStatic(), clang::FunctionType::isVariadic(), and clang::DeclContext::lookup().

CXXConstructorDecl * CXXRecordDecl::getCopyConstructor ( unsigned  TypeQuals) const
CXXRecordDecl* clang::CXXRecordDecl::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::RecordDecl.

Definition at line 636 of file DeclCXX.h.

References data().

Referenced by clang::Sema::ActOnClassTemplateSpecialization(), clang::Sema::ActOnExplicitInstantiation(), CanDeclareSpecialMemberFunction(), clang::Sema::CheckFieldDecl(), clang::Sema::CheckNontrivialField(), CreateNewFunctionDecl(), clang::ASTContext::getKeyFunction(), clang::Sema::InstantiateClass(), clang::Sema::InstantiateClassMembers(), isDynamicClassType(), IsProvablyNotDerivedFrom(), clang::Sema::LookupQualifiedName(), clang::Sema::RequireNonAbstractType(), clang::Sema::SetCtorInitializers(), clang::ASTNodeImporter::VisitClassTemplateDecl(), and clang::ASTNodeImporter::VisitClassTemplateSpecializationDecl().

ClassTemplateDecl* clang::CXXRecordDecl::getDescribedClassTemplate ( ) const [inline]

Retrieves the class template that is described by this class declaration.

Every class template is represented as a ClassTemplateDecl and a CXXRecordDecl. The former contains template properties (such as the template parameter lists) while the latter contains the actual description of the template's contents. ClassTemplateDecl::getTemplatedDecl() retrieves the CXXRecordDecl that from a ClassTemplateDecl, while getDescribedClassTemplate() retrieves the ClassTemplateDecl from a CXXRecordDecl.

Definition at line 1160 of file DeclCXX.h.

Referenced by clang::Sema::ActOnStartCXXMemberDeclarations(), clang::Sema::CheckTemplateIdType(), MatchesFriend(), clang::Sema::MergeCXXFunctionDecl(), NeedsInjectedClassNameType(), clang::ASTNodeImporter::VisitClassTemplateDecl(), and clang::ASTDeclWriter::VisitCXXRecordDecl().

CXXDestructorDecl * CXXRecordDecl::getDestructor ( ) const
void CXXRecordDecl::getFinalOverriders ( CXXFinalOverriderMap FinaOverriders) const

Retrieve the final overriders for each virtual member function in the class hierarchy where this class is the most-derived class in the class hierarchy.

Definition at line 611 of file CXXInheritance.cpp.

References clang::Decl::Hidden.

Referenced by completeDefinition(), and clang::Sema::DiagnoseAbstractType().

void CXXRecordDecl::getIndirectPrimaryBases ( CXXIndirectPrimaryBaseSet Bases) const

Get the indirect primary bases for this class.

Definition at line 695 of file CXXInheritance.cpp.

References AddIndirectPrimaryBases(), bases_begin(), bases_end(), clang::Decl::getASTContext(), and getNumVBases().

CXXRecordDecl * CXXRecordDecl::getInstantiatedFromMemberClass ( ) const

If this record is an instantiation of a member class, retrieves the member class from which it was instantiated.

This routine will return non-NULL for (non-templated) member classes of class templates. For example, given:

 template<typename T>
 struct X {
   struct A { };
 };

The declaration for X<int>::A is a (non-templated) CXXRecordDecl whose parent is the class template specialization X<int>. For this declaration, getInstantiatedFromMemberClass() will return the CXXRecordDecl X<T>::A. When a complete definition of X<int>::A is required, it will be instantiated from the declaration returned by getInstantiatedFromMemberClass().

Definition at line 1142 of file DeclCXX.cpp.

References getMemberSpecializationInfo().

Referenced by clang::Sema::ActOnExplicitInstantiation(), clang::Sema::CheckMemberSpecialization(), clang::Sema::InstantiateClass(), clang::Sema::InstantiateClassMembers(), isInstantiationOf(), and clang::Sema::RequireCompleteType().

MemberSpecializationInfo * CXXRecordDecl::getMemberSpecializationInfo ( ) const

If this class is an instantiation of a member class of a class template specialization, retrieves the member specialization information.

Definition at line 1149 of file DeclCXX.cpp.

Referenced by clang::Sema::ActOnExplicitInstantiation(), clang::Sema::CheckMemberSpecialization(), getInstantiatedFromMemberClass(), getTemplateSpecializationKind(), clang::Sema::InstantiateClass(), setTemplateSpecializationKind(), and clang::ASTDeclWriter::VisitCXXRecordDecl().

const CXXRecordDecl* clang::CXXRecordDecl::getMostRecentDecl ( ) const [inline]

Returns the most recent (re)declaration of this declaration.

Reimplemented from clang::RecordDecl.

Definition at line 629 of file DeclCXX.h.

Referenced by getMostRecentDecl().

CXXRecordDecl* clang::CXXRecordDecl::getMostRecentDecl ( ) [inline]

Returns the most recent (re)declaration of this declaration.

Reimplemented from clang::RecordDecl.

Reimplemented in clang::ClassTemplatePartialSpecializationDecl, and clang::ClassTemplateSpecializationDecl.

Definition at line 632 of file DeclCXX.h.

References getMostRecentDecl().

CXXMethodDecl * CXXRecordDecl::getMoveAssignmentOperator ( ) const

getMoveAssignmentOperator - Returns the move assignment operator for this class

Definition at line 445 of file DeclCXX.cpp.

References method_begin(), and method_end().

Referenced by clang::Sema::DiagnoseNontrivial().

CXXConstructorDecl * CXXRecordDecl::getMoveConstructor ( ) const

getMoveConstructor - Returns the move constructor for this class

Definition at line 387 of file DeclCXX.cpp.

References ctor_begin(), and ctor_end().

Referenced by clang::Sema::DiagnoseNontrivial().

unsigned clang::CXXRecordDecl::getNumBases ( ) const [inline]

getNumBases - Retrieves the number of base classes of this class.

Definition at line 658 of file DeclCXX.h.

References data().

Referenced by CanUseSingleInheritance(), clang::Sema::CheckConstexprFunctionBody(), and HandleConstructorCall().

unsigned clang::CXXRecordDecl::getNumVBases ( ) const [inline]
const CXXRecordDecl* clang::CXXRecordDecl::getPreviousDecl ( ) const [inline]
CXXRecordDecl* clang::CXXRecordDecl::getPreviousDecl ( ) [inline]

Return the previous declaration of this declaration or NULL if this is the first declaration.

Reimplemented from clang::RecordDecl.

Definition at line 625 of file DeclCXX.h.

References getPreviousDecl().

TemplateSpecializationKind CXXRecordDecl::getTemplateSpecializationKind ( ) const
const UnresolvedSetImpl * CXXRecordDecl::getVisibleConversionFunctions ( )

getVisibleConversionFunctions - get all conversion functions visible in current class; including conversion function templates.

Definition at line 1105 of file DeclCXX.cpp.

References bases_begin(), bases_end(), CollectVisibleConversions(), data(), and clang::Decl::getASTContext().

Referenced by clang::Sema::ActOnCXXDelete(), clang::BuiltinCandidateTypeSet::AddTypesConvertedFrom(), clang::CollectVRQualifiers(), TryRefInitWithConversionFunction(), and TryUserDefinedConversion().

bool CXXRecordDecl::hasAnyDependentBases ( ) const

Determine whether this class has any dependent base classes.

Definition at line 305 of file DeclCXX.cpp.

References forallBases(), clang::DeclContext::isDependentContext(), and SawBase().

Referenced by clang::Sema::BuildBaseInitializer(), and clang::Sema::LookupQualifiedName().

bool CXXRecordDecl::hasConstCopyConstructor ( ) const

hasConstCopyConstructor - Determines whether this class has a copy constructor that accepts a const-qualified argument.

Definition at line 312 of file DeclCXX.cpp.

References clang::Qualifiers::Const, and getCopyConstructor().

Referenced by clang::ASTContext::BlockRequiresCopying().

bool clang::CXXRecordDecl::hasConstexprCopyConstructor ( ) const [inline]

hasConstexprCopyConstructor - Whether this class has a constexpr copy constructor.

Definition at line 1038 of file DeclCXX.h.

References data(), and isLiteral().

Referenced by setBases().

bool clang::CXXRecordDecl::hasConstexprDefaultConstructor ( ) const [inline]

hasConstexprDefaultConstructor - Whether this class has a constexpr default constructor.

Definition at line 1030 of file DeclCXX.h.

References data(), and isLiteral().

Referenced by setBases().

bool clang::CXXRecordDecl::hasConstexprMoveConstructor ( ) const [inline]

hasConstexprMoveConstructor - Whether this class has a constexpr move constructor.

Definition at line 1046 of file DeclCXX.h.

References data(), isLiteral(), and needsImplicitMoveConstructor().

Referenced by setBases().

bool clang::CXXRecordDecl::hasConstexprNonCopyMoveConstructor ( ) const [inline]

hasConstexprNonCopyMoveConstructor - Whether this class has at least one constexpr constructor other than the copy or move constructors.

Definition at line 1004 of file DeclCXX.h.

References data(), defaultedDefaultConstructorIsConstexpr(), and hasUserDeclaredConstructor().

Referenced by isLiteral(), and clang::Sema::RequireLiteralType().

bool clang::CXXRecordDecl::hasDeclaredCopyAssignment ( ) const [inline]

Determine whether this class has had its copy assignment operator declared, either via the user or via an implicit declaration.

This value is used for lazy creation of copy assignment operators.

Definition at line 869 of file DeclCXX.h.

References data().

Referenced by clang::Sema::ForceDeclarationOfImplicitMembers().

bool clang::CXXRecordDecl::hasDeclaredCopyConstructor ( ) const [inline]

Determine whether this class has had its copy constructor declared, either via the user or via an implicit declaration.

This value is used for lazy creation of copy constructors.

Definition at line 807 of file DeclCXX.h.

References data().

Referenced by clang::Sema::ForceDeclarationOfImplicitMembers(), and clang::Sema::LookupConstructors().

bool clang::CXXRecordDecl::hasDeclaredDefaultConstructor ( ) const [inline]

hasDeclaredDefaultConstructor - Whether this class's default constructor has been declared (either explicitly or implicitly).

Definition at line 753 of file DeclCXX.h.

References data().

bool clang::CXXRecordDecl::hasDeclaredDestructor ( ) const [inline]

Determine whether this class has had its destructor declared, either via the user or via an implicit declaration.

This value is used for lazy creation of destructors.

Definition at line 923 of file DeclCXX.h.

References data().

Referenced by clang::Sema::ForceDeclarationOfImplicitMembers().

bool clang::CXXRecordDecl::hasDeclaredMoveAssignment ( ) const [inline]

hasDeclaredMoveAssignment - Whether this class has a declared move assignment operator.

Definition at line 881 of file DeclCXX.h.

References data().

Referenced by needsImplicitMoveAssignment().

bool clang::CXXRecordDecl::hasDeclaredMoveConstructor ( ) const [inline]

Determine whether this class has had a move constructor declared.

Definition at line 827 of file DeclCXX.h.

References data().

Referenced by needsImplicitMoveConstructor(), and setBases().

bool clang::CXXRecordDecl::hasDefinition ( ) const [inline]
bool clang::CXXRecordDecl::hasFailedImplicitMoveAssignment ( ) const [inline]

Determine whether implicit move assignment generation for this class has failed before.

Definition at line 887 of file DeclCXX.h.

References data().

Referenced by needsImplicitMoveAssignment().

bool clang::CXXRecordDecl::hasFailedImplicitMoveConstructor ( ) const [inline]

Determine whether implicit move constructor generation for this class has failed before.

Definition at line 833 of file DeclCXX.h.

References data().

Referenced by needsImplicitMoveConstructor().

bool clang::CXXRecordDecl::hasFriends ( ) const [inline]

Determines whether this record has any friends.

Definition at line 738 of file DeclCXX.h.

References data().

bool clang::CXXRecordDecl::hasMutableFields ( ) const [inline]

Whether this class, or any of its class subobjects, contains a mutable field.

Definition at line 992 of file DeclCXX.h.

References data().

Referenced by isSafeForCXXConstantCapture(), and setBases().

bool clang::CXXRecordDecl::hasNonLiteralTypeFieldsOrBases ( ) const [inline]

Definition at line 1082 of file DeclCXX.h.

References data().

Referenced by isLiteral(), clang::Sema::RequireLiteralType(), and setBases().

bool clang::CXXRecordDecl::hasTrivialCopyAssignment ( ) const [inline]
bool clang::CXXRecordDecl::hasTrivialCopyConstructor ( ) const [inline]
bool clang::CXXRecordDecl::hasTrivialDefaultConstructor ( ) const [inline]

hasTrivialDefaultConstructor - Whether this class has a trivial default constructor (C++11 [class.ctor]p5).

Definition at line 996 of file DeclCXX.h.

References data().

Referenced by clang::Sema::CheckNontrivialField(), clang::Sema::DeclareImplicitDefaultConstructor(), clang::Sema::DiagnoseNontrivial(), EvaluateUnaryTypeTrait(), isTrivial(), PerformConstructorInitialization(), and setBases().

bool clang::CXXRecordDecl::hasTrivialDestructor ( ) const [inline]
bool clang::CXXRecordDecl::hasTrivialMoveAssignment ( ) const [inline]
bool clang::CXXRecordDecl::hasTrivialMoveConstructor ( ) const [inline]
bool clang::CXXRecordDecl::hasUserDeclaredConstructor ( ) const [inline]

hasUserDeclaredConstructor - Whether this class has any user-declared constructors. When true, a default constructor will not be implicitly declared.

Definition at line 786 of file DeclCXX.h.

References data().

Referenced by clang::Sema::AddImplicitlyDeclaredMembersToClass(), CheckAggExprForMemSetUse(), clang::Sema::CheckCompletedCXXClass(), clang::Sema::DeclareImplicitDefaultConstructor(), clang::Sema::DiagnoseNontrivial(), and hasConstexprNonCopyMoveConstructor().

bool clang::CXXRecordDecl::hasUserDeclaredCopyAssignment ( ) const [inline]

hasUserDeclaredCopyAssignment - Whether this class has a user-declared copy assignment operator. When false, a copy assigment operator will be implicitly declared.

Definition at line 861 of file DeclCXX.h.

References data().

Referenced by clang::Sema::AddImplicitlyDeclaredMembersToClass(), clang::Sema::DiagnoseNontrivial(), needsImplicitMoveAssignment(), and needsImplicitMoveConstructor().

bool clang::CXXRecordDecl::hasUserDeclaredCopyConstructor ( ) const [inline]

hasUserDeclaredCopyConstructor - Whether this class has a user-declared copy constructor. When false, a copy constructor will be implicitly declared.

Definition at line 799 of file DeclCXX.h.

References data().

Referenced by clang::Sema::AddImplicitlyDeclaredMembersToClass(), clang::Sema::DiagnoseNontrivial(), needsImplicitMoveAssignment(), and needsImplicitMoveConstructor().

bool clang::CXXRecordDecl::hasUserDeclaredDestructor ( ) const [inline]

hasUserDeclaredDestructor - Whether this class has a user-declared destructor. When false, a destructor will be implicitly declared.

Definition at line 915 of file DeclCXX.h.

References data().

Referenced by clang::Sema::AddImplicitlyDeclaredMembersToClass(), clang::Sema::DiagnoseNontrivial(), needsImplicitMoveAssignment(), and needsImplicitMoveConstructor().

bool clang::CXXRecordDecl::hasUserDeclaredMoveAssignment ( ) const [inline]

Determine whether this class has had a move assignment declared by the user.

Definition at line 875 of file DeclCXX.h.

References data().

Referenced by clang::Sema::DeclareImplicitCopyAssignment(), clang::Sema::DeclareImplicitCopyConstructor(), clang::Sema::DiagnoseNontrivial(), and needsImplicitMoveConstructor().

bool clang::CXXRecordDecl::hasUserDeclaredMoveConstructor ( ) const [inline]

Determine whether this class has had a move constructor declared by the user.

Definition at line 821 of file DeclCXX.h.

References data().

Referenced by clang::Sema::DeclareImplicitCopyAssignment(), clang::Sema::DeclareImplicitCopyConstructor(), clang::Sema::DiagnoseNontrivial(), and needsImplicitMoveAssignment().

bool clang::CXXRecordDecl::hasUserDeclaredMoveOperation ( ) const [inline]

hasUserDeclaredMoveOperation - Whether this class has a user- declared move constructor or assignment operator. When false, a move constructor and assignment operator may be implicitly declared.

Definition at line 814 of file DeclCXX.h.

References data().

bool clang::CXXRecordDecl::hasUserProvidedDefaultConstructor ( ) const [inline]

hasUserProvidedDefaultconstructor - Whether this class has a user-provided default constructor per C++0x.

Definition at line 792 of file DeclCXX.h.

References data().

Referenced by clang::Sema::ActOnFunctionDeclarator(), clang::Sema::getFixItZeroInitializerForType(), and clang::Sema::ShouldDeleteSpecialMember().

bool clang::CXXRecordDecl::isAbstract ( ) const [inline]

isAbstract - Whether this class is abstract (C++ [class.abstract]), which means that the class contains or inherits a pure virtual function.

Definition at line 984 of file DeclCXX.h.

References data().

Referenced by clang::Sema::ActOnCXXDelete(), clang::Sema::CheckCompletedCXXClass(), mayBeAbstract(), and clang::Sema::RequireNonAbstractType().

bool clang::CXXRecordDecl::isAggregate ( ) const [inline]

isAggregate - Whether this class is an aggregate (C++ [dcl.init.aggr]), which is a class with no user-declared constructors, no private or protected non-static data members, no base classes, and no virtual functions (C++ [dcl.init.aggr]p1).

Definition at line 960 of file DeclCXX.h.

References data().

Referenced by clang::Sema::CheckCompletedCXXClass(), clang::Sema::getFixItZeroInitializerForType(), isLiteral(), and clang::Sema::RequireLiteralType().

bool CXXRecordDecl::isCLike ( ) const

True if this class is C-like, without C++-specific features, e.g. it contains only public fields, no bases, tag kind is not 'class', etc.

Definition at line 967 of file DeclCXX.cpp.

References data(), clang::TagDecl::getTagKind(), hasDefinition(), isPOD(), and clang::TTK_Class.

bool CXXRecordDecl::isDerivedFrom ( const CXXRecordDecl Base) const

Determine whether this class is derived from the class Base.

This routine only determines whether this class is derived from Base, but does not account for factors that may make a Derived -> Base class ill-formed, such as private/protected inheritance or multiple, ambiguous base class subobjects.

Parameters:
Basethe base class we are searching for.
Returns:
true if this class is derived from Base, false otherwise.

Definition at line 79 of file CXXInheritance.cpp.

Referenced by FindBestPath(), clang::CXXDynamicCastExpr::isAlwaysNull(), and clang::Sema::IsDerivedFrom().

bool CXXRecordDecl::isDerivedFrom ( const CXXRecordDecl Base,
CXXBasePaths Paths 
) const

Determine whether this class is derived from the type Base.

This routine only determines whether this class is derived from Base, but does not account for factors that may make a Derived -> Base class ill-formed, such as private/protected inheritance or multiple, ambiguous base class subobjects.

Parameters:
Basethe base class we are searching for.
Pathswill contain the paths taken from the current class to the given Base class.
Returns:
true if this class is derived from Base, false otherwise.
Todo:
add a separate paramaeter to configure IsDerivedFrom, rather than tangling input and output in Paths

Definition at line 85 of file CXXInheritance.cpp.

References FindBaseClass(), getCanonicalDecl(), lookupInBases(), and clang::CXXBasePaths::setOrigin().

bool clang::CXXRecordDecl::isDynamicClass ( ) const [inline]
bool clang::CXXRecordDecl::isEmpty ( ) const [inline]

isEmpty - Whether this class is empty (C++0x [meta.unary.prop]), which means it has a virtual function, virtual base, data member (other than 0-width bit-field) or inherits from a non-empty class. Does NOT include a check for union-ness.

Definition at line 976 of file DeclCXX.h.

References data().

Referenced by clang::Sema::ActOnFunctionDeclarator(), CanUseSingleInheritance(), DumpCXXRecordLayout(), clang::CodeGen::CodeGenFunction::EmitAggregateCopy(), EmitNullBaseClassInitialization(), EmitNullConstant(), FillInNullDataMemberPointers(), and setBases().

bool clang::CXXRecordDecl::isLambda ( ) const [inline]

Determine whether this class describes a lambda function object.

Definition at line 926 of file DeclCXX.h.

References data(), and hasDefinition().

bool clang::CXXRecordDecl::isLiteral ( ) const [inline]
const FunctionDecl* clang::CXXRecordDecl::isLocalClass ( ) const [inline]

isLocalClass - If the class is a local class [class.local], returns the enclosing function declaration.

Definition at line 1181 of file DeclCXX.h.

References clang::Decl::getDeclContext().

Referenced by clang::Sema::MarkVTableUsed().

bool clang::CXXRecordDecl::isPOD ( ) const [inline]

isPOD - Whether this class is a POD-type (C++ [class]p4), which is a class that is an aggregate that has no non-static non-POD data members, no reference data members, no user-defined copy assignment operator and no user-defined destructor.

Definition at line 966 of file DeclCXX.h.

References data().

Referenced by clang::Sema::ActOnUninitializedDecl(), GetDiagForGotoScopeDecl(), and isCLike().

bool clang::CXXRecordDecl::isPolymorphic ( ) const [inline]

isPolymorphic - Whether this class is polymorphic (C++ [class.virtual]), which means that the class contains or inherits a virtual function.

Definition at line 980 of file DeclCXX.h.

References data().

Referenced by clang::Sema::ActOnCXXDelete(), clang::Sema::BuildCXXTypeId(), clang::Sema::CheckCompletedCXXClass(), clang::CodeGen::CodeGenFunction::EmitCXXTypeidExpr(), and setBases().

bool CXXRecordDecl::isProvablyNotDerivedFrom ( const CXXRecordDecl Base) const

Determine whether this class is provably not derived from the type Base.

Definition at line 115 of file CXXInheritance.cpp.

References BaseIsNot(), forallBases(), and getCanonicalDecl().

Referenced by ClassifyImplicitMemberAccess().

bool clang::CXXRecordDecl::isStandardLayout ( ) const [inline]

isStandardLayout - Whether this class has standard layout (C++ [class]p7)

Definition at line 988 of file DeclCXX.h.

References data().

Referenced by setBases().

bool clang::CXXRecordDecl::isTrivial ( ) const [inline]

Definition at line 1095 of file DeclCXX.h.

References hasTrivialDefaultConstructor(), and isTriviallyCopyable().

bool CXXRecordDecl::isTriviallyCopyable ( ) const
bool CXXRecordDecl::isVirtuallyDerivedFrom ( CXXRecordDecl Base) const

Determine whether this class is virtually derived from the class Base.

This routine only determines whether this class is virtually derived from Base, but does not account for factors that may make a Derived -> Base class ill-formed, such as private/protected inheritance or multiple, ambiguous base class subobjects.

Parameters:
Basethe base class we are searching for.
Returns:
true if this class is virtually derived from Base, false otherwise.

Definition at line 96 of file CXXInheritance.cpp.

References FindVirtualBaseClass(), getCanonicalDecl(), getNumVBases(), lookupInBases(), and clang::CXXBasePaths::setOrigin().

Referenced by lookupInBases().

bool CXXRecordDecl::lookupInBases ( BaseMatchesCallback BaseMatches,
void *  UserData,
CXXBasePaths Paths 
) const

Look for entities within the base classes of this C++ class, transitively searching all base class subobjects.

This routine uses the callback function BaseMatches to find base classes meeting some search criteria, walking all base class subobjects and populating the given Paths structure with the paths through the inheritance hierarchy that resulted in a match. On a successful search, the Paths structure can be queried to retrieve the matching paths and to determine if there were any ambiguities.

Parameters:
BaseMatchescallback function used to determine whether a given base matches the user-defined search criteria.
UserDatauser data pointer that will be provided to BaseMatches.
Pathsused to record the paths from this class to its base class subobjects that match the search criteria.
Returns:
true if there exists any path from this class to a base class subobject that matches the search criteria.

Definition at line 288 of file CXXInheritance.cpp.

References clang::CXXBasePaths::begin(), clang::CXXBasePaths::end(), clang::Decl::getASTContext(), clang::Decl::Hidden, clang::CXXBasePaths::isFindingAmbiguities(), clang::CXXBasePaths::isRecordingPaths(), isVirtuallyDerivedFrom(), and P.

Referenced by clang::Sema::AddOverriddenMethods(), clang::Sema::DiagnoseHiddenVirtualMethods(), isDerivedFrom(), isVirtuallyDerivedFrom(), and clang::Sema::LookupQualifiedName().

bool CXXRecordDecl::mayBeAbstract ( ) const

Determine whether this class may end up being abstract, even though it is not yet known to be abstract.

Returns:
true if this class is not known to be abstract but has any base classes that are abstract. In this case, completeDefinition() will need to compute final overriders to determine whether the class is actually abstract.

Definition at line 1267 of file DeclCXX.cpp.

References bases_begin(), bases_end(), data(), isAbstract(), clang::DeclContext::isDependentContext(), and clang::Decl::isInvalidDecl().

Referenced by completeDefinition().

static AccessSpecifier clang::CXXRecordDecl::MergeAccess ( AccessSpecifier  PathAccess,
AccessSpecifier  DeclAccess 
) [inline, static]

MergeAccess - Calculates the access of a decl that is reached along a path.

Definition at line 1362 of file DeclCXX.h.

References clang::AS_none, and clang::AS_private.

Referenced by CollectVisibleConversions(), and clang::Sema::LookupQualifiedName().

method_iterator clang::CXXRecordDecl::method_begin ( ) const [inline]

method_begin - Method begin iterator. Iterates in the order the methods were declared.

Definition at line 712 of file DeclCXX.h.

References clang::DeclContext::decls_begin().

Referenced by clang::Sema::CheckCompletedCXXClass(), clang::Sema::CheckExplicitlyDefaultedMethods(), clang::Sema::DiagnoseNontrivial(), getMoveAssignmentOperator(), and clang::Sema::MarkVirtualMembersReferenced().

method_iterator clang::CXXRecordDecl::method_end ( ) const [inline]
bool clang::CXXRecordDecl::needsImplicitDefaultConstructor ( ) const [inline]

Determine if we need to declare a default constructor for this class.

This value is used for lazy creation of default constructors.

Definition at line 746 of file DeclCXX.h.

References data().

Referenced by clang::Sema::ForceDeclarationOfImplicitMembers(), and clang::Sema::LookupConstructors().

bool clang::CXXRecordDecl::needsImplicitMoveAssignment ( ) const [inline]

Determine whether this class should get an implicit move assignment operator or if any existing special member function inhibits this.

Covers all bullets of C++0x [class.copy]p20 except the last, that the constructor wouldn't be deleted.

Definition at line 903 of file DeclCXX.h.

References hasDeclaredMoveAssignment(), hasFailedImplicitMoveAssignment(), hasUserDeclaredCopyAssignment(), hasUserDeclaredCopyConstructor(), hasUserDeclaredDestructor(), and hasUserDeclaredMoveConstructor().

Referenced by clang::Sema::AddImplicitlyDeclaredMembersToClass(), and clang::Sema::ForceDeclarationOfImplicitMembers().

bool clang::CXXRecordDecl::needsImplicitMoveConstructor ( ) const [inline]

Determine whether this class should get an implicit move constructor or if any existing special member function inhibits this.

Covers all bullets of C++0x [class.copy]p9 except the last, that the constructor wouldn't be deleted, which is only looked up from a cached result.

Definition at line 849 of file DeclCXX.h.

References hasDeclaredMoveConstructor(), hasFailedImplicitMoveConstructor(), hasUserDeclaredCopyAssignment(), hasUserDeclaredCopyConstructor(), hasUserDeclaredDestructor(), and hasUserDeclaredMoveAssignment().

Referenced by clang::Sema::AddImplicitlyDeclaredMembersToClass(), clang::Sema::ForceDeclarationOfImplicitMembers(), hasConstexprMoveConstructor(), clang::Sema::LookupConstructors(), and setBases().

void clang::CXXRecordDecl::pushFriendDecl ( FriendDecl FD) [inline]

Definition at line 189 of file DeclFriend.h.

References data().

void CXXRecordDecl::removeConversion ( const NamedDecl Old)

Removes a conversion function from this class. The conversion function must currently be a member of this class. Furthermore, this class must currently be in the process of being defined.

Definition at line 1117 of file DeclCXX.cpp.

References clang::UnresolvedSetImpl::begin(), clang::UnresolvedSetImpl::end(), clang::UnresolvedSetImpl::erase(), getConversionFunctions(), and clang::UnresolvedSetImpl::size().

void CXXRecordDecl::setBases ( CXXBaseSpecifier const *const *  Bases,
unsigned  NumBases 
)
void clang::CXXRecordDecl::setDescribedClassTemplate ( ClassTemplateDecl Template) [inline]
void clang::CXXRecordDecl::setFailedImplicitMoveAssignment ( bool  Failed = true) [inline]

Set whether implicit move assignment generation for this class has failed before.

Definition at line 893 of file DeclCXX.h.

References data().

Referenced by clang::Sema::DeclareImplicitMoveAssignment().

void clang::CXXRecordDecl::setFailedImplicitMoveConstructor ( bool  Failed = true) [inline]

Set whether implicit move constructor generation for this class has failed before.

Definition at line 839 of file DeclCXX.h.

References data().

Referenced by clang::Sema::DeclareImplicitMoveConstructor().

void CXXRecordDecl::setInstantiationOfMemberClass ( CXXRecordDecl RD,
TemplateSpecializationKind  TSK 
)

Specify that this record is an instantiation of the member class RD.

Definition at line 1154 of file DeclCXX.cpp.

References clang::Decl::getASTContext().

Referenced by clang::TemplateDeclInstantiator::VisitCXXRecordDecl().

void clang::CXXRecordDecl::setLambda ( bool  Lambda = true) [inline]

Definition at line 928 of file DeclCXX.h.

References data().

Referenced by clang::Sema::ActOnStartOfLambdaDefinition().

void CXXRecordDecl::setTemplateSpecializationKind ( TemplateSpecializationKind  TSK)

Set the kind of specialization or template instantiation this is.

Definition at line 1175 of file DeclCXX.cpp.

References getMemberSpecializationInfo().

Referenced by clang::Sema::ActOnExplicitInstantiation(), clang::Sema::CheckMemberSpecialization(), and clang::Sema::InstantiateClass().

base_class_iterator clang::CXXRecordDecl::vbases_begin ( ) [inline]
base_class_const_iterator clang::CXXRecordDecl::vbases_begin ( ) const [inline]

Definition at line 684 of file DeclCXX.h.

References data().

base_class_iterator clang::CXXRecordDecl::vbases_end ( ) [inline]
base_class_const_iterator clang::CXXRecordDecl::vbases_end ( ) const [inline]

Definition at line 686 of file DeclCXX.h.

References data(), and vbases_begin().

reverse_base_class_iterator clang::CXXRecordDecl::vbases_rbegin ( ) [inline]

Definition at line 689 of file DeclCXX.h.

References vbases_end().

reverse_base_class_const_iterator clang::CXXRecordDecl::vbases_rbegin ( ) const [inline]

Definition at line 692 of file DeclCXX.h.

References vbases_end().

reverse_base_class_iterator clang::CXXRecordDecl::vbases_rend ( ) [inline]

Definition at line 695 of file DeclCXX.h.

References vbases_begin().

reverse_base_class_const_iterator clang::CXXRecordDecl::vbases_rend ( ) const [inline]

Definition at line 698 of file DeclCXX.h.

References vbases_begin().

void clang::CXXRecordDecl::viewInheritance ( ASTContext Context) const

viewInheritance - Renders and displays an inheritance diagram for this C++ class and all of its base classes (transitively) using GraphViz.

viewInheritance - Display the inheritance hierarchy of this C++ class using GraphViz.

Definition at line 136 of file InheritViz.cpp.

References clang::QualType::getAsString(), clang::ASTContext::getTypeDeclType(), and clang::InheritanceHierarchyWriter::WriteGraph().


Friends And Related Function Documentation

friend class ASTDeclReader [friend]

Reimplemented from clang::TagDecl.

Reimplemented in clang::ClassTemplatePartialSpecializationDecl, and clang::ClassTemplateSpecializationDecl.

Definition at line 1399 of file DeclCXX.h.

friend class ASTDeclWriter [friend]

Reimplemented from clang::TagDecl.

Reimplemented in clang::ClassTemplatePartialSpecializationDecl, and clang::ClassTemplateSpecializationDecl.

Definition at line 1400 of file DeclCXX.h.

friend class ASTNodeImporter [friend]

Definition at line 589 of file DeclCXX.h.

friend class ASTReader [friend]

Reimplemented from clang::TypeDecl.

Definition at line 1401 of file DeclCXX.h.

friend class ASTWriter [friend]

Definition at line 1402 of file DeclCXX.h.

friend class DeclContext [friend]

Reimplemented from clang::RecordDecl.

Definition at line 577 of file DeclCXX.h.

void FunctionDecl::setPure ( bool  ) [friend]
void TagDecl::startDefinition ( ) [friend]

The documentation for this class was generated from the following files: