LLVM 19.0.0git
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]

Public Member Functions

ConstantIntT * getCaseValue () const
 Resolves case value for current case.
 
BasicBlockT * getCaseSuccessor () const
 Resolves successor for current case.
 
unsigned getCaseIndex () const
 Returns number of current case.
 
unsigned getSuccessorIndex () const
 Returns successor index for current case successor.
 
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 3644 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 3651 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 3657 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 3676 of file Instructions.h.

References Index.

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 3668 of file Instructions.h.

References assert(), and SI().

Referenced by unswitchTrivialSwitch().

◆ 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 3661 of file Instructions.h.

References assert(), and SI().

Referenced by llvm::SwitchInst::findCaseValue(), and unswitchTrivialSwitch().

◆ getSuccessorIndex()

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

Returns successor index for current case successor.

Definition at line 3679 of file Instructions.h.

References assert().

Referenced by unswitchTrivialSwitch().

◆ 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 3686 of file Instructions.h.

References assert(), RHS, and SI().

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 3942 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

Definition at line 3654 of file Instructions.h.

◆ SI

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

Definition at line 3653 of file Instructions.h.


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