clang API Documentation

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

Represents a prvalue temporary that written into memory so that a reference can bind to it. More...

#include <ExprCXX.h>

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

List of all members.

Public Member Functions

 MaterializeTemporaryExpr (QualType T, Expr *Temporary, bool BoundToLvalueReference)
 MaterializeTemporaryExpr (EmptyShell Empty)
ExprGetTemporaryExpr () const
 Retrieve the temporary-generating subexpression whose value will be materialized into a glvalue.
bool isBoundToLvalueReference () const
 Determine whether this materialized temporary is bound to an lvalue reference; otherwise, it's bound to an rvalue reference.
SourceRange getSourceRange () const LLVM_READONLY
child_range children ()

Static Public Member Functions

static bool classof (const Stmt *T)
static bool classof (const MaterializeTemporaryExpr *)

Friends

class ASTStmtReader
class ASTStmtWriter

Detailed Description

Represents a prvalue temporary that written into memory so that a reference can bind to it.

Prvalue expressions are materialized when they need to have an address in memory for a reference to bind to. This happens when binding a reference to the result of a conversion, e.g.,

 const int &r = 1.0;

Here, 1.0 is implicitly converted to an int. That resulting int is then materialized via a MaterializeTemporaryExpr, and the reference binds to the temporary. MaterializeTemporaryExprs are always glvalues (either an lvalue or an xvalue, depending on the kind of reference binding to it), maintaining the invariant that references always bind to glvalues.

Definition at line 3607 of file ExprCXX.h.


Constructor & Destructor Documentation

clang::MaterializeTemporaryExpr::MaterializeTemporaryExpr ( QualType  T,
Expr Temporary,
bool  BoundToLvalueReference 
) [inline]

Definition at line 3616 of file ExprCXX.h.

clang::MaterializeTemporaryExpr::MaterializeTemporaryExpr ( EmptyShell  Empty) [inline]

Definition at line 3625 of file ExprCXX.h.


Member Function Documentation

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

Reimplemented from clang::Stmt.

Definition at line 3650 of file ExprCXX.h.

static bool clang::MaterializeTemporaryExpr::classof ( const Stmt T) [inline, static]

Reimplemented from clang::Expr.

Definition at line 3642 of file ExprCXX.h.

References clang::Stmt::getStmtClass().

static bool clang::MaterializeTemporaryExpr::classof ( const MaterializeTemporaryExpr ) [inline, static]

Definition at line 3645 of file ExprCXX.h.

SourceRange clang::MaterializeTemporaryExpr::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 3638 of file ExprCXX.h.

References clang::Stmt::getSourceRange().

Expr* clang::MaterializeTemporaryExpr::GetTemporaryExpr ( ) const [inline]

Retrieve the temporary-generating subexpression whose value will be materialized into a glvalue.

Definition at line 3630 of file ExprCXX.h.

Referenced by clang::ento::ExprEngine::CreateCXXTemporaryObject().

bool clang::MaterializeTemporaryExpr::isBoundToLvalueReference ( ) const [inline]

Determine whether this materialized temporary is bound to an lvalue reference; otherwise, it's bound to an rvalue reference.

Definition at line 3634 of file ExprCXX.h.

References clang::Expr::getValueKind(), and clang::VK_LValue.


Friends And Related Function Documentation

friend class ASTStmtReader [friend]

Reimplemented from clang::Stmt.

Definition at line 3612 of file ExprCXX.h.

friend class ASTStmtWriter [friend]

Reimplemented from clang::Stmt.

Definition at line 3613 of file ExprCXX.h.


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