clang API Documentation
#include <Expr.h>
Classes | |
struct | MemberNameQualifier |
Extra data stored in some member expressions. | |
Public Member Functions | |
MemberExpr (Expr *base, bool isarrow, ValueDecl *memberdecl, const DeclarationNameInfo &NameInfo, QualType ty, ExprValueKind VK, ExprObjectKind OK) | |
MemberExpr (Expr *base, bool isarrow, ValueDecl *memberdecl, SourceLocation l, QualType ty, ExprValueKind VK, ExprObjectKind OK) | |
void | setBase (Expr *E) |
Expr * | getBase () const |
ValueDecl * | getMemberDecl () const |
Retrieve the member declaration to which this expression refers. | |
void | setMemberDecl (ValueDecl *D) |
DeclAccessPair | getFoundDecl () const |
Retrieves the declaration found by lookup. | |
bool | hasQualifier () const |
Determines whether this member expression actually had a C++ nested-name-specifier prior to the name of the member, e.g., x->Base::foo. | |
NestedNameSpecifier * | getQualifier () const |
If the member name was qualified, retrieves the nested-name-specifier that precedes the member name. Otherwise, returns NULL. | |
NestedNameSpecifierLoc | getQualifierLoc () const |
If the member name was qualified, retrieves the nested-name-specifier that precedes the member name, with source-location information. | |
ASTTemplateKWAndArgsInfo * | getTemplateKWAndArgsInfo () |
Return the optional template keyword and arguments info. | |
const ASTTemplateKWAndArgsInfo * | getTemplateKWAndArgsInfo () const |
Return the optional template keyword and arguments info. | |
SourceLocation | getTemplateKeywordLoc () const |
Retrieve the location of the template keyword preceding the member name, if any. | |
SourceLocation | getLAngleLoc () const |
Retrieve the location of the left angle bracket starting the explicit template argument list following the member name, if any. | |
SourceLocation | getRAngleLoc () const |
Retrieve the location of the right angle bracket ending the explicit template argument list following the member name, if any. | |
bool | hasTemplateKeyword () const |
Determines whether the member name was preceded by the template keyword. | |
bool | hasExplicitTemplateArgs () const |
Determines whether the member name was followed by an explicit template argument list. | |
void | copyTemplateArgumentsInto (TemplateArgumentListInfo &List) const |
Copies the template arguments (if present) into the given structure. | |
ASTTemplateArgumentListInfo & | getExplicitTemplateArgs () |
Retrieve the explicit template argument list that follow the member template name. This must only be called on an expression with explicit template arguments. | |
const ASTTemplateArgumentListInfo & | getExplicitTemplateArgs () const |
Retrieve the explicit template argument list that followed the member template name. This must only be called on an expression with explicit template arguments. | |
const ASTTemplateArgumentListInfo * | getOptionalExplicitTemplateArgs () const |
Retrieves the optional explicit template arguments. This points to the same data as getExplicitTemplateArgs(), but returns null if there are no explicit template arguments. | |
const TemplateArgumentLoc * | getTemplateArgs () const |
Retrieve the template arguments provided as part of this template-id. | |
unsigned | getNumTemplateArgs () const |
Retrieve the number of template arguments provided as part of this template-id. | |
DeclarationNameInfo | getMemberNameInfo () const |
Retrieve the member declaration name info. | |
bool | isArrow () const |
void | setArrow (bool A) |
SourceLocation | getMemberLoc () const |
void | setMemberLoc (SourceLocation L) |
SourceLocation | getLocStart () const LLVM_READONLY |
SourceLocation | getLocEnd () const LLVM_READONLY |
SourceLocation | getExprLoc () const LLVM_READONLY |
bool | isImplicitAccess () const |
Determine whether the base of this explicit is implicit. | |
bool | hadMultipleCandidates () const |
Returns true if this member expression refers to a method that was resolved from an overloaded set having size greater than 1. | |
void | setHadMultipleCandidates (bool V=true) |
Sets the flag telling whether this expression refers to a method that was resolved from an overloaded set having size greater than 1. | |
child_range | children () |
Static Public Member Functions | |
static MemberExpr * | Create (const ASTContext &C, Expr *base, bool isarrow, NestedNameSpecifierLoc QualifierLoc, SourceLocation TemplateKWLoc, ValueDecl *memberdecl, DeclAccessPair founddecl, DeclarationNameInfo MemberNameInfo, const TemplateArgumentListInfo *targs, QualType ty, ExprValueKind VK, ExprObjectKind OK) |
static bool | classof (const Stmt *T) |
Friends | |
class | ASTReader |
class | ASTStmtWriter |
MemberExpr - [C99 6.5.2.3] Structure and Union Members. X->F and X.F.
clang::MemberExpr::MemberExpr | ( | Expr * | base, |
bool | isarrow, | ||
ValueDecl * | memberdecl, | ||
const DeclarationNameInfo & | NameInfo, | ||
QualType | ty, | ||
ExprValueKind | VK, | ||
ExprObjectKind | OK | ||
) | [inline] |
Definition at line 2366 of file Expr.h.
References clang::NamedDecl::getDeclName(), and clang::DeclarationNameInfo::getName().
clang::MemberExpr::MemberExpr | ( | Expr * | base, |
bool | isarrow, | ||
ValueDecl * | memberdecl, | ||
SourceLocation | l, | ||
QualType | ty, | ||
ExprValueKind | VK, | ||
ExprObjectKind | OK | ||
) | [inline] |
child_range clang::MemberExpr::children | ( | ) | [inline] |
Reimplemented from clang::Stmt.
static bool clang::MemberExpr::classof | ( | const Stmt * | T | ) | [inline, static] |
Reimplemented from clang::Expr.
Definition at line 2577 of file Expr.h.
References clang::Stmt::getStmtClass().
void clang::MemberExpr::copyTemplateArgumentsInto | ( | TemplateArgumentListInfo & | List | ) | const [inline] |
Copies the template arguments (if present) into the given structure.
Definition at line 2495 of file Expr.h.
References clang::ASTTemplateArgumentListInfo::copyInto(), getExplicitTemplateArgs(), and hasExplicitTemplateArgs().
MemberExpr * MemberExpr::Create | ( | const ASTContext & | C, |
Expr * | base, | ||
bool | isarrow, | ||
NestedNameSpecifierLoc | QualifierLoc, | ||
SourceLocation | TemplateKWLoc, | ||
ValueDecl * | memberdecl, | ||
DeclAccessPair | founddecl, | ||
DeclarationNameInfo | MemberNameInfo, | ||
const TemplateArgumentListInfo * | targs, | ||
QualType | ty, | ||
ExprValueKind | VK, | ||
ExprObjectKind | OK | ||
) | [static] |
Definition at line 1362 of file Expr.cpp.
References clang::ASTContext::Allocate(), clang::DeclAccessPair::getAccess(), clang::Decl::getAccess(), clang::DeclAccessPair::getDecl(), clang::NestedNameSpecifierLoc::getNestedNameSpecifier(), getTemplateKWAndArgsInfo(), clang::ASTTemplateKWAndArgsInfo::initializeFrom(), clang::NestedNameSpecifier::isDependent(), clang::NestedNameSpecifier::isInstantiationDependent(), clang::SourceLocation::isValid(), clang::Expr::setInstantiationDependent(), clang::Expr::setTypeDependent(), clang::Expr::setValueDependent(), clang::TemplateArgumentListInfo::size(), and clang::ASTTemplateKWAndArgsInfo::sizeFor().
Referenced by BuildMemberExpr(), and clang::Sema::FixOverloadedFunctionReference().
Expr* clang::MemberExpr::getBase | ( | ) | const [inline] |
Definition at line 2406 of file Expr.h.
Referenced by clang::Sema::BuildCallToMemberFunction(), CheckIdentityFieldAssignment(), ClassifyMemberExpr(), clang::CodeGen::CodeGenFunction::EmitCXXMemberCallExpr(), clang::CodeGen::CodeGenFunction::EmitMemberExpr(), EvalVal(), isImplicitAccess(), clang::Expr::isOBJCGCCandidate(), IsReadonlyMessage(), MarkExprReferenced(), clang::EvaluatedExprVisitor< ImplClass >::VisitMemberExpr(), clang::ento::ExprEngine::VisitMemberExpr(), and clang::consumed::ConsumedStmtVisitor::VisitMemberExpr().
Retrieve the explicit template argument list that follow the member template name. This must only be called on an expression with explicit template arguments.
Definition at line 2503 of file Expr.h.
References getTemplateKWAndArgsInfo(), and hasExplicitTemplateArgs().
Referenced by copyTemplateArgumentsInto(), getExplicitTemplateArgs(), getNumTemplateArgs(), getOptionalExplicitTemplateArgs(), and getTemplateArgs().
const ASTTemplateArgumentListInfo& clang::MemberExpr::getExplicitTemplateArgs | ( | ) | const [inline] |
Retrieve the explicit template argument list that followed the member template name. This must only be called on an expression with explicit template arguments.
Definition at line 2511 of file Expr.h.
References getExplicitTemplateArgs().
SourceLocation clang::MemberExpr::getExprLoc | ( | ) | const [inline] |
getExprLoc - Return the preferred location for the arrow when diagnosing a problem with a generic expression.
Reimplemented from clang::Expr.
Definition at line 2558 of file Expr.h.
Referenced by clang::CodeGen::CodeGenFunction::EmitMemberExpr().
DeclAccessPair clang::MemberExpr::getFoundDecl | ( | ) | const [inline] |
Retrieves the declaration found by lookup.
Definition at line 2416 of file Expr.h.
References getMemberDecl(), and clang::DeclAccessPair::make().
Referenced by clang::Sema::BuildCallToMemberFunction().
SourceLocation clang::MemberExpr::getLAngleLoc | ( | ) | const [inline] |
Retrieve the location of the left angle bracket starting the explicit template argument list following the member name, if any.
Definition at line 2474 of file Expr.h.
References getTemplateKWAndArgsInfo(), and clang::ASTTemplateArgumentListInfo::LAngleLoc.
Referenced by hasExplicitTemplateArgs().
SourceLocation MemberExpr::getLocEnd | ( | ) | const |
Reimplemented from clang::Stmt.
Definition at line 1440 of file Expr.cpp.
References clang::SourceLocation::isInvalid().
SourceLocation MemberExpr::getLocStart | ( | ) | const |
Reimplemented from clang::Stmt.
Definition at line 1426 of file Expr.cpp.
References clang::SourceLocation::isValid().
Referenced by clang::Sema::BuildCallToMemberFunction(), and clang::Sema::MarkMemberReferenced().
ValueDecl* clang::MemberExpr::getMemberDecl | ( | ) | const [inline] |
Retrieve the member declaration to which this expression refers.
The returned declaration will either be a FieldDecl or (in C++) a CXXMethodDecl.
Definition at line 2412 of file Expr.h.
Referenced by clang::Sema::BuildCallToMemberFunction(), clang::CodeGen::CodeGenFunction::CanDevirtualizeMemberFunctionCall(), CheckIdentityFieldAssignment(), ClassifyMemberExpr(), clang::CodeGen::CodeGenFunction::EmitCXXMemberCallExpr(), clang::CodeGen::CodeGenFunction::EmitMemberExpr(), EvalVal(), getFoundDecl(), clang::sema::LambdaScopeInfo::getPotentialVariableCapture(), isIdenticalStmt(), IsReadonlyMessage(), MarkExprReferenced(), clang::Sema::MarkMemberReferenced(), clang::FunctionCallFilterCCC::ValidateCandidate(), and clang::ento::ExprEngine::VisitMemberExpr().
SourceLocation clang::MemberExpr::getMemberLoc | ( | ) | const [inline] |
getMemberLoc - Return the location of the "member", in X->F, it is the location of 'F'.
Definition at line 2552 of file Expr.h.
Referenced by clang::Sema::BuildCallToMemberFunction(), clang::ento::PathDiagnosticLocation::createMemberLoc(), GetUnreachableLoc(), clang::Sema::MarkMemberReferenced(), and TryTypoCorrectionForCall().
DeclarationNameInfo clang::MemberExpr::getMemberNameInfo | ( | ) | const [inline] |
Retrieve the member declaration name info.
Definition at line 2542 of file Expr.h.
References clang::NamedDecl::getDeclName().
unsigned clang::MemberExpr::getNumTemplateArgs | ( | ) | const [inline] |
Retrieve the number of template arguments provided as part of this template-id.
Definition at line 2534 of file Expr.h.
References getExplicitTemplateArgs(), hasExplicitTemplateArgs(), and clang::ASTTemplateArgumentListInfo::NumTemplateArgs.
const ASTTemplateArgumentListInfo* clang::MemberExpr::getOptionalExplicitTemplateArgs | ( | ) | const [inline] |
Retrieves the optional explicit template arguments. This points to the same data as getExplicitTemplateArgs(), but returns null if there are no explicit template arguments.
Definition at line 2518 of file Expr.h.
References getExplicitTemplateArgs(), and hasExplicitTemplateArgs().
NestedNameSpecifier* clang::MemberExpr::getQualifier | ( | ) | const [inline] |
If the member name was qualified, retrieves the nested-name-specifier that precedes the member name. Otherwise, returns NULL.
Definition at line 2431 of file Expr.h.
Referenced by clang::Sema::BuildCallToMemberFunction(), clang::CodeGen::CodeGenFunction::EmitCXXMemberCallExpr(), and hasQualifier().
NestedNameSpecifierLoc clang::MemberExpr::getQualifierLoc | ( | ) | const [inline] |
If the member name was qualified, retrieves the nested-name-specifier that precedes the member name, with source-location information.
Definition at line 2441 of file Expr.h.
References hasQualifier().
SourceLocation clang::MemberExpr::getRAngleLoc | ( | ) | const [inline] |
Retrieve the location of the right angle bracket ending the explicit template argument list following the member name, if any.
Definition at line 2481 of file Expr.h.
References getTemplateKWAndArgsInfo(), and clang::ASTTemplateArgumentListInfo::RAngleLoc.
const TemplateArgumentLoc* clang::MemberExpr::getTemplateArgs | ( | ) | const [inline] |
Retrieve the template arguments provided as part of this template-id.
Definition at line 2525 of file Expr.h.
References getExplicitTemplateArgs(), clang::ASTTemplateArgumentListInfo::getTemplateArgs(), and hasExplicitTemplateArgs().
SourceLocation clang::MemberExpr::getTemplateKeywordLoc | ( | ) | const [inline] |
Retrieve the location of the template keyword preceding the member name, if any.
Definition at line 2467 of file Expr.h.
References clang::ASTTemplateKWAndArgsInfo::getTemplateKeywordLoc(), and getTemplateKWAndArgsInfo().
Referenced by hasTemplateKeyword().
Return the optional template keyword and arguments info.
Definition at line 2449 of file Expr.h.
Referenced by Create(), getExplicitTemplateArgs(), getLAngleLoc(), getRAngleLoc(), getTemplateKeywordLoc(), and getTemplateKWAndArgsInfo().
const ASTTemplateKWAndArgsInfo* clang::MemberExpr::getTemplateKWAndArgsInfo | ( | ) | const [inline] |
Return the optional template keyword and arguments info.
Definition at line 2461 of file Expr.h.
References getTemplateKWAndArgsInfo().
bool clang::MemberExpr::hadMultipleCandidates | ( | ) | const [inline] |
bool clang::MemberExpr::hasExplicitTemplateArgs | ( | ) | const [inline] |
Determines whether the member name was followed by an explicit template argument list.
Definition at line 2491 of file Expr.h.
References getLAngleLoc(), and clang::SourceLocation::isValid().
Referenced by copyTemplateArgumentsInto(), getExplicitTemplateArgs(), getNumTemplateArgs(), getOptionalExplicitTemplateArgs(), and getTemplateArgs().
bool clang::MemberExpr::hasQualifier | ( | ) | const [inline] |
Determines whether this member expression actually had a C++ nested-name-specifier prior to the name of the member, e.g., x->Base::foo.
Definition at line 2426 of file Expr.h.
References getQualifier().
Referenced by clang::CodeGen::CodeGenFunction::EmitCXXMemberCallExpr(), getQualifierLoc(), MarkExprReferenced(), and clang::Sema::MarkMemberReferenced().
bool clang::MemberExpr::hasTemplateKeyword | ( | ) | const [inline] |
Determines whether the member name was preceded by the template keyword.
Definition at line 2487 of file Expr.h.
References getTemplateKeywordLoc(), and clang::SourceLocation::isValid().
bool clang::MemberExpr::isArrow | ( | ) | const [inline] |
Definition at line 2547 of file Expr.h.
Referenced by ClassifyMemberExpr(), clang::CodeGen::CodeGenFunction::EmitCXXMemberCallExpr(), clang::CodeGen::CodeGenFunction::EmitMemberExpr(), EvalVal(), clang::threadSafety::isCalleeArrow(), and clang::threadSafety::BuildLockset::VisitCallExpr().
bool clang::MemberExpr::isImplicitAccess | ( | ) | const [inline] |
Determine whether the base of this explicit is implicit.
Definition at line 2561 of file Expr.h.
References getBase(), and clang::Expr::isImplicitCXXThis().
void clang::MemberExpr::setArrow | ( | bool | A | ) | [inline] |
void clang::MemberExpr::setBase | ( | Expr * | E | ) | [inline] |
Definition at line 2405 of file Expr.h.
Referenced by clang::Sema::BuildCallToMemberFunction().
void clang::MemberExpr::setHadMultipleCandidates | ( | bool | V = true | ) | [inline] |
Sets the flag telling whether this expression refers to a method that was resolved from an overloaded set having size greater than 1.
Definition at line 2573 of file Expr.h.
Referenced by clang::Sema::BuildCXXMemberCallExpr(), and clang::Sema::FixOverloadedFunctionReference().
void clang::MemberExpr::setMemberDecl | ( | ValueDecl * | D | ) | [inline] |
void clang::MemberExpr::setMemberLoc | ( | SourceLocation | L | ) | [inline] |
friend class ASTStmtWriter [friend] |
Reimplemented from clang::Stmt.