clang  3.7.0
Public Member Functions | Static Public Member Functions | List of all members
clang::ReturnStmt Class Reference

#include <Stmt.h>

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

Public Member Functions

 ReturnStmt (SourceLocation RL)
 
 ReturnStmt (SourceLocation RL, Expr *E, const VarDecl *NRVOCandidate)
 
 ReturnStmt (EmptyShell Empty)
 Build an empty return expression. More...
 
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. More...
 
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 1351 of file Stmt.h.

Constructor & Destructor Documentation

clang::ReturnStmt::ReturnStmt ( SourceLocation  RL)
inlineexplicit

Definition at line 1357 of file Stmt.h.

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

Definition at line 1359 of file Stmt.h.

clang::ReturnStmt::ReturnStmt ( EmptyShell  Empty)
inlineexplicit

Build an empty return expression.

Definition at line 1364 of file Stmt.h.

Member Function Documentation

child_range clang::ReturnStmt::children ( )
inline

Definition at line 1391 of file Stmt.h.

static bool clang::ReturnStmt::classof ( const Stmt T)
inlinestatic

Definition at line 1386 of file Stmt.h.

SourceLocation clang::ReturnStmt::getLocEnd ( ) const
inline

Definition at line 1382 of file Stmt.h.

SourceLocation clang::ReturnStmt::getLocStart ( ) const
inline
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 1378 of file Stmt.h.

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

SourceLocation clang::ReturnStmt::getReturnLoc ( ) const
inline
const Expr * ReturnStmt::getRetValue ( ) const
Expr * ReturnStmt::getRetValue ( )

Definition at line 1016 of file Stmt.cpp.

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

Definition at line 1379 of file Stmt.h.

void clang::ReturnStmt::setReturnLoc ( SourceLocation  L)
inline

Definition at line 1371 of file Stmt.h.

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

Definition at line 1368 of file Stmt.h.

Referenced by adjustBlockReturnsToEnum().


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