| 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 // This file declares the TargetLowering and LoweringContext | 10 // This file declares the TargetLowering and LoweringContext |
| 11 // classes. TargetLowering is an abstract class used to drive the | 11 // classes. TargetLowering is an abstract class used to drive the |
| 12 // translation/lowering process. LoweringContext maintains a | 12 // translation/lowering process. LoweringContext maintains a |
| 13 // context for lowering each instruction, offering conveniences such | 13 // context for lowering each instruction, offering conveniences such |
| 14 // as iterating over non-deleted instructions. | 14 // as iterating over non-deleted instructions. |
| 15 // | 15 // |
| 16 //===----------------------------------------------------------------------===// | 16 //===----------------------------------------------------------------------===// |
| 17 | 17 |
| 18 #ifndef SUBZERO_SRC_ICETARGETLOWERING_H | 18 #ifndef SUBZERO_SRC_ICETARGETLOWERING_H |
| 19 #define SUBZERO_SRC_ICETARGETLOWERING_H | 19 #define SUBZERO_SRC_ICETARGETLOWERING_H |
| 20 | 20 |
| 21 #include "IceDefs.h" | 21 #include "IceDefs.h" |
| 22 #include "IceTypes.h" | 22 #include "IceTypes.h" |
| 23 | 23 |
| 24 #include "IceInst.h" // for the names of the Inst subtypes | 24 #include "IceInst.h" // for the names of the Inst subtypes |
| 25 | 25 |
| 26 namespace Ice { | 26 namespace Ice { |
| 27 | 27 |
| 28 class Assembler; |
| 29 |
| 28 // LoweringContext makes it easy to iterate through non-deleted | 30 // LoweringContext makes it easy to iterate through non-deleted |
| 29 // instructions in a node, and insert new (lowered) instructions at | 31 // instructions in a node, and insert new (lowered) instructions at |
| 30 // the current point. Along with the instruction list container and | 32 // the current point. Along with the instruction list container and |
| 31 // associated iterators, it holds the current node, which is needed | 33 // associated iterators, it holds the current node, which is needed |
| 32 // when inserting new instructions in order to track whether variables | 34 // when inserting new instructions in order to track whether variables |
| 33 // are used as single-block or multi-block. | 35 // are used as single-block or multi-block. |
| 34 class LoweringContext { | 36 class LoweringContext { |
| 35 public: | 37 public: |
| 36 LoweringContext() : Node(NULL) {} | 38 LoweringContext() : Node(NULL) {} |
| 37 ~LoweringContext() {} | 39 ~LoweringContext() {} |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 void skipDeleted(InstList::iterator &I) const; | 82 void skipDeleted(InstList::iterator &I) const; |
| 81 void advanceForward(InstList::iterator &I) const; | 83 void advanceForward(InstList::iterator &I) const; |
| 82 void advanceBackward(InstList::iterator &I) const; | 84 void advanceBackward(InstList::iterator &I) const; |
| 83 LoweringContext(const LoweringContext &) LLVM_DELETED_FUNCTION; | 85 LoweringContext(const LoweringContext &) LLVM_DELETED_FUNCTION; |
| 84 LoweringContext &operator=(const LoweringContext &) LLVM_DELETED_FUNCTION; | 86 LoweringContext &operator=(const LoweringContext &) LLVM_DELETED_FUNCTION; |
| 85 }; | 87 }; |
| 86 | 88 |
| 87 class TargetLowering { | 89 class TargetLowering { |
| 88 public: | 90 public: |
| 89 static TargetLowering *createLowering(TargetArch Target, Cfg *Func); | 91 static TargetLowering *createLowering(TargetArch Target, Cfg *Func); |
| 92 static Assembler *createAssembler(TargetArch Target, Cfg *Func); |
| 90 void translate() { | 93 void translate() { |
| 91 switch (Ctx->getOptLevel()) { | 94 switch (Ctx->getOptLevel()) { |
| 92 case Opt_m1: | 95 case Opt_m1: |
| 93 translateOm1(); | 96 translateOm1(); |
| 94 break; | 97 break; |
| 95 case Opt_0: | 98 case Opt_0: |
| 96 translateO0(); | 99 translateO0(); |
| 97 break; | 100 break; |
| 98 case Opt_1: | 101 case Opt_1: |
| 99 translateO1(); | 102 translateO1(); |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 private: | 244 private: |
| 242 TargetGlobalInitLowering(const TargetGlobalInitLowering &) | 245 TargetGlobalInitLowering(const TargetGlobalInitLowering &) |
| 243 LLVM_DELETED_FUNCTION; | 246 LLVM_DELETED_FUNCTION; |
| 244 TargetGlobalInitLowering & | 247 TargetGlobalInitLowering & |
| 245 operator=(const TargetGlobalInitLowering &) LLVM_DELETED_FUNCTION; | 248 operator=(const TargetGlobalInitLowering &) LLVM_DELETED_FUNCTION; |
| 246 }; | 249 }; |
| 247 | 250 |
| 248 } // end of namespace Ice | 251 } // end of namespace Ice |
| 249 | 252 |
| 250 #endif // SUBZERO_SRC_ICETARGETLOWERING_H | 253 #endif // SUBZERO_SRC_ICETARGETLOWERING_H |
| OLD | NEW |