class ExprWithCleanups

Declaration

class ExprWithCleanups : public FullExpr, private TrailingObjects { /* full declaration omitted */ };

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.

Declared at: clang/include/clang/AST/ExprCXX.h:3359

Inherits from: FullExpr, TrailingObjects

Member Variables

Inherited from FullExpr:

protected SubExpr

Inherited from Stmt:

protected

Method Overview

  • public static clang::ExprWithCleanups * Create(const clang::ASTContext & C, clang::Stmt::EmptyShell empty, unsigned int numObjects)
  • public static clang::ExprWithCleanups * Create(const clang::ASTContext & C, clang::Expr * subexpr, bool CleanupsHaveSideEffects, ArrayRef<clang::ExprWithCleanups::CleanupObject> objects)
  • private ExprWithCleanups(clang::Stmt::EmptyShell, unsigned int NumObjects)
  • private ExprWithCleanups(clang::Expr * SubExpr, bool CleanupsHaveSideEffects, ArrayRef<clang::ExprWithCleanups::CleanupObject> Objects)
  • public clang::Stmt::child_range children()
  • public clang::Stmt::const_child_range children() const
  • public static bool classof(const clang::Stmt * T)
  • public bool cleanupsHaveSideEffects() const
  • public clang::SourceLocation getBeginLoc() const
  • public clang::SourceLocation getEndLoc() const
  • public unsigned int getNumObjects() const
  • public clang::ExprWithCleanups::CleanupObject getObject(unsigned int i) const
  • public ArrayRef<clang::ExprWithCleanups::CleanupObject> getObjects() const

Inherited from FullExpr:

Inherited from Expr:

Inherited from ValueStmt:

Inherited from Stmt:

Methods

static clang::ExprWithCleanups* Create(
    const clang::ASTContext& C,
    clang::Stmt::EmptyShell empty,
    unsigned int numObjects)

Declared at: clang/include/clang/AST/ExprCXX.h:3380

Parameters

const clang::ASTContext& C
clang::Stmt::EmptyShell empty
unsigned int numObjects

static clang::ExprWithCleanups* Create(
    const clang::ASTContext& C,
    clang::Expr* subexpr,
    bool CleanupsHaveSideEffects,
    ArrayRef<
        clang::ExprWithCleanups::CleanupObject>
        objects)

Declared at: clang/include/clang/AST/ExprCXX.h:3383

Parameters

const clang::ASTContext& C
clang::Expr* subexpr
bool CleanupsHaveSideEffects
ArrayRef<clang::ExprWithCleanups::CleanupObject> objects

ExprWithCleanups(clang::Stmt::EmptyShell,
                 unsigned int NumObjects)

Declared at: clang/include/clang/AST/ExprCXX.h:3375

Parameters

clang::Stmt::EmptyShell
unsigned int NumObjects

ExprWithCleanups(
    clang::Expr* SubExpr,
    bool CleanupsHaveSideEffects,
    ArrayRef<
        clang::ExprWithCleanups::CleanupObject>
        Objects)

Declared at: clang/include/clang/AST/ExprCXX.h:3376

Parameters

clang::Expr* SubExpr
bool CleanupsHaveSideEffects
ArrayRef<clang::ExprWithCleanups::CleanupObject> Objects

clang::Stmt::child_range children()

Declared at: clang/include/clang/AST/ExprCXX.h:3417

clang::Stmt::const_child_range children() const

Declared at: clang/include/clang/AST/ExprCXX.h:3419

static bool classof(const clang::Stmt* T)

Declared at: clang/include/clang/AST/ExprCXX.h:3412

Parameters

const clang::Stmt* T

bool cleanupsHaveSideEffects() const

Declared at: clang/include/clang/AST/ExprCXX.h:3399

clang::SourceLocation getBeginLoc() const

Declared at: clang/include/clang/AST/ExprCXX.h:3403

clang::SourceLocation getEndLoc() const

Declared at: clang/include/clang/AST/ExprCXX.h:3407

unsigned int getNumObjects() const

Declared at: clang/include/clang/AST/ExprCXX.h:3392

clang::ExprWithCleanups::CleanupObject getObject(
    unsigned int i) const

Declared at: clang/include/clang/AST/ExprCXX.h:3394

Parameters

unsigned int i

ArrayRef<clang::ExprWithCleanups::CleanupObject>
getObjects() const

Declared at: clang/include/clang/AST/ExprCXX.h:3387