LLVM  6.0.0svn
Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Friends | List of all members
llvm::SwitchInst::CaseHandleImpl< SwitchInstT, ConstantIntT, BasicBlockT > Class Template Reference

A handle to a particular switch case. More...

#include "llvm/IR/Instructions.h"

Inheritance diagram for llvm::SwitchInst::CaseHandleImpl< SwitchInstT, ConstantIntT, BasicBlockT >:
Inheritance graph
[legend]
Collaboration diagram for llvm::SwitchInst::CaseHandleImpl< SwitchInstT, ConstantIntT, BasicBlockT >:
Collaboration graph
[legend]

Public Member Functions

ConstantIntT * getCaseValue () const
 Resolves case value for current case. More...
 
BasicBlockT * getCaseSuccessor () const
 Resolves successor for current case. More...
 
unsigned getCaseIndex () const
 Returns number of current case. More...
 
unsigned getSuccessorIndex () const
 Returns TerminatorInst's successor index for current case successor. More...
 
bool operator== (const CaseHandleImpl &RHS) const
 

Protected Types

using SwitchInstType = SwitchInstT
 

Protected Member Functions

 CaseHandleImpl ()=default
 
 CaseHandleImpl (SwitchInstT *SI, ptrdiff_t Index)
 

Protected Attributes

SwitchInstT * SI
 
ptrdiff_t Index
 

Friends

class SwitchInst::CaseIteratorImpl< CaseHandleImpl< SwitchInstT, ConstantIntT, BasicBlockT > >
 

Detailed Description

template<typename SwitchInstT, typename ConstantIntT, typename BasicBlockT>
class llvm::SwitchInst::CaseHandleImpl< SwitchInstT, ConstantIntT, BasicBlockT >

A handle to a particular switch case.

It exposes a convenient interface to both the case value and the successor block.

We define this as a template and instantiate it to form both a const and non-const handle.

Definition at line 3144 of file Instructions.h.

Member Typedef Documentation

◆ SwitchInstType

template<typename SwitchInstT, typename ConstantIntT, typename BasicBlockT>
using llvm::SwitchInst::CaseHandleImpl< SwitchInstT, ConstantIntT, BasicBlockT >::SwitchInstType = SwitchInstT
protected

Definition at line 3151 of file Instructions.h.

Constructor & Destructor Documentation

◆ CaseHandleImpl() [1/2]

template<typename SwitchInstT, typename ConstantIntT, typename BasicBlockT>
llvm::SwitchInst::CaseHandleImpl< SwitchInstT, ConstantIntT, BasicBlockT >::CaseHandleImpl ( )
protecteddefault

◆ CaseHandleImpl() [2/2]

template<typename SwitchInstT, typename ConstantIntT, typename BasicBlockT>
llvm::SwitchInst::CaseHandleImpl< SwitchInstT, ConstantIntT, BasicBlockT >::CaseHandleImpl ( SwitchInstT *  SI,
ptrdiff_t  Index 
)
inlineprotected

Definition at line 3157 of file Instructions.h.

Member Function Documentation

◆ getCaseIndex()

template<typename SwitchInstT, typename ConstantIntT, typename BasicBlockT>
unsigned llvm::SwitchInst::CaseHandleImpl< SwitchInstT, ConstantIntT, BasicBlockT >::getCaseIndex ( ) const
inline

Returns number of current case.

Definition at line 3176 of file Instructions.h.

Referenced by handleSwitchExpect().

◆ getCaseSuccessor()

template<typename SwitchInstT, typename ConstantIntT, typename BasicBlockT>
BasicBlockT* llvm::SwitchInst::CaseHandleImpl< SwitchInstT, ConstantIntT, BasicBlockT >::getCaseSuccessor ( ) const
inline

Resolves successor for current case.

Definition at line 3168 of file Instructions.h.

Referenced by llvm::CloneFunction(), and ReplaceUsesOfWith().

◆ getCaseValue()

template<typename SwitchInstT, typename ConstantIntT, typename BasicBlockT>
ConstantIntT* llvm::SwitchInst::CaseHandleImpl< SwitchInstT, ConstantIntT, BasicBlockT >::getCaseValue ( ) const
inline

Resolves case value for current case.

Definition at line 3161 of file Instructions.h.

Referenced by llvm::SwitchInst::findCaseValue().

◆ getSuccessorIndex()

template<typename SwitchInstT, typename ConstantIntT, typename BasicBlockT>
unsigned llvm::SwitchInst::CaseHandleImpl< SwitchInstT, ConstantIntT, BasicBlockT >::getSuccessorIndex ( ) const
inline

Returns TerminatorInst's successor index for current case successor.

Definition at line 3179 of file Instructions.h.

Referenced by llvm::SparseSolver< LatticeKey, LatticeVal, KeyInfo >::MarkBlockExecutable().

◆ operator==()

template<typename SwitchInstT, typename ConstantIntT, typename BasicBlockT>
bool llvm::SwitchInst::CaseHandleImpl< SwitchInstT, ConstantIntT, BasicBlockT >::operator== ( const CaseHandleImpl< SwitchInstT, ConstantIntT, BasicBlockT > &  RHS) const
inline

Definition at line 3186 of file Instructions.h.

Friends And Related Function Documentation

◆ SwitchInst::CaseIteratorImpl< CaseHandleImpl< SwitchInstT, ConstantIntT, BasicBlockT > >

template<typename SwitchInstT, typename ConstantIntT, typename BasicBlockT>
friend class SwitchInst::CaseIteratorImpl< CaseHandleImpl< SwitchInstT, ConstantIntT, BasicBlockT > >
friend

Definition at line 3147 of file Instructions.h.

Member Data Documentation

◆ Index

template<typename SwitchInstT, typename ConstantIntT, typename BasicBlockT>
ptrdiff_t llvm::SwitchInst::CaseHandleImpl< SwitchInstT, ConstantIntT, BasicBlockT >::Index
protected

◆ SI

template<typename SwitchInstT, typename ConstantIntT, typename BasicBlockT>
SwitchInstT* llvm::SwitchInst::CaseHandleImpl< SwitchInstT, ConstantIntT, BasicBlockT >::SI
protected

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