clang API Documentation

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

#include <ExprCXX.h>

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

List of all members.

Public Types

typedef BlockDeclCleanupObject

Public Member Functions

ArrayRef< CleanupObjectgetObjects () const
unsigned getNumObjects () const
CleanupObject getObject (unsigned i) const
ExprgetSubExpr ()
const ExprgetSubExpr () const
void setSubExpr (Expr *E)
SourceLocation getLocStart () const LLVM_READONLY
SourceLocation getLocEnd () const LLVM_READONLY
child_range children ()

Static Public Member Functions

static ExprWithCleanupsCreate (const ASTContext &C, EmptyShell empty, unsigned numObjects)
static ExprWithCleanupsCreate (const ASTContext &C, Expr *subexpr, ArrayRef< CleanupObject > objects)
static bool classof (const Stmt *T)

Friends

class ASTStmtReader

Detailed Description

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.

Definition at line 2753 of file ExprCXX.h.


Member Typedef Documentation

The type of objects that are kept in the cleanup. It's useful to remember the set of blocks; we could also remember the set of temporaries, but there's currently no need.

Definition at line 2759 of file ExprCXX.h.


Member Function Documentation

Reimplemented from clang::Stmt.

Definition at line 2811 of file ExprCXX.h.

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

Reimplemented from clang::Stmt.

Definition at line 2803 of file ExprCXX.h.

References clang::Stmt::getLocEnd().

Reimplemented from clang::Stmt.

Definition at line 2800 of file ExprCXX.h.

References clang::Stmt::getLocStart().

Definition at line 2788 of file ExprCXX.h.

References getNumObjects(), and getObjects().

ArrayRef<CleanupObject> clang::ExprWithCleanups::getObjects ( ) const [inline]

Definition at line 2793 of file ExprCXX.h.

Referenced by maybeRebuildARCConsumingStmt().

const Expr* clang::ExprWithCleanups::getSubExpr ( ) const [inline]

Definition at line 2794 of file ExprCXX.h.

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


Friends And Related Function Documentation

friend class ASTStmtReader [friend]

Reimplemented from clang::Stmt.

Definition at line 2773 of file ExprCXX.h.


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