LLVM  10.0.0svn
Classes | Typedefs | Enumerations | Functions
llvm::SwitchCG Namespace Reference

Classes

struct  BitTestBlock
 
struct  BitTestCase
 
struct  CaseBits
 
struct  CaseBlock
 This structure is used to communicate between SelectionDAGBuilder and SDISel for the code generation of additional basic blocks needed by multi-case switch statements. More...
 
struct  CaseCluster
 A cluster of case labels. More...
 
struct  JumpTable
 
struct  JumpTableHeader
 
class  SwitchLowering
 
struct  SwitchWorkListItem
 

Typedefs

using CaseClusterVector = std::vector< CaseCluster >
 
using CaseClusterIt = CaseClusterVector::iterator
 
using CaseBitsVector = std::vector< CaseBits >
 
using JumpTableBlock = std::pair< JumpTableHeader, JumpTable >
 
using BitTestInfo = SmallVector< BitTestCase, 3 >
 
using SwitchWorkList = SmallVector< SwitchWorkListItem, 4 >
 

Enumerations

enum  CaseClusterKind { CC_Range, CC_JumpTable, CC_BitTests }
 

Functions

void sortAndRangeify (CaseClusterVector &Clusters)
 Sort Clusters and merge adjacent cases. More...
 
uint64_t getJumpTableRange (const CaseClusterVector &Clusters, unsigned First, unsigned Last)
 Return the range of value within a range. More...
 
uint64_t getJumpTableNumCases (const SmallVectorImpl< unsigned > &TotalCases, unsigned First, unsigned Last)
 Return the number of cases within a range. More...
 

Typedef Documentation

◆ BitTestInfo

Definition at line 200 of file SwitchLoweringUtils.h.

◆ CaseBitsVector

using llvm::SwitchCG::CaseBitsVector = typedef std::vector<CaseBits>

Definition at line 98 of file SwitchLoweringUtils.h.

◆ CaseClusterIt

using llvm::SwitchCG::CaseClusterIt = typedef CaseClusterVector::iterator

Definition at line 81 of file SwitchLoweringUtils.h.

◆ CaseClusterVector

using llvm::SwitchCG::CaseClusterVector = typedef std::vector<CaseCluster>

Definition at line 80 of file SwitchLoweringUtils.h.

◆ JumpTableBlock

Definition at line 187 of file SwitchLoweringUtils.h.

◆ SwitchWorkList

Definition at line 240 of file SwitchLoweringUtils.h.

Enumeration Type Documentation

◆ CaseClusterKind

Enumerator
CC_Range 

A cluster of adjacent case labels with the same destination, or just one case.

CC_JumpTable 

A cluster of cases suitable for jump table lowering.

CC_BitTests 

A cluster of cases suitable for bit test lowering.

Definition at line 25 of file SwitchLoweringUtils.h.

Function Documentation

◆ getJumpTableNumCases()

uint64_t llvm::SwitchCG::getJumpTableNumCases ( const SmallVectorImpl< unsigned > &  TotalCases,
unsigned  First,
unsigned  Last 
)

Return the number of cases within a range.

Definition at line 34 of file SwitchLoweringUtils.cpp.

References assert().

Referenced by llvm::SwitchCG::BitTestBlock::BitTestBlock(), and llvm::SwitchCG::SwitchLowering::findJumpTables().

◆ getJumpTableRange()

uint64_t llvm::SwitchCG::getJumpTableRange ( const CaseClusterVector Clusters,
unsigned  First,
unsigned  Last 
)

Return the range of value within a range.

Definition at line 20 of file SwitchLoweringUtils.cpp.

References assert(), llvm::APInt::getBitWidth(), and UINT64_MAX.

Referenced by llvm::SwitchCG::BitTestBlock::BitTestBlock(), and llvm::SwitchCG::SwitchLowering::findJumpTables().

◆ sortAndRangeify()

void llvm::SwitchCG::sortAndRangeify ( CaseClusterVector Clusters)