Chromium Code Reviews| 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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 74 bool tryAppend(const CaseCluster &New); | 74 bool tryAppend(const CaseCluster &New); |
| 75 }; | 75 }; |
| 76 | 76 |
| 77 /// Store the jump table data so that it can be emitted later in the correct ELF | 77 /// Store the jump table data so that it can be emitted later in the correct ELF |
| 78 /// section once the offsets from the start of the function are known. | 78 /// section once the offsets from the start of the function are known. |
| 79 class JumpTableData { | 79 class JumpTableData { |
| 80 JumpTableData() = delete; | 80 JumpTableData() = delete; |
| 81 JumpTableData &operator=(const JumpTableData &) = delete; | 81 JumpTableData &operator=(const JumpTableData &) = delete; |
| 82 | 82 |
| 83 public: | 83 public: |
| 84 JumpTableData(IceString FuncName, SizeT Id, SizeT NumTargets) | 84 using TargetList = std::vector<intptr_t>; |
| 85 : FuncName(FuncName), Id(Id) { | 85 |
| 86 TargetOffsets.reserve(NumTargets); | 86 JumpTableData(IceString FuncName, SizeT Id, const TargetList &TargetOffsets) |
|
Jim Stichnoth
2015/11/20 01:02:20
const IceString &FuncName
sehr
2015/11/20 05:43:15
Done.
| |
| 87 } | 87 : FuncName(FuncName), Id(Id), TargetOffsets(TargetOffsets) { } |
| 88 JumpTableData(const JumpTableData &) = default; | 88 JumpTableData(const JumpTableData &) = default; |
| 89 JumpTableData(JumpTableData &&) = default; | 89 JumpTableData(JumpTableData &&) = default; |
| 90 JumpTableData &operator=(JumpTableData &&) = default; | 90 JumpTableData &operator=(JumpTableData &&) = default; |
| 91 | 91 |
| 92 void pushTarget(intptr_t Offset) { TargetOffsets.emplace_back(Offset); } | 92 void pushTarget(intptr_t Offset) { TargetOffsets.emplace_back(Offset); } |
| 93 | 93 |
| 94 const IceString &getFunctionName() const { return FuncName; } | 94 const IceString &getFunctionName() const { return FuncName; } |
| 95 SizeT getId() const { return Id; } | 95 SizeT getId() const { return Id; } |
| 96 const std::vector<intptr_t> &getTargetOffsets() const { | 96 const TargetList &getTargetOffsets() const { |
| 97 return TargetOffsets; | 97 return TargetOffsets; |
| 98 } | 98 } |
| 99 | 99 |
| 100 private: | 100 private: |
| 101 IceString FuncName; | 101 IceString FuncName; |
|
Jim Stichnoth
2015/11/20 01:02:20
Can this be const IceString?
sehr
2015/11/20 05:43:15
Looks like move operations don't work if I do this
| |
| 102 SizeT Id; | 102 SizeT Id; |
| 103 std::vector<intptr_t> TargetOffsets; | 103 TargetList TargetOffsets; |
| 104 }; | 104 }; |
| 105 | 105 |
| 106 using JumpTableDataList = std::vector<JumpTableData>; | 106 using JumpTableDataList = std::vector<JumpTableData>; |
| 107 | 107 |
| 108 } // end of namespace Ice | 108 } // end of namespace Ice |
| 109 | 109 |
| 110 #endif // SUBZERO_SRC_ICESWITCHLOWERING_H | 110 #endif // SUBZERO_SRC_ICESWITCHLOWERING_H |
| OLD | NEW |