clang API Documentation
#include <Expr.h>
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.
typedef const Expr* const* clang::PseudoObjectExpr::const_semantics_iterator |
typedef Expr* const* clang::PseudoObjectExpr::semantics_iterator |
child_range clang::PseudoObjectExpr::children | ( | ) | [inline] |
Reimplemented from clang::Stmt.
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] |
Definition at line 3991 of file Expr.cpp.
References clang::ASTContext::Allocate(), clang::Expr::getObjectKind(), NoResult, clang::OK_Ordinary, clang::ast_matchers::type, clang::VK_RValue, and clang::ASTContext::VoidTy.
PseudoObjectExpr * PseudoObjectExpr::Create | ( | const ASTContext & | Context, |
EmptyShell | shell, | ||
unsigned | numSemanticExprs | ||
) | [static] |
Definition at line 3977 of file Expr.cpp.
References clang::ASTContext::Allocate().
SourceLocation clang::PseudoObjectExpr::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 4725 of file Expr.h.
References clang::Expr::getExprLoc(), and getSyntacticForm().
SourceLocation clang::PseudoObjectExpr::getLocEnd | ( | ) | const [inline] |
Reimplemented from clang::Stmt.
Definition at line 4732 of file Expr.h.
References clang::Stmt::getLocEnd(), and getSyntacticForm().
SourceLocation clang::PseudoObjectExpr::getLocStart | ( | ) | const [inline] |
Reimplemented from clang::Stmt.
Definition at line 4729 of file Expr.h.
References clang::Stmt::getLocStart(), and getSyntacticForm().
unsigned clang::PseudoObjectExpr::getNumSemanticExprs | ( | ) | const [inline] |
Expr* clang::PseudoObjectExpr::getResultExpr | ( | ) | [inline] |
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().
unsigned clang::PseudoObjectExpr::getResultExprIndex | ( | ) | const [inline] |
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.
Expr* clang::PseudoObjectExpr::getSemanticExpr | ( | unsigned | index | ) | [inline] |
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().
Expr* clang::PseudoObjectExpr::getSyntacticForm | ( | ) | [inline] |
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().
const Expr* clang::PseudoObjectExpr::getSyntacticForm | ( | ) | const [inline] |
Definition at line 4705 of file Expr.h.
Referenced by BuildParentMap(), emitPseudoObjectExpr(), clang::Expr::HasSideEffects(), and tryEmitARCRetainPseudoObject().
const_semantics_iterator clang::PseudoObjectExpr::semantics_begin | ( | ) | const [inline] |
semantics_iterator clang::PseudoObjectExpr::semantics_end | ( | ) | [inline] |
Definition at line 4711 of file Expr.h.
Referenced by BuildParentMap(), emitPseudoObjectExpr(), clang::Expr::HasSideEffects(), and tryEmitARCRetainPseudoObject().
const_semantics_iterator clang::PseudoObjectExpr::semantics_end | ( | ) | const [inline] |
friend class ASTStmtReader [friend] |
Reimplemented from clang::Stmt.