| 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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 }; | 72 }; |
| 73 | 73 |
| 74 /// Try and append a cluster returning whether or not it was successful. | 74 /// Try and append a cluster returning whether or not it was successful. |
| 75 bool tryAppend(const CaseCluster &New); | 75 bool tryAppend(const CaseCluster &New); |
| 76 }; | 76 }; |
| 77 | 77 |
| 78 /// Store the jump table data so that it can be emitted later in the correct | 78 /// Store the jump table data so that it can be emitted later in the correct |
| 79 /// ELF section once the offsets from the start of the function are known. | 79 /// ELF section once the offsets from the start of the function are known. |
| 80 class JumpTableData { | 80 class JumpTableData { |
| 81 JumpTableData() = delete; | 81 JumpTableData() = delete; |
| 82 JumpTableData(const JumpTableData &) = delete; | |
| 83 JumpTableData &operator=(const JumpTableData &) = delete; | 82 JumpTableData &operator=(const JumpTableData &) = delete; |
| 84 | 83 |
| 85 public: | 84 public: |
| 86 JumpTableData(IceString FuncName, SizeT Id, SizeT NumTargets) | 85 JumpTableData(IceString FuncName, SizeT Id, SizeT NumTargets) |
| 87 : FuncName(FuncName), Id(Id) { | 86 : FuncName(FuncName), Id(Id) { |
| 88 TargetOffsets.reserve(NumTargets); | 87 TargetOffsets.reserve(NumTargets); |
| 89 } | 88 } |
| 89 JumpTableData(const JumpTableData &) = default; |
| 90 JumpTableData(JumpTableData &&) = default; | 90 JumpTableData(JumpTableData &&) = default; |
| 91 JumpTableData &operator=(JumpTableData &&) = default; |
| 91 | 92 |
| 92 void pushTarget(intptr_t Offset) { TargetOffsets.emplace_back(Offset); } | 93 void pushTarget(intptr_t Offset) { TargetOffsets.emplace_back(Offset); } |
| 93 | 94 |
| 94 const IceString &getFunctionName() const { return FuncName; } | 95 const IceString &getFunctionName() const { return FuncName; } |
| 95 SizeT getId() const { return Id; } | 96 SizeT getId() const { return Id; } |
| 96 const std::vector<intptr_t> &getTargetOffsets() const { | 97 const std::vector<intptr_t> &getTargetOffsets() const { |
| 97 return TargetOffsets; | 98 return TargetOffsets; |
| 98 } | 99 } |
| 99 | 100 |
| 100 private: | 101 private: |
| 101 const IceString FuncName; | 102 IceString FuncName; |
| 102 const SizeT Id; | 103 SizeT Id; |
| 103 std::vector<intptr_t> TargetOffsets; | 104 std::vector<intptr_t> TargetOffsets; |
| 104 }; | 105 }; |
| 105 | 106 |
| 106 using JumpTableDataList = std::vector<JumpTableData>; | 107 using JumpTableDataList = std::vector<JumpTableData>; |
| 107 | 108 |
| 108 } // end of namespace Ice | 109 } // end of namespace Ice |
| 109 | 110 |
| 110 #endif // SUBZERO_SRC_ICESWITCHLOWERING_H | 111 #endif // SUBZERO_SRC_ICESWITCHLOWERING_H |
| OLD | NEW |