clang API Documentation
#include <ExprCXX.h>
Public Types | |
typedef BlockDecl * | CleanupObject |
Public Member Functions | |
ArrayRef< CleanupObject > | getObjects () const |
unsigned | getNumObjects () const |
CleanupObject | getObject (unsigned i) const |
Expr * | getSubExpr () |
const Expr * | getSubExpr () const |
void | setSubExpr (Expr *E) |
SourceLocation | getLocStart () const LLVM_READONLY |
SourceLocation | getLocEnd () const LLVM_READONLY |
child_range | children () |
Static Public Member Functions | |
static ExprWithCleanups * | Create (const ASTContext &C, EmptyShell empty, unsigned numObjects) |
static ExprWithCleanups * | Create (const ASTContext &C, Expr *subexpr, ArrayRef< CleanupObject > objects) |
static bool | classof (const Stmt *T) |
Friends | |
class | ASTStmtReader |
Represents an expression -- generally a full-expression -- that introduces cleanups to be run at the end of the sub-expression's evaluation. The most common source of expression-introduced cleanups is temporary objects in C++, but several other kinds of expressions can create cleanups, including basically every call in ARC that returns an Objective-C pointer.
This expression also tracks whether the sub-expression contains a potentially-evaluated block literal. The lifetime of a block literal is the extent of the enclosing scope.
child_range clang::ExprWithCleanups::children | ( | ) | [inline] |
Reimplemented from clang::Stmt.
static bool clang::ExprWithCleanups::classof | ( | const Stmt * | T | ) | [inline, static] |
Reimplemented from clang::Expr.
Definition at line 2806 of file ExprCXX.h.
References clang::Stmt::getStmtClass().
ExprWithCleanups * ExprWithCleanups::Create | ( | const ASTContext & | C, |
EmptyShell | empty, | ||
unsigned | numObjects | ||
) | [static] |
Definition at line 1137 of file ExprCXX.cpp.
References clang::ASTContext::Allocate().
Referenced by clang::Sema::MaybeCreateExprWithCleanups().
ExprWithCleanups * ExprWithCleanups::Create | ( | const ASTContext & | C, |
Expr * | subexpr, | ||
ArrayRef< CleanupObject > | objects | ||
) | [static] |
Definition at line 1124 of file ExprCXX.cpp.
References clang::ASTContext::Allocate().
SourceLocation clang::ExprWithCleanups::getLocEnd | ( | ) | const [inline] |
Reimplemented from clang::Stmt.
Definition at line 2803 of file ExprCXX.h.
References clang::Stmt::getLocEnd().
SourceLocation clang::ExprWithCleanups::getLocStart | ( | ) | const [inline] |
Reimplemented from clang::Stmt.
Definition at line 2800 of file ExprCXX.h.
References clang::Stmt::getLocStart().
unsigned clang::ExprWithCleanups::getNumObjects | ( | ) | const [inline] |
Definition at line 2786 of file ExprCXX.h.
References clang::Stmt::ExprWithCleanupsBits.
Referenced by clang::CodeGen::CodeGenFunction::enterFullExpression(), clang::CodeGen::CodeGenFunction::enterNonTrivialFullExpression(), getObject(), and getObjects().
CleanupObject clang::ExprWithCleanups::getObject | ( | unsigned | i | ) | const [inline] |
Definition at line 2788 of file ExprCXX.h.
References getNumObjects(), and getObjects().
ArrayRef<CleanupObject> clang::ExprWithCleanups::getObjects | ( | ) | const [inline] |
Definition at line 2782 of file ExprCXX.h.
References getNumObjects().
Referenced by clang::CodeGen::CodeGenFunction::enterNonTrivialFullExpression(), and getObject().
Expr* clang::ExprWithCleanups::getSubExpr | ( | ) | [inline] |
Definition at line 2793 of file ExprCXX.h.
Referenced by maybeRebuildARCConsumingStmt().
const Expr* clang::ExprWithCleanups::getSubExpr | ( | ) | const [inline] |
void clang::ExprWithCleanups::setSubExpr | ( | Expr * | E | ) | [inline] |
As with any mutator of the AST, be very careful when modifying an existing AST to preserve its invariants.
Definition at line 2798 of file ExprCXX.h.
Referenced by maybeRebuildARCConsumingStmt().
friend class ASTStmtReader [friend] |
Reimplemented from clang::Stmt.