clang API Documentation

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

#include <Stmt.h>

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

List of all members.

Public Member Functions

 SwitchStmt (const ASTContext &C, VarDecl *Var, Expr *cond)
 SwitchStmt (EmptyShell Empty)
 Build a empty switch statement.
VarDeclgetConditionVariable () const
 Retrieve the variable declared in this "switch" statement, if any.
void setConditionVariable (const ASTContext &C, VarDecl *V)
const DeclStmtgetConditionVariableDeclStmt () const
const ExprgetCond () const
const StmtgetBody () const
const SwitchCasegetSwitchCaseList () const
ExprgetCond ()
void setCond (Expr *E)
StmtgetBody ()
void setBody (Stmt *S)
SwitchCasegetSwitchCaseList ()
void setSwitchCaseList (SwitchCase *SC)
 Set the case list for this switch statement.
SourceLocation getSwitchLoc () const
void setSwitchLoc (SourceLocation L)
void setBody (Stmt *S, SourceLocation SL)
void addSwitchCase (SwitchCase *SC)
void setAllEnumCasesCovered ()
bool isAllEnumCasesCovered () const
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

SwitchStmt - This represents a 'switch' stmt.

Definition at line 941 of file Stmt.h.


Constructor & Destructor Documentation

SwitchStmt::SwitchStmt ( const ASTContext C,
VarDecl Var,
Expr cond 
)

Definition at line 936 of file Stmt.cpp.

References setConditionVariable().

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

Build a empty switch statement.

Definition at line 957 of file Stmt.h.


Member Function Documentation

Reimplemented from clang::Stmt.

Definition at line 1022 of file Stmt.h.

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

Definition at line 1026 of file Stmt.h.

References clang::Stmt::getStmtClass().

const Stmt* clang::SwitchStmt::getBody ( ) const [inline]

Definition at line 983 of file Stmt.h.

const Expr* clang::SwitchStmt::getCond ( ) const [inline]

Definition at line 981 of file Stmt.h.

Retrieve the variable declared in this "switch" statement, if any.

In the following example, "x" is the condition variable.

 switch (int x = foo()) {
   case 0: break;
   // ...
 }

Definition at line 944 of file Stmt.cpp.

References clang::DeclStmt::getSingleDecl().

Referenced by clang::CodeGen::CodeGenFunction::EmitSwitchStmt(), and EvaluateSwitch().

If this SwitchStmt has a condition variable, return the faux DeclStmt associated with the creation of that condition variable.

Definition at line 973 of file Stmt.h.

Reimplemented from clang::Stmt.

Definition at line 1017 of file Stmt.h.

References clang::Stmt::getLocEnd().

Reimplemented from clang::Stmt.

Definition at line 1016 of file Stmt.h.

Definition at line 985 of file Stmt.h.

Definition at line 990 of file Stmt.h.

Returns true if the SwitchStmt is a switch of an enum value and all cases have been explicitly covered.

Definition at line 1012 of file Stmt.h.

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

Set a flag in the SwitchStmt indicating that if the 'switch (X)' is a switch over an enum value then all cases have been explicitly covered.

Definition at line 1006 of file Stmt.h.

Referenced by clang::Sema::ActOnFinishSwitchStmt().

void clang::SwitchStmt::setBody ( Stmt S) [inline]

Definition at line 984 of file Stmt.h.

References S.

Referenced by clang::Sema::ActOnFinishSwitchStmt().

void clang::SwitchStmt::setBody ( Stmt S,
SourceLocation  SL 
) [inline]

Definition at line 993 of file Stmt.h.

References S.

void clang::SwitchStmt::setCond ( Expr E) [inline]

Definition at line 982 of file Stmt.h.

void SwitchStmt::setConditionVariable ( const ASTContext C,
VarDecl V 
)

Set the case list for this switch statement.

Definition at line 988 of file Stmt.h.

Definition at line 991 of file Stmt.h.


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