clang API Documentation

Public Types | Public Member Functions | Static Public Member Functions | Friends
clang::PseudoObjectExpr Class Reference

#include <Expr.h>

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

List of all members.

Public Types

typedef Expr *const * semantics_iterator
typedef const Expr *const * const_semantics_iterator

Public Member Functions

ExprgetSyntacticForm ()
const ExprgetSyntacticForm () const
unsigned getResultExprIndex () const
ExprgetResultExpr ()
 Return the result-bearing expression, or null if there is none.
const ExprgetResultExpr () const
unsigned getNumSemanticExprs () const
semantics_iterator semantics_begin ()
const_semantics_iterator semantics_begin () const
semantics_iterator semantics_end ()
const_semantics_iterator semantics_end () const
ExprgetSemanticExpr (unsigned index)
const ExprgetSemanticExpr (unsigned index) const
SourceLocation getExprLoc () const LLVM_READONLY
SourceLocation getLocStart () const LLVM_READONLY
SourceLocation getLocEnd () const LLVM_READONLY
child_range children ()

Static Public Member Functions

static PseudoObjectExprCreate (const ASTContext &Context, Expr *syntactic, ArrayRef< Expr * > semantic, unsigned resultIndex)
static PseudoObjectExprCreate (const ASTContext &Context, EmptyShell shell, unsigned numSemanticExprs)
static bool classof (const Stmt *T)

Friends

class ASTStmtReader

Detailed Description

PseudoObjectExpr - An expression which accesses a pseudo-object l-value. A pseudo-object is an abstract object, accesses to which are translated to calls. The pseudo-object expression has a syntactic form, which shows how the expression was actually written in the source code, and a semantic form, which is a series of expressions to be executed in order which detail how the operation is actually evaluated. Optionally, one of the semantic forms may also provide a result value for the expression.

If any of the semantic-form expressions is an OpaqueValueExpr, that OVE is required to have a source expression, and it is bound to the result of that source expression. Such OVEs may appear only in subsequent semantic-form expressions and as sub-expressions of the syntactic form.

PseudoObjectExpr should be used only when an operation can be usefully described in terms of fairly simple rewrite rules on objects and functions that are meant to be used by end-developers. For example, under the Itanium ABI, dynamic casts are implemented as a call to a runtime function called __dynamic_cast; using this class to describe that would be inappropriate because that call is not really part of the user-visible semantics, and instead the cast is properly reflected in the AST and IR-generation has been taught to generate the call as necessary. In contrast, an Objective-C property access is semantically defined to be equivalent to a particular message send, and this is very much part of the user model. The name of this class encourages this modelling design.

Definition at line 4637 of file Expr.h.


Member Typedef Documentation

Definition at line 4704 of file Expr.h.

Definition at line 4703 of file Expr.h.


Member Function Documentation

Reimplemented from clang::Stmt.

Definition at line 4736 of file Expr.h.

static bool clang::PseudoObjectExpr::classof ( const Stmt T) [inline, static]

Reimplemented from clang::Expr.

Definition at line 4741 of file Expr.h.

References clang::Stmt::getStmtClass().

PseudoObjectExpr * PseudoObjectExpr::Create ( const ASTContext Context,
Expr syntactic,
ArrayRef< Expr * >  semantic,
unsigned  resultIndex 
) [static]
PseudoObjectExpr * PseudoObjectExpr::Create ( const ASTContext Context,
EmptyShell  shell,
unsigned  numSemanticExprs 
) [static]

Definition at line 3977 of file Expr.cpp.

References clang::ASTContext::Allocate().

getExprLoc - Return the preferred location for the arrow when diagnosing a problem with a generic expression.

Reimplemented from clang::Expr.

Definition at line 4725 of file Expr.h.

References clang::Expr::getExprLoc(), and getSyntacticForm().

Reimplemented from clang::Stmt.

Definition at line 4732 of file Expr.h.

References clang::Stmt::getLocEnd(), and getSyntacticForm().

Reimplemented from clang::Stmt.

Definition at line 4729 of file Expr.h.

References clang::Stmt::getLocStart(), and getSyntacticForm().

Definition at line 4701 of file Expr.h.

Return the result-bearing expression, or null if there is none.

Definition at line 4692 of file Expr.h.

References clang::Stmt::PseudoObjectExprBits.

Referenced by emitPseudoObjectExpr(), getResultExpr(), tryEmitARCRetainPseudoObject(), and clang::ento::ExprEngine::Visit().

const Expr* clang::PseudoObjectExpr::getResultExpr ( ) const [inline]

Definition at line 4697 of file Expr.h.

References getResultExpr().

Return the index of the result-bearing expression into the semantics expressions, or PseudoObjectExpr::NoResult if there is none.

Definition at line 4686 of file Expr.h.

References NoResult, and clang::Stmt::PseudoObjectExprBits.

Definition at line 4717 of file Expr.h.

Referenced by getSemanticExpr().

const Expr* clang::PseudoObjectExpr::getSemanticExpr ( unsigned  index) const [inline]

Definition at line 4721 of file Expr.h.

References getSemanticExpr().

Return the syntactic form of this expression, i.e. the expression it actually looks like. Likely to be expressed in terms of OpaqueValueExprs bound in the semantic form.

Definition at line 4681 of file Expr.h.

Referenced by BuildParentMap(), getExprLoc(), getLocEnd(), getLocStart(), clang::Expr::isUnusedResultAWarning(), clang::sema::FunctionScopeInfo::markSafeWeakUse(), and clang::Sema::recreateSyntacticForm().

Definition at line 4682 of file Expr.h.

Definition at line 4708 of file Expr.h.

Definition at line 4714 of file Expr.h.


Friends And Related Function Documentation

friend class ASTStmtReader [friend]

Reimplemented from clang::Stmt.

Definition at line 4654 of file Expr.h.


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