clang API Documentation

Classes | Public Member Functions | Static Public Member Functions | Friends
clang::MemberExpr Class Reference

#include <Expr.h>

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

List of all members.

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)
ExprgetBase () const
ValueDeclgetMemberDecl () 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.
NestedNameSpecifiergetQualifier () 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.
ASTTemplateKWAndArgsInfogetTemplateKWAndArgsInfo ()
 Return the optional template keyword and arguments info.
const ASTTemplateKWAndArgsInfogetTemplateKWAndArgsInfo () 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.
ASTTemplateArgumentListInfogetExplicitTemplateArgs ()
 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 ASTTemplateArgumentListInfogetExplicitTemplateArgs () 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 ASTTemplateArgumentListInfogetOptionalExplicitTemplateArgs () 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 TemplateArgumentLocgetTemplateArgs () 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 MemberExprCreate (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

Detailed Description

MemberExpr - [C99 6.5.2.3] Structure and Union Members. X->F and X.F.

Definition at line 2305 of file Expr.h.


Constructor & Destructor Documentation

clang::MemberExpr::MemberExpr ( Expr base,
bool  isarrow,
ValueDecl memberdecl,
const DeclarationNameInfo NameInfo,
QualType  ty,
ExprValueKind  VK,
ExprObjectKind  OK 
) [inline]
clang::MemberExpr::MemberExpr ( Expr base,
bool  isarrow,
ValueDecl memberdecl,
SourceLocation  l,
QualType  ty,
ExprValueKind  VK,
ExprObjectKind  OK 
) [inline]

Definition at line 2385 of file Expr.h.


Member Function Documentation

Reimplemented from clang::Stmt.

Definition at line 2582 of file Expr.h.

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().

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]
Expr* clang::MemberExpr::getBase ( ) const [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 2503 of file Expr.h.

References getTemplateKWAndArgsInfo(), and hasExplicitTemplateArgs().

Referenced by copyTemplateArgumentsInto(), getExplicitTemplateArgs(), getNumTemplateArgs(), getOptionalExplicitTemplateArgs(), and getTemplateArgs().

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().

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().

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().

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().

Reimplemented from clang::Stmt.

Definition at line 1440 of file Expr.cpp.

References clang::SourceLocation::isInvalid().

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().

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().

Retrieve the member declaration name info.

Definition at line 2542 of file Expr.h.

References clang::NamedDecl::getDeclName().

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.

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().

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().

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().

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.

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().

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().

Return the optional template keyword and arguments info.

Definition at line 2461 of file Expr.h.

References getTemplateKWAndArgsInfo().

Returns true if this member expression refers to a method that was resolved from an overloaded set having size greater than 1.

Definition at line 2567 of file Expr.h.

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().

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().

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]

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]

Definition at line 2548 of file Expr.h.

void clang::MemberExpr::setBase ( Expr E) [inline]

Definition at line 2405 of file Expr.h.

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

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().

Definition at line 2413 of file Expr.h.

Definition at line 2553 of file Expr.h.


Friends And Related Function Documentation

friend class ASTReader [friend]

Definition at line 2584 of file Expr.h.

friend class ASTStmtWriter [friend]

Reimplemented from clang::Stmt.

Definition at line 2585 of file Expr.h.


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