OLD | NEW |
1 //===- subzero/src/IceSwitchLowering.h - Switch lowering --------*- C++ -*-===// | 1 //===- subzero/src/IceSwitchLowering.h - Switch lowering --------*- C++ -*-===// |
2 // | 2 // |
3 // The LLVM Compiler Infrastructure | 3 // The LLVM Compiler Infrastructure |
4 // | 4 // |
5 // This file is distributed under the University of Illinois Open Source | 5 // This file is distributed under the University of Illinois Open Source |
6 // License. See LICENSE.TXT for details. | 6 // License. See LICENSE.TXT for details. |
7 // | 7 // |
8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
9 /// | 9 /// |
10 /// \file | 10 /// \file |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 InstJumpTable *getJumpTable() const { | 53 InstJumpTable *getJumpTable() const { |
54 assert(Kind == JumpTable); | 54 assert(Kind == JumpTable); |
55 return JT; | 55 return JT; |
56 } | 56 } |
57 | 57 |
58 bool isUnitRange() const { return Low == High; } | 58 bool isUnitRange() const { return Low == High; } |
59 bool isPairRange() const { return Low == High - 1; } | 59 bool isPairRange() const { return Low == High - 1; } |
60 | 60 |
61 /// Discover cases which can be clustered together and return the clusters | 61 /// Discover cases which can be clustered together and return the clusters |
62 /// ordered by case value. | 62 /// ordered by case value. |
63 static CaseClusterArray clusterizeSwitch(Cfg *Func, const InstSwitch *Inst); | 63 static CaseClusterArray clusterizeSwitch(Cfg *Func, const InstSwitch *Instr); |
64 | 64 |
65 private: | 65 private: |
66 CaseClusterKind Kind; | 66 CaseClusterKind Kind; |
67 uint64_t Low; | 67 uint64_t Low; |
68 uint64_t High; | 68 uint64_t High; |
69 union { | 69 union { |
70 CfgNode *Target; /// Target for a range. | 70 CfgNode *Target; /// Target for a range. |
71 InstJumpTable *JT; /// Jump table targets. | 71 InstJumpTable *JT; /// Jump table targets. |
72 }; | 72 }; |
73 | 73 |
(...skipping 25 matching lines...) Expand all Loading... |
99 IceString FuncName; | 99 IceString FuncName; |
100 SizeT Id; | 100 SizeT Id; |
101 TargetList TargetOffsets; | 101 TargetList TargetOffsets; |
102 }; | 102 }; |
103 | 103 |
104 using JumpTableDataList = std::vector<JumpTableData>; | 104 using JumpTableDataList = std::vector<JumpTableData>; |
105 | 105 |
106 } // end of namespace Ice | 106 } // end of namespace Ice |
107 | 107 |
108 #endif // SUBZERO_SRC_ICESWITCHLOWERING_H | 108 #endif // SUBZERO_SRC_ICESWITCHLOWERING_H |
OLD | NEW |