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

Detailed Description

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

Definition at line 2153 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 2233 of file Expr.h.


Member Function Documentation

child_range clang::MemberExpr::children ( ) [inline]

Reimplemented from clang::Stmt.

Definition at line 2432 of file Expr.h.

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]

Definition at line 2429 of file Expr.h.

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

Definition at line 2407 of file Expr.h.

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.

Definition at line 1129 of file Expr.cpp.

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]
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.

Definition at line 2416 of file Expr.h.

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]
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::setArrow ( bool  A) [inline]

Definition at line 2396 of file Expr.h.

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]

Definition at line 2261 of file Expr.h.

void clang::MemberExpr::setMemberLoc ( SourceLocation  L) [inline]

Definition at line 2401 of file Expr.h.


Friends And Related Function Documentation

friend class ASTReader [friend]

Definition at line 2434 of file Expr.h.

friend class ASTStmtWriter [friend]

Reimplemented from clang::Stmt.

Definition at line 2435 of file Expr.h.


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