clang API Documentation

Public Member Functions | Static Public Member Functions
clang::CXXMemberCallExpr Class Reference

#include <ExprCXX.h>

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

List of all members.

Public Member Functions

 CXXMemberCallExpr (ASTContext &C, Expr *fn, ArrayRef< Expr * > args, QualType t, ExprValueKind VK, SourceLocation RP)
 CXXMemberCallExpr (ASTContext &C, EmptyShell Empty)
ExprgetImplicitObjectArgument () const
 Retrieves the implicit object argument for the member call.
CXXMethodDeclgetMethodDecl () const
 Retrieves the declaration of the called method.
CXXRecordDeclgetRecordDecl () const
 Retrieves the CXXRecordDecl for the underlying type of the implicit object argument.

Static Public Member Functions

static bool classof (const Stmt *T)

Detailed Description

Represents a call to a member function that may be written either with member call syntax (e.g., "obj.func()" or "objptr->func()") or with normal function-call syntax ("func()") within a member function that ends up calling a member function. The callee in either case is a MemberExpr that contains both the object argument and the member function, while the arguments are the arguments within the parentheses (not including the object argument).

Definition at line 117 of file ExprCXX.h.


Constructor & Destructor Documentation

clang::CXXMemberCallExpr::CXXMemberCallExpr ( ASTContext C,
Expr fn,
ArrayRef< Expr * >  args,
QualType  t,
ExprValueKind  VK,
SourceLocation  RP 
) [inline]

Definition at line 119 of file ExprCXX.h.

Definition at line 123 of file ExprCXX.h.


Member Function Documentation

static bool clang::CXXMemberCallExpr::classof ( const Stmt T) [inline, static]

Reimplemented from clang::CallExpr.

Definition at line 142 of file ExprCXX.h.

References clang::Stmt::getStmtClass().

Retrieves the implicit object argument for the member call.

For example, in "x.f(5)", this returns the sub-expression "x".

Definition at line 534 of file ExprCXX.cpp.

References clang::BO_PtrMemD, clang::BO_PtrMemI, clang::CallExpr::getCallee(), and clang::Expr::IgnoreParens().

Referenced by getRecordDecl(), and clang::consumed::ConsumedStmtVisitor::VisitCXXMemberCallExpr().

Retrieves the CXXRecordDecl for the underlying type of the implicit object argument.

Note that this is may not be the same declaration as that of the class context of the CXXMethodDecl which this function is calling. FIXME: Returns 0 for member pointer call exprs.

Definition at line 556 of file ExprCXX.cpp.

References clang::Type::getAsCXXRecordDecl(), getImplicitObjectArgument(), clang::Type::getPointeeType(), clang::Expr::getType(), and clang::Type::isAnyPointerType().


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