clang API Documentation
#include <Stmt.h>
Public Member Functions | |
ReturnStmt (SourceLocation RL) | |
ReturnStmt (SourceLocation RL, Expr *E, const VarDecl *NRVOCandidate) | |
ReturnStmt (EmptyShell Empty) | |
Build an empty return expression. | |
const Expr * | getRetValue () const |
Expr * | getRetValue () |
void | setRetValue (Expr *E) |
SourceLocation | getReturnLoc () const |
void | setReturnLoc (SourceLocation L) |
const VarDecl * | getNRVOCandidate () 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) |
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.
clang::ReturnStmt::ReturnStmt | ( | SourceLocation | RL | ) | [inline] |
clang::ReturnStmt::ReturnStmt | ( | SourceLocation | RL, |
Expr * | E, | ||
const VarDecl * | NRVOCandidate | ||
) | [inline] |
clang::ReturnStmt::ReturnStmt | ( | EmptyShell | Empty | ) | [inline, explicit] |
child_range clang::ReturnStmt::children | ( | ) | [inline] |
Reimplemented from clang::Stmt.
static bool clang::ReturnStmt::classof | ( | const Stmt * | T | ) | [inline, static] |
Definition at line 1380 of file Stmt.h.
References clang::Stmt::getStmtClass().
SourceLocation clang::ReturnStmt::getLocEnd | ( | ) | const [inline] |
Reimplemented from clang::Stmt.
Definition at line 1376 of file Stmt.h.
References clang::Stmt::getLocEnd().
SourceLocation clang::ReturnStmt::getLocStart | ( | ) | const [inline] |
Reimplemented from clang::Stmt.
Definition at line 1375 of file Stmt.h.
Referenced by clang::Sema::deduceClosureReturnType(), and clang::consumed::ConsumedStmtVisitor::VisitReturnStmt().
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().
SourceLocation clang::ReturnStmt::getReturnLoc | ( | ) | const [inline] |
Definition at line 1364 of file Stmt.h.
Referenced by clang::consumed::ConsumedStmtVisitor::VisitReturnStmt().
const Expr * ReturnStmt::getRetValue | ( | ) | const |
Definition at line 1006 of file Stmt.cpp.
Referenced by adjustBlockReturnsToEnum(), clang::Sema::deduceClosureReturnType(), clang::CodeGen::CodeGenFunction::EmitReturnStmt(), findEnumForBlockReturn(), clang::ento::Environment::getSVal(), isIdenticalStmt(), clang::ento::ExprEngine::VisitReturnStmt(), and clang::consumed::ConsumedStmtVisitor::VisitReturnStmt().
Expr * ReturnStmt::getRetValue | ( | ) |
void clang::ReturnStmt::setNRVOCandidate | ( | const VarDecl * | Var | ) | [inline] |
void clang::ReturnStmt::setReturnLoc | ( | SourceLocation | L | ) | [inline] |
void clang::ReturnStmt::setRetValue | ( | Expr * | E | ) | [inline] |
Definition at line 1362 of file Stmt.h.
Referenced by adjustBlockReturnsToEnum().