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) |
| SourceRange | getSourceRange () const LLVM_READONLY |
| child_range | children () |
Static Public Member Functions | |
| static ExprWithCleanups * | Create (ASTContext &C, EmptyShell empty, unsigned numObjects) |
| static ExprWithCleanups * | Create (ASTContext &C, Expr *subexpr, ArrayRef< CleanupObject > objects) |
| static bool | classof (const Stmt *T) |
| static bool | classof (const ExprWithCleanups *) |
Friends | |
| class | ASTStmtReader |
Represents an expression --- generally a full-expression --- which 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 2750 of file ExprCXX.h.
References clang::Stmt::getStmtClass().
| static bool clang::ExprWithCleanups::classof | ( | const ExprWithCleanups * | ) | [inline, static] |
| ExprWithCleanups * ExprWithCleanups::Create | ( | ASTContext & | C, |
| EmptyShell | empty, | ||
| unsigned | numObjects | ||
| ) | [static] |
Definition at line 973 of file ExprCXX.cpp.
References clang::ASTContext::Allocate().
Referenced by clang::Sema::MaybeCreateExprWithCleanups().
| ExprWithCleanups * ExprWithCleanups::Create | ( | ASTContext & | C, |
| Expr * | subexpr, | ||
| ArrayRef< CleanupObject > | objects | ||
| ) | [static] |
Definition at line 960 of file ExprCXX.cpp.
References clang::ASTContext::Allocate().
| unsigned clang::ExprWithCleanups::getNumObjects | ( | ) | const [inline] |
Definition at line 2731 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 2733 of file ExprCXX.h.
References getNumObjects(), and getObjects().
| ArrayRef<CleanupObject> clang::ExprWithCleanups::getObjects | ( | ) | const [inline] |
Definition at line 2727 of file ExprCXX.h.
References getNumObjects().
Referenced by clang::CodeGen::CodeGenFunction::enterNonTrivialFullExpression(), and getObject().
| SourceRange clang::ExprWithCleanups::getSourceRange | ( | ) | const [inline] |
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 2745 of file ExprCXX.h.
References clang::Stmt::getSourceRange().
| Expr* clang::ExprWithCleanups::getSubExpr | ( | ) | [inline] |
Definition at line 2738 of file ExprCXX.h.
Referenced by clang::CodeGen::CodeGenFunction::EmitLValue(), clang::CodeGen::CodeGenFunction::MaybeEmitStdInitializerListCleanup(), and maybeRebuildARCConsumingStmt().
| const Expr* clang::ExprWithCleanups::getSubExpr | ( | ) | const [inline] |
| void clang::ExprWithCleanups::setSubExpr | ( | Expr * | E | ) | [inline] |
setSubExpr - As with any mutator of the AST, be very careful when modifying an existing AST to preserve its invariants.
Definition at line 2743 of file ExprCXX.h.
Referenced by maybeRebuildARCConsumingStmt().
friend class ASTStmtReader [friend] |
Reimplemented from clang::Stmt.