OLD | NEW |
1 //===- subzero/src/IceTargetLowering.h - Lowering interface -----*- C++ -*-===// | 1 //===- subzero/src/IceTargetLowering.h - Lowering interface -----*- C++ -*-===// |
2 // | 2 // |
3 // The Subzero Code Generator | 3 // The Subzero Code Generator |
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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 }; | 129 }; |
130 | 130 |
131 class TargetLowering { | 131 class TargetLowering { |
132 TargetLowering() = delete; | 132 TargetLowering() = delete; |
133 TargetLowering(const TargetLowering &) = delete; | 133 TargetLowering(const TargetLowering &) = delete; |
134 TargetLowering &operator=(const TargetLowering &) = delete; | 134 TargetLowering &operator=(const TargetLowering &) = delete; |
135 | 135 |
136 public: | 136 public: |
137 // TODO(jvoung): return a unique_ptr like the other factory functions. | 137 // TODO(jvoung): return a unique_ptr like the other factory functions. |
138 static TargetLowering *createLowering(TargetArch Target, Cfg *Func); | 138 static TargetLowering *createLowering(TargetArch Target, Cfg *Func); |
| 139 static void staticInit(TargetArch Target); |
| 140 // Each target must define a public static method: |
| 141 // static void staticInit(); |
139 static std::unique_ptr<Assembler> createAssembler(TargetArch Target, | 142 static std::unique_ptr<Assembler> createAssembler(TargetArch Target, |
140 Cfg *Func); | 143 Cfg *Func); |
141 void translate() { | 144 void translate() { |
142 switch (Ctx->getFlags().getOptLevel()) { | 145 switch (Ctx->getFlags().getOptLevel()) { |
143 case Opt_m1: | 146 case Opt_m1: |
144 translateOm1(); | 147 translateOm1(); |
145 break; | 148 break; |
146 case Opt_0: | 149 case Opt_0: |
147 translateO0(); | 150 translateO0(); |
148 break; | 151 break; |
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
474 virtual void lower() {} | 477 virtual void lower() {} |
475 | 478 |
476 protected: | 479 protected: |
477 explicit TargetHeaderLowering(GlobalContext *Ctx) : Ctx(Ctx) {} | 480 explicit TargetHeaderLowering(GlobalContext *Ctx) : Ctx(Ctx) {} |
478 GlobalContext *Ctx; | 481 GlobalContext *Ctx; |
479 }; | 482 }; |
480 | 483 |
481 } // end of namespace Ice | 484 } // end of namespace Ice |
482 | 485 |
483 #endif // SUBZERO_SRC_ICETARGETLOWERING_H | 486 #endif // SUBZERO_SRC_ICETARGETLOWERING_H |
OLD | NEW |