| 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 The file contains helpers for switch lowering. | 11 /// \brief The file contains helpers for switch lowering. |
| 12 //===----------------------------------------------------------------------===// | 12 //===----------------------------------------------------------------------===// |
| 13 | 13 |
| 14 #ifndef SUBZERO_SRC_ICESWITCHLOWERING_H | 14 #ifndef SUBZERO_SRC_ICESWITCHLOWERING_H |
| 15 #define SUBZERO_SRC_ICESWITCHLOWERING_H | 15 #define SUBZERO_SRC_ICESWITCHLOWERING_H |
| 16 | 16 |
| 17 #include "IceDefs.h" | 17 #include "IceDefs.h" |
| 18 | 18 |
| 19 namespace Ice { | 19 namespace Ice { |
| 20 | 20 |
| 21 class CaseCluster; | 21 class CaseCluster; |
| 22 | 22 |
| 23 using CaseClusterArray = | 23 using CaseClusterArray = CfgVector<CaseCluster>; |
| 24 std::vector<CaseCluster, CfgLocalAllocator<CaseCluster>>; | |
| 25 | 24 |
| 26 /// A cluster of cases can be tested by a common method during switch lowering. | 25 /// A cluster of cases can be tested by a common method during switch lowering. |
| 27 class CaseCluster { | 26 class CaseCluster { |
| 28 CaseCluster() = delete; | 27 CaseCluster() = delete; |
| 29 | 28 |
| 30 public: | 29 public: |
| 31 enum CaseClusterKind { | 30 enum CaseClusterKind { |
| 32 Range, /// Numerically adjacent case values with same target. | 31 Range, /// Numerically adjacent case values with same target. |
| 33 JumpTable, /// Different targets and possibly sparse. | 32 JumpTable, /// Different targets and possibly sparse. |
| 34 }; | 33 }; |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 IceString FuncName; | 101 IceString FuncName; |
| 103 SizeT Id; | 102 SizeT Id; |
| 104 std::vector<intptr_t> TargetOffsets; | 103 std::vector<intptr_t> TargetOffsets; |
| 105 }; | 104 }; |
| 106 | 105 |
| 107 using JumpTableDataList = std::vector<JumpTableData>; | 106 using JumpTableDataList = std::vector<JumpTableData>; |
| 108 | 107 |
| 109 } // end of namespace Ice | 108 } // end of namespace Ice |
| 110 | 109 |
| 111 #endif // SUBZERO_SRC_ICESWITCHLOWERING_H | 110 #endif // SUBZERO_SRC_ICESWITCHLOWERING_H |
| OLD | NEW |