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 |
11 /// \brief Helpers for switch lowering. | 11 /// \brief Helpers for switch lowering. |
12 /// | 12 /// |
13 //===----------------------------------------------------------------------===// | 13 //===----------------------------------------------------------------------===// |
14 | 14 |
15 #ifndef SUBZERO_SRC_ICESWITCHLOWERING_H | 15 #ifndef SUBZERO_SRC_ICESWITCHLOWERING_H |
16 #define SUBZERO_SRC_ICESWITCHLOWERING_H | 16 #define SUBZERO_SRC_ICESWITCHLOWERING_H |
17 | 17 |
18 #include "IceDefs.h" | 18 #include "IceDefs.h" |
| 19 #include "IceStringPool.h" |
19 | 20 |
20 namespace Ice { | 21 namespace Ice { |
21 | 22 |
22 class CaseCluster; | 23 class CaseCluster; |
23 | 24 |
24 using CaseClusterArray = CfgVector<CaseCluster>; | 25 using CaseClusterArray = CfgVector<CaseCluster>; |
25 | 26 |
26 /// A cluster of cases can be tested by a common method during switch lowering. | 27 /// A cluster of cases can be tested by a common method during switch lowering. |
27 class CaseCluster { | 28 class CaseCluster { |
28 CaseCluster() = delete; | 29 CaseCluster() = delete; |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 | 78 |
78 /// Store the jump table data so that it can be emitted later in the correct ELF | 79 /// Store the jump table data so that it can be emitted later in the correct ELF |
79 /// section once the offsets from the start of the function are known. | 80 /// section once the offsets from the start of the function are known. |
80 class JumpTableData { | 81 class JumpTableData { |
81 JumpTableData() = delete; | 82 JumpTableData() = delete; |
82 JumpTableData &operator=(const JumpTableData &) = delete; | 83 JumpTableData &operator=(const JumpTableData &) = delete; |
83 | 84 |
84 public: | 85 public: |
85 using TargetList = std::vector<intptr_t>; | 86 using TargetList = std::vector<intptr_t>; |
86 | 87 |
87 JumpTableData(const IceString &FuncName, SizeT Id, | 88 JumpTableData(GlobalString FuncName, SizeT Id, |
88 const TargetList &TargetOffsets) | 89 const TargetList &TargetOffsets) |
89 : FuncName(FuncName), Id(Id), TargetOffsets(TargetOffsets) {} | 90 : FuncName(FuncName), Id(Id), TargetOffsets(TargetOffsets) {} |
90 JumpTableData(const JumpTableData &) = default; | 91 JumpTableData(const JumpTableData &) = default; |
91 JumpTableData(JumpTableData &&) = default; | 92 JumpTableData(JumpTableData &&) = default; |
92 JumpTableData &operator=(JumpTableData &&) = default; | 93 JumpTableData &operator=(JumpTableData &&) = default; |
93 | 94 |
94 const IceString &getFunctionName() const { return FuncName; } | 95 const GlobalString getFunctionName() const { return FuncName; } |
95 SizeT getId() const { return Id; } | 96 SizeT getId() const { return Id; } |
96 const TargetList &getTargetOffsets() const { return TargetOffsets; } | 97 const TargetList &getTargetOffsets() const { return TargetOffsets; } |
97 | 98 |
98 private: | 99 private: |
99 IceString FuncName; | 100 GlobalString FuncName; |
100 SizeT Id; | 101 SizeT Id; |
101 TargetList TargetOffsets; | 102 TargetList TargetOffsets; |
102 }; | 103 }; |
103 | 104 |
104 using JumpTableDataList = std::vector<JumpTableData>; | 105 using JumpTableDataList = std::vector<JumpTableData>; |
105 | 106 |
106 } // end of namespace Ice | 107 } // end of namespace Ice |
107 | 108 |
108 #endif // SUBZERO_SRC_ICESWITCHLOWERING_H | 109 #endif // SUBZERO_SRC_ICESWITCHLOWERING_H |
OLD | NEW |