clang API Documentation

Public Member Functions | Static Public Member Functions | Friends
clang::ObjCIndirectCopyRestoreExpr Class Reference

#include <ExprObjC.h>

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

List of all members.

Public Member Functions

 ObjCIndirectCopyRestoreExpr (Expr *operand, QualType type, bool shouldCopy)
ExprgetSubExpr ()
const ExprgetSubExpr () const
bool shouldCopy () const
child_range children ()
SourceLocation getLocStart () const LLVM_READONLY
SourceLocation getLocEnd () const LLVM_READONLY
SourceLocation getExprLoc () const LLVM_READONLY

Static Public Member Functions

static bool classof (const Stmt *s)

Friends

class ASTReader
class ASTStmtReader

Detailed 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.

Definition at line 1472 of file ExprObjC.h.


Constructor & Destructor Documentation

clang::ObjCIndirectCopyRestoreExpr::ObjCIndirectCopyRestoreExpr ( Expr operand,
QualType  type,
bool  shouldCopy 
) [inline]

Definition at line 1488 of file ExprObjC.h.


Member Function Documentation

Reimplemented from clang::Stmt.

Definition at line 1504 of file ExprObjC.h.

static bool clang::ObjCIndirectCopyRestoreExpr::classof ( const Stmt s) [inline, static]

Reimplemented from clang::Expr.

Definition at line 1516 of file ExprObjC.h.

References clang::Stmt::getStmtClass().

getExprLoc - Return the preferred location for the arrow when diagnosing a problem with a generic expression.

Reimplemented from clang::Expr.

Definition at line 1512 of file ExprObjC.h.

References clang::Expr::getExprLoc(), and getSubExpr().

Reimplemented from clang::Stmt.

Definition at line 1510 of file ExprObjC.h.

References clang::Stmt::getLocEnd().

Reimplemented from clang::Stmt.

Definition at line 1507 of file ExprObjC.h.

References clang::Stmt::getLocStart().

Definition at line 1497 of file ExprObjC.h.

Referenced by emitWritebackArg(), and getExprLoc().

Definition at line 1498 of file ExprObjC.h.

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

Definition at line 1502 of file ExprObjC.h.

References clang::Stmt::ObjCIndirectCopyRestoreExprBits.

Referenced by emitWritebackArg().


Friends And Related Function Documentation

friend class ASTReader [friend]

Definition at line 1477 of file ExprObjC.h.

friend class ASTStmtReader [friend]

Reimplemented from clang::Stmt.

Definition at line 1478 of file ExprObjC.h.


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