clang API Documentation

Public Member Functions | Static Public Member Functions
clang::ReturnStmt Class Reference

#include <Stmt.h>

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

List of all members.

Public Member Functions

 ReturnStmt (SourceLocation RL)
 ReturnStmt (SourceLocation RL, Expr *E, const VarDecl *NRVOCandidate)
 ReturnStmt (EmptyShell Empty)
 Build an empty return expression.
const ExprgetRetValue () const
ExprgetRetValue ()
void setRetValue (Expr *E)
SourceLocation getReturnLoc () const
void setReturnLoc (SourceLocation L)
const VarDeclgetNRVOCandidate () const
 Retrieve the variable that might be used for the named return value optimization.
void setNRVOCandidate (const VarDecl *Var)
SourceLocation getLocStart () const LLVM_READONLY
SourceLocation getLocEnd () const LLVM_READONLY
child_range children ()

Static Public Member Functions

static bool classof (const Stmt *T)

Detailed Description

ReturnStmt - This represents a return, optionally of an expression: return; return 4;

Note that GCC allows return with no argument in a function declared to return a value, and it allows returning a value in functions declared to return void. We explicitly model this in the AST, which means you can't depend on the return type of the function and the presence of an argument.

Definition at line 1343 of file Stmt.h.


Constructor & Destructor Documentation

Definition at line 1349 of file Stmt.h.

clang::ReturnStmt::ReturnStmt ( SourceLocation  RL,
Expr E,
const VarDecl NRVOCandidate 
) [inline]

Definition at line 1353 of file Stmt.h.

clang::ReturnStmt::ReturnStmt ( EmptyShell  Empty) [inline, explicit]

Build an empty return expression.

Definition at line 1358 of file Stmt.h.


Member Function Documentation

Reimplemented from clang::Stmt.

Definition at line 1385 of file Stmt.h.

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

Definition at line 1380 of file Stmt.h.

References clang::Stmt::getStmtClass().

Reimplemented from clang::Stmt.

Definition at line 1376 of file Stmt.h.

References clang::Stmt::getLocEnd().

const VarDecl* clang::ReturnStmt::getNRVOCandidate ( ) const [inline]

Retrieve the variable that might be used for the named return value optimization.

The optimization itself can only be performed if the variable is also marked as an NRVO object.

Definition at line 1372 of file Stmt.h.

Referenced by clang::Sema::BuildReturnStmt(), and clang::CodeGen::CodeGenFunction::EmitReturnStmt().

Definition at line 1364 of file Stmt.h.

Referenced by clang::consumed::ConsumedStmtVisitor::VisitReturnStmt().

const Expr * ReturnStmt::getRetValue ( ) const

Definition at line 1009 of file Stmt.cpp.

void clang::ReturnStmt::setNRVOCandidate ( const VarDecl Var) [inline]

Definition at line 1373 of file Stmt.h.

Definition at line 1365 of file Stmt.h.

void clang::ReturnStmt::setRetValue ( Expr E) [inline]

Definition at line 1362 of file Stmt.h.

Referenced by adjustBlockReturnsToEnum().


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