class ObjCIndirectCopyRestoreExpr

Declaration

class ObjCIndirectCopyRestoreExpr : public Expr { /* full declaration omitted */ };

Description

ObjCIndirectCopyRestoreExpr - Represents the passing of a function argument by indirect copy-restore in ARC. This is used to support passing indirect arguments with the wrong lifetime, e.g. when passing the address of a __strong local variable to an 'out' parameter. This expression kind is only valid in an "argument" position to some sort of call expression. The parameter must have type 'pointer to T', and the argument must have type 'pointer to U', where T and U agree except possibly in qualification. If the argument value is null, then a null pointer is passed; otherwise it points to an object A, and: 1. A temporary object B of type T is initialized, either by zero-initialization (used when initializing an 'out' parameter) or copy-initialization (used when initializing an 'inout' parameter). 2. The address of the temporary is passed to the function. 3. If the call completes normally, A is move-assigned from B. 4. Finally, A is destroyed immediately. Currently 'T' must be a retainable object lifetime and must be __autoreleasing; this qualifier is ignored when initializing the value.

Declared at: clang/include/clang/AST/ExprObjC.h:1566

Inherits from: Expr

Member Variables

private clang::Stmt* Operand

Inherited from Stmt:

protected

Method Overview

Inherited from Expr:

Inherited from ValueStmt:

Inherited from Stmt:

Methods

ObjCIndirectCopyRestoreExpr(
    clang::Stmt::EmptyShell Empty)

Declared at: clang/include/clang/AST/ExprObjC.h:1574

Parameters

clang::Stmt::EmptyShell Empty

ObjCIndirectCopyRestoreExpr(clang::Expr* operand,
                            clang::QualType type,
                            bool shouldCopy)

Declared at: clang/include/clang/AST/ExprObjC.h:1582

Parameters

clang::Expr* operand
clang::QualType type
bool shouldCopy

clang::Stmt::child_range children()

Declared at: clang/include/clang/AST/ExprObjC.h:1596

clang::Stmt::const_child_range children() const

Declared at: clang/include/clang/AST/ExprObjC.h:1598

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

Declared at: clang/include/clang/AST/ExprObjC.h:1614

Parameters

const clang::Stmt* s

clang::SourceLocation getBeginLoc() const

Declared at: clang/include/clang/AST/ExprObjC.h:1603

clang::SourceLocation getEndLoc() const

Declared at: clang/include/clang/AST/ExprObjC.h:1606

clang::SourceLocation getExprLoc() const

Declared at: clang/include/clang/AST/ExprObjC.h:1610

clang::Expr* getSubExpr()

Declared at: clang/include/clang/AST/ExprObjC.h:1589

const clang::Expr* getSubExpr() const

Declared at: clang/include/clang/AST/ExprObjC.h:1590

void setShouldCopy(bool shouldCopy)

Declared at: clang/include/clang/AST/ExprObjC.h:1577

Parameters

bool shouldCopy

bool shouldCopy() const

Description

shouldCopy - True if we should do the 'copy' part of the copy-restore. If false, the temporary will be zero-initialized.

Declared at: clang/include/clang/AST/ExprObjC.h:1594