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) |
| SourceRange | getSourceRange () const LLVM_READONLY |
| 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 (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) |
| static bool | classof (const MemberExpr *) |
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 2214 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 2426 of file Expr.h.
References clang::Stmt::getStmtClass().
| static bool clang::MemberExpr::classof | ( | const MemberExpr * | ) | [inline, static] |
| void clang::MemberExpr::copyTemplateArgumentsInto | ( | TemplateArgumentListInfo & | List | ) | const [inline] |
Copies the template arguments (if present) into the given structure.
Definition at line 2343 of file Expr.h.
References clang::ASTTemplateArgumentListInfo::copyInto(), getExplicitTemplateArgs(), and hasExplicitTemplateArgs().
| MemberExpr * MemberExpr::Create | ( | 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 1048 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().
| Expr* clang::MemberExpr::getBase | ( | ) | const [inline] |
Definition at line 2254 of file Expr.h.
Referenced by clang::Sema::BuildCallToMemberFunction(), ClassifyMemberExpr(), clang::CodeGen::CodeGenFunction::EmitCXXMemberCallExpr(), clang::CodeGen::CodeGenFunction::EmitMemberExpr(), EvalVal(), isImplicitAccess(), clang::Expr::isOBJCGCCandidate(), IsReadonlyMessage(), clang::EvaluatedExprVisitor< ImplClass >::VisitMemberExpr(), and clang::ento::ExprEngine::VisitMemberExpr().
| ASTTemplateArgumentListInfo& clang::MemberExpr::getExplicitTemplateArgs | ( | ) | [inline] |
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 2351 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 2359 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.
| DeclAccessPair clang::MemberExpr::getFoundDecl | ( | ) | const [inline] |
Retrieves the declaration found by lookup.
Definition at line 2264 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 2322 of file Expr.h.
References getTemplateKWAndArgsInfo(), and clang::ASTTemplateArgumentListInfo::LAngleLoc.
Referenced by hasExplicitTemplateArgs().
| SourceLocation MemberExpr::getLocEnd | ( | ) | const |
Reimplemented from clang::Stmt.
| SourceLocation MemberExpr::getLocStart | ( | ) | const |
Reimplemented from clang::Stmt.
Definition at line 1115 of file Expr.cpp.
References clang::SourceLocation::isValid().
Referenced by clang::Sema::BuildCallToMemberFunction().
| 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 2260 of file Expr.h.
Referenced by clang::Sema::BuildCallToMemberFunction(), ClassifyMemberExpr(), clang::CodeGen::CodeGenFunction::EmitCXXMemberCallExpr(), clang::CodeGen::CodeGenFunction::EmitMemberExpr(), EvalVal(), getFoundDecl(), IsReadonlyMessage(), clang::Sema::MarkMemberReferenced(), 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 2400 of file Expr.h.
Referenced by clang::Sema::BuildCallToMemberFunction(), clang::ento::PathDiagnosticLocation::createMemberLoc(), GetUnreachableLoc(), and clang::Sema::MarkMemberReferenced().
| DeclarationNameInfo clang::MemberExpr::getMemberNameInfo | ( | ) | const [inline] |
Retrieve the member declaration name info.
Definition at line 2390 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 2382 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 2366 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 2279 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 2289 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 2329 of file Expr.h.
References getTemplateKWAndArgsInfo(), and clang::ASTTemplateArgumentListInfo::RAngleLoc.
| SourceRange MemberExpr::getSourceRange | ( | ) | const |
SourceLocation tokens are not useful in isolation - they are low level value objects created/interpreted by SourceManager. We assume AST clients will have a pointer to the respective SourceManager.
Reimplemented from clang::Stmt.
Definition at line 1112 of file Expr.cpp.
References clang::Stmt::getLocEnd(), and clang::Stmt::getLocStart().
Referenced by GetUnreachableLoc().
| const TemplateArgumentLoc* clang::MemberExpr::getTemplateArgs | ( | ) | const [inline] |
Retrieve the template arguments provided as part of this template-id.
Definition at line 2373 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 2315 of file Expr.h.
References clang::ASTTemplateKWAndArgsInfo::getTemplateKeywordLoc(), and getTemplateKWAndArgsInfo().
Referenced by hasTemplateKeyword().
| ASTTemplateKWAndArgsInfo* clang::MemberExpr::getTemplateKWAndArgsInfo | ( | ) | [inline] |
Return the optional template keyword and arguments info.
Definition at line 2297 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 2309 of file Expr.h.
References getTemplateKWAndArgsInfo().
| bool clang::MemberExpr::hadMultipleCandidates | ( | ) | const [inline] |
Returns true if this member expression refers to a method that was resolved from an overloaded set having size greater than 1.
| bool clang::MemberExpr::hasExplicitTemplateArgs | ( | ) | const [inline] |
Determines whether the member name was followed by an explicit template argument list.
Definition at line 2339 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 2274 of file Expr.h.
References getQualifier().
Referenced by clang::CodeGen::CodeGenFunction::EmitCXXMemberCallExpr(), and getQualifierLoc().
| bool clang::MemberExpr::hasTemplateKeyword | ( | ) | const [inline] |
Determines whether the member name was preceded by the template keyword.
Definition at line 2335 of file Expr.h.
References getTemplateKeywordLoc(), and clang::SourceLocation::isValid().
| bool clang::MemberExpr::isArrow | ( | ) | const [inline] |
Definition at line 2395 of file Expr.h.
Referenced by ClassifyMemberExpr(), clang::CodeGen::CodeGenFunction::EmitCXXMemberCallExpr(), clang::CodeGen::CodeGenFunction::EmitMemberExpr(), and EvalVal().
| bool clang::MemberExpr::isImplicitAccess | ( | ) | const [inline] |
Determine whether the base of this explicit is implicit.
Definition at line 2410 of file Expr.h.
References getBase(), and clang::Expr::isImplicitCXXThis().
| void clang::MemberExpr::setBase | ( | Expr * | E | ) | [inline] |
Definition at line 2253 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 2422 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.