LLVM 22.0.0git
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 >:
[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 3239 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 3246 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 3252 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 3271 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 3263 of file Instructions.h.

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

Referenced by llvm::sandboxir::SwitchInst::findCaseValue(), 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 3274 of file Instructions.h.

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

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

◆ SI

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

Definition at line 3248 of file Instructions.h.


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