clang API Documentation
#include <ExprCXX.h>
Public Member Functions | |
CXXMemberCallExpr (ASTContext &C, Expr *fn, ArrayRef< Expr * > args, QualType t, ExprValueKind VK, SourceLocation RP) | |
CXXMemberCallExpr (ASTContext &C, EmptyShell Empty) | |
Expr * | getImplicitObjectArgument () const |
Retrieves the implicit object argument for the member call. | |
CXXMethodDecl * | getMethodDecl () const |
Retrieves the declaration of the called method. | |
CXXRecordDecl * | getRecordDecl () const |
Retrieves the CXXRecordDecl for the underlying type of the implicit object argument. | |
Static Public Member Functions | |
static bool | classof (const Stmt *T) |
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).
clang::CXXMemberCallExpr::CXXMemberCallExpr | ( | ASTContext & | C, |
Expr * | fn, | ||
ArrayRef< Expr * > | args, | ||
QualType | t, | ||
ExprValueKind | VK, | ||
SourceLocation | RP | ||
) | [inline] |
clang::CXXMemberCallExpr::CXXMemberCallExpr | ( | ASTContext & | C, |
EmptyShell | Empty | ||
) | [inline] |
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().
Expr * CXXMemberCallExpr::getImplicitObjectArgument | ( | ) | const |
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().
CXXMethodDecl * CXXMemberCallExpr::getMethodDecl | ( | ) | const |
Retrieves the declaration of the called method.
Definition at line 546 of file ExprCXX.cpp.
References clang::CallExpr::getCallee(), and clang::Expr::IgnoreParens().
Referenced by clang::Sema::BuildCallToMemberFunction(), buildSingleCopyAssignRecursively(), and clang::consumed::ConsumedStmtVisitor::VisitCXXMemberCallExpr().
CXXRecordDecl * CXXMemberCallExpr::getRecordDecl | ( | ) | const |
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().