clang API Documentation

Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions
clang::CXXMethodDecl Class Reference

#include <DeclCXX.h>

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

List of all members.

Public Types

typedef const CXXMethodDecl ** method_iterator

Public Member Functions

bool isStatic () const
bool isInstance () const
bool isVirtual () const
bool isUsualDeallocationFunction () const
 Determine whether this is a usual deallocation function (C++ [basic.stc.dynamic.deallocation]p2), which is an overloaded delete or delete[] operator with a particular signature.
bool isCopyAssignmentOperator () const
 Determine whether this is a copy-assignment operator, regardless of whether it was declared implicitly or explicitly.
bool isMoveAssignmentOperator () const
 Determine whether this is a move assignment operator.
const CXXMethodDeclgetCanonicalDecl () const
CXXMethodDeclgetCanonicalDecl ()
 Retrieves the "canonical" declaration of the given declaration.
bool isUserProvided () const
void addOverriddenMethod (const CXXMethodDecl *MD)
method_iterator begin_overridden_methods () const
method_iterator end_overridden_methods () const
unsigned size_overridden_methods () const
const CXXRecordDeclgetParent () const
CXXRecordDeclgetParent ()
QualType getThisType (ASTContext &C) const
unsigned getTypeQualifiers () const
RefQualifierKind getRefQualifier () const
 Retrieve the ref-qualifier associated with this method.
bool hasInlineBody () const

Static Public Member Functions

static CXXMethodDeclCreate (ASTContext &C, CXXRecordDecl *RD, SourceLocation StartLoc, const DeclarationNameInfo &NameInfo, QualType T, TypeSourceInfo *TInfo, bool isStatic, StorageClass SCAsWritten, bool isInline, bool isConstexpr, SourceLocation EndLocation)
static CXXMethodDeclCreateDeserialized (ASTContext &C, unsigned ID)
static bool classof (const Decl *D)
static bool classof (const CXXMethodDecl *D)
static bool classofKind (Kind K)

Protected Member Functions

 CXXMethodDecl (Kind DK, CXXRecordDecl *RD, SourceLocation StartLoc, const DeclarationNameInfo &NameInfo, QualType T, TypeSourceInfo *TInfo, bool isStatic, StorageClass SCAsWritten, bool isInline, bool isConstexpr, SourceLocation EndLocation)

Detailed Description

CXXMethodDecl - Represents a static or instance method of a struct/union/class.

Definition at line 1407 of file DeclCXX.h.


Member Typedef Documentation

Definition at line 1476 of file DeclCXX.h.


Constructor & Destructor Documentation

clang::CXXMethodDecl::CXXMethodDecl ( Kind  DK,
CXXRecordDecl RD,
SourceLocation  StartLoc,
const DeclarationNameInfo NameInfo,
QualType  T,
TypeSourceInfo TInfo,
bool  isStatic,
StorageClass  SCAsWritten,
bool  isInline,
bool  isConstexpr,
SourceLocation  EndLocation 
) [inline, protected]

Definition at line 1410 of file DeclCXX.h.

References clang::SourceLocation::isValid(), and clang::FunctionDecl::setRangeEnd().

Referenced by Create(), and CreateDeserialized().


Member Function Documentation

void CXXMethodDecl::addOverriddenMethod ( const CXXMethodDecl MD)
CXXMethodDecl::method_iterator CXXMethodDecl::begin_overridden_methods ( ) const
static bool clang::CXXMethodDecl::classof ( const Decl D) [inline, static]

Reimplemented from clang::FunctionDecl.

Reimplemented in clang::CXXConversionDecl, clang::CXXDestructorDecl, and clang::CXXConstructorDecl.

Definition at line 1521 of file DeclCXX.h.

References classofKind(), and clang::Decl::getKind().

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

Definition at line 1522 of file DeclCXX.h.

static bool clang::CXXMethodDecl::classofKind ( Kind  K) [inline, static]

Reimplemented from clang::FunctionDecl.

Reimplemented in clang::CXXConversionDecl, clang::CXXDestructorDecl, and clang::CXXConstructorDecl.

Definition at line 1523 of file DeclCXX.h.

Referenced by classof().

CXXMethodDecl * CXXMethodDecl::Create ( ASTContext C,
CXXRecordDecl RD,
SourceLocation  StartLoc,
const DeclarationNameInfo NameInfo,
QualType  T,
TypeSourceInfo TInfo,
bool  isStatic,
StorageClass  SCAsWritten,
bool  isInline,
bool  isConstexpr,
SourceLocation  EndLocation 
) [static]
CXXMethodDecl * CXXMethodDecl::CreateDeserialized ( ASTContext C,
unsigned  ID 
) [static]
CXXMethodDecl::method_iterator CXXMethodDecl::end_overridden_methods ( ) const
const CXXMethodDecl* clang::CXXMethodDecl::getCanonicalDecl ( ) const [inline, virtual]
CXXMethodDecl* clang::CXXMethodDecl::getCanonicalDecl ( ) [inline, virtual]

Retrieves the "canonical" declaration of the given declaration.

Reimplemented from clang::FunctionDecl.

Reimplemented in clang::CXXConstructorDecl.

Definition at line 1463 of file DeclCXX.h.

References getCanonicalDecl().

const CXXRecordDecl* clang::CXXMethodDecl::getParent ( ) const [inline]

getParent - Returns the parent of this method declaration, which is the class in which this method is defined.

Reimplemented from clang::DeclContext.

Definition at line 1484 of file DeclCXX.h.

Referenced by clang::Sema::ActOnFields(), addOverriddenMethod(), clang::Sema::BuildCallToMemberFunction(), clang::Sema::BuildCXXConstructExpr(), clang::Sema::BuildCXXNew(), BuildImplicitMemberInitializer(), clang::Sema::BuildMemInitializer(), canDevirtualizeMemberFunctionCall(), canDevirtualizeMemberFunctionCalls(), CanSkipVTablePointerInitialization(), clang::Sema::CheckConstructorAccess(), clang::Sema::CheckDestructor(), clang::Sema::CheckDestructorAccess(), clang::Sema::CheckExplicitlyDefaultedCopyAssignment(), clang::Sema::CheckExplicitlyDefaultedCopyConstructor(), clang::Sema::CheckExplicitlyDefaultedDefaultConstructor(), clang::Sema::CheckExplicitlyDefaultedDestructor(), clang::Sema::CheckExplicitlyDefaultedMoveAssignment(), clang::Sema::CheckExplicitlyDefaultedMoveConstructor(), clang::Sema::CheckOverridingFunctionExceptionSpec(), clang::Sema::CheckPureMethod(), clang::Sema::CodeCompleteConstructorInitializer(), clang::Sema::DefineImplicitCopyAssignment(), clang::Sema::DefineImplicitCopyConstructor(), clang::Sema::DefineImplicitDefaultConstructor(), clang::Sema::DefineImplicitDestructor(), clang::Sema::DefineImplicitMoveAssignment(), clang::Sema::DefineImplicitMoveConstructor(), clang::InitializationSequence::Diagnose(), DiagnoseBaseOrMemInitializerOrder(), clang::Sema::DiagnoseEmptyLookup(), clang::CodeGen::CodeGenFunction::EmitCtorPrologue(), clang::CodeGen::CodeGenFunction::EmitCXXAggrConstructorCall(), clang::CodeGen::CodeGenFunction::EmitCXXConstructorCall(), clang::CodeGen::CodeGenFunction::EmitCXXDestructorCall(), clang::CodeGen::CodeGenFunction::EmitDelegatingCXXConstructorCall(), clang::CodeGen::CodeGenFunction::EmitDestructorBody(), clang::CodeGen::CGCXXABI::EmitMemberPointer(), clang::CodeGen::CodeGenFunction::EnterDtorCleanups(), GetDiagForGotoScopeDecl(), clang::CodeGen::CodeGenTypes::getFunctionInfo(), getParent(), getThisType(), clang::VTableContext::getThunkInfo(), HandleConstructorCall(), clang::Sema::InstantiateMemInitializers(), IsConstructorDelegationValid(), isCopyAssignmentOperator(), clang::CXXConstructorDecl::isCopyOrMoveConstructor(), isMoveAssignmentOperator(), clang::Expr::isPotentialConstantExpr(), clang::CXXConstructorDecl::isSpecializationCopyingObject(), clang::IsStandardConversion(), MaybeAddImplicitObjectParameterType(), clang::Sema::MergeCXXFunctionDecl(), clang::CodeGen::CodeGenVTables::needsVTTParameter(), PerformConstructorInitialization(), clang::Sema::PerformMoveOrCopyInitialization(), clang::Sema::PerformObjectArgumentInitialization(), clang::Sema::SetCtorInitializers(), clang::Sema::SetDeclDefaulted(), clang::Sema::SetDelegatingInitializer(), clang::Sema::ShouldDeleteCopyAssignmentOperator(), clang::Sema::ShouldDeleteDestructor(), clang::Sema::ShouldDeleteMoveAssignmentOperator(), clang::Sema::ShouldDeleteSpecialMember(), TryStaticMemberPointerUpcast(), clang::ento::ExprEngine::VisitCXXConstructExpr(), and clang::ento::ExprEngine::VisitCXXDestructor().

CXXRecordDecl* clang::CXXMethodDecl::getParent ( ) [inline]

getParent - Returns the parent of this method declaration, which is the class in which this method is defined.

Reimplemented from clang::DeclContext.

Definition at line 1490 of file DeclCXX.h.

References getParent().

RefQualifierKind clang::CXXMethodDecl::getRefQualifier ( ) const [inline]

Retrieve the ref-qualifier associated with this method.

In the following example, f() has an lvalue ref-qualifier, g() has an rvalue ref-qualifier, and h() has no ref-qualifier.

 struct X {
   void f() &;
   void g() &&;
   void h();
 };

Definition at line 1514 of file DeclCXX.h.

References clang::ValueDecl::getType().

Referenced by clang::Sema::IsOverload(), and clang::TryObjectArgumentInitialization().

QualType CXXMethodDecl::getThisType ( ASTContext C) const
unsigned clang::CXXMethodDecl::getTypeQualifiers ( ) const [inline]
bool CXXMethodDecl::hasInlineBody ( ) const
bool CXXMethodDecl::isCopyAssignmentOperator ( ) const
bool clang::CXXMethodDecl::isInstance ( ) const [inline]
bool CXXMethodDecl::isMoveAssignmentOperator ( ) const
bool clang::CXXMethodDecl::isStatic ( ) const [inline]
bool clang::CXXMethodDecl::isUserProvided ( ) const [inline]

isUserProvided - True if it is either an implicit constructor or if it was defaulted or deleted on first declaration.

Definition at line 1469 of file DeclCXX.h.

References getCanonicalDecl(), clang::FunctionDecl::isDefaulted(), and clang::FunctionDecl::isDeleted().

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

bool CXXMethodDecl::isUsualDeallocationFunction ( ) const
bool clang::CXXMethodDecl::isVirtual ( ) const [inline]
unsigned CXXMethodDecl::size_overridden_methods ( ) const

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