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)
SourceRange getSourceRange () const LLVM_READONLY
child_range children ()

Static Public Member Functions

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

Friends

class ASTStmtReader

Detailed Description

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.

Definition at line 2698 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 2704 of file ExprCXX.h.


Member Function Documentation

child_range clang::ExprWithCleanups::children ( ) [inline]

Reimplemented from clang::Stmt.

Definition at line 2756 of file ExprCXX.h.

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]

Definition at line 2753 of file ExprCXX.h.

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]
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]
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]
const Expr* clang::ExprWithCleanups::getSubExpr ( ) const [inline]

Definition at line 2739 of file ExprCXX.h.

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


Friends And Related Function Documentation

friend class ASTStmtReader [friend]

Reimplemented from clang::Stmt.

Definition at line 2718 of file ExprCXX.h.


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