clang
3.9.0
|
IfStmt - This represents an if/then/else. More...
#include <Stmt.h>
Public Member Functions | |
IfStmt (const ASTContext &C, SourceLocation IL, bool IsConstexpr, Stmt *init, VarDecl *var, Expr *cond, Stmt *then, SourceLocation EL=SourceLocation(), Stmt *elsev=nullptr) | |
IfStmt (EmptyShell Empty) | |
Build an empty if/then/else statement. More... | |
VarDecl * | getConditionVariable () const |
Retrieve the variable declared in this "if" statement, if any. More... | |
void | setConditionVariable (const ASTContext &C, VarDecl *V) |
const DeclStmt * | getConditionVariableDeclStmt () const |
If this IfStmt has a condition variable, return the faux DeclStmt associated with the creation of that condition variable. More... | |
Stmt * | getInit () |
const Stmt * | getInit () const |
void | setInit (Stmt *S) |
const Expr * | getCond () const |
void | setCond (Expr *E) |
const Stmt * | getThen () const |
void | setThen (Stmt *S) |
const Stmt * | getElse () const |
void | setElse (Stmt *S) |
Expr * | getCond () |
Stmt * | getThen () |
Stmt * | getElse () |
SourceLocation | getIfLoc () const |
void | setIfLoc (SourceLocation L) |
SourceLocation | getElseLoc () const |
void | setElseLoc (SourceLocation L) |
bool | isConstexpr () const |
void | setConstexpr (bool C) |
SourceLocation | getLocStart () const LLVM_READONLY |
SourceLocation | getLocEnd () const LLVM_READONLY |
child_range | children () |
Static Public Member Functions | |
static bool | classof (const Stmt *T) |
IfStmt::IfStmt | ( | const ASTContext & | C, |
SourceLocation | IL, | ||
bool | IsConstexpr, | ||
Stmt * | init, | ||
VarDecl * | var, | ||
Expr * | cond, | ||
Stmt * | then, | ||
SourceLocation | EL = SourceLocation() , |
||
Stmt * | elsev = nullptr |
||
) |
Definition at line 766 of file Stmt.cpp.
References setConditionVariable(), and setConstexpr().
|
inlineexplicit |
|
inline |
Definition at line 917 of file Stmt.h.
Referenced by DiagUninitUse(), clang::CodeGen::CodeGenFunction::EmitIfStmt(), EvaluateStmt(), isIdenticalStmt(), and clang::ASTNodeImporter::VisitIfStmt().
VarDecl * IfStmt::getConditionVariable | ( | ) | const |
Retrieve the variable declared in this "if" statement, if any.
In the following example, "x" is the condition variable.
Definition at line 778 of file Stmt.cpp.
References clang::DeclStmt::getSingleDecl().
Referenced by clang::CodeGen::CodeGenFunction::EmitIfStmt(), EvaluateStmt(), and clang::ASTNodeImporter::VisitIfStmt().
|
inline |
|
inline |
Definition at line 921 of file Stmt.h.
Referenced by CheckConstexprFunctionStmt(), DiagUninitUse(), clang::CodeGen::CodeGenFunction::EmitIfStmt(), EvaluateStmt(), isIdenticalStmt(), and clang::ASTNodeImporter::VisitIfStmt().
|
inline |
Definition at line 930 of file Stmt.h.
Referenced by clang::ASTNodeImporter::VisitIfStmt().
|
inline |
Definition at line 928 of file Stmt.h.
Referenced by clang::ASTNodeImporter::VisitIfStmt().
|
inline |
Definition at line 914 of file Stmt.h.
Referenced by clang::CodeGen::CodeGenFunction::EmitIfStmt(), EvaluateStmt(), and clang::ASTNodeImporter::VisitIfStmt().
|
inline |
|
inline |
|
inline |
Definition at line 919 of file Stmt.h.
Referenced by CheckConstexprFunctionStmt(), DiagUninitUse(), clang::CodeGen::CodeGenFunction::EmitIfStmt(), EvaluateStmt(), isIdenticalStmt(), and clang::ASTNodeImporter::VisitIfStmt().
|
inline |
Definition at line 933 of file Stmt.h.
Referenced by clang::CodeGen::CodeGenFunction::EmitIfStmt(), and clang::ASTNodeImporter::VisitIfStmt().
void IfStmt::setConditionVariable | ( | const ASTContext & | C, |
VarDecl * | V | ||
) |
Definition at line 786 of file Stmt.cpp.
References clang::SourceRange::getBegin(), clang::SourceRange::getEnd(), and clang::VarDecl::getSourceRange().
Referenced by IfStmt().
|
inline |
|
inline |
|
inline |