| 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 "IceInst.h" // for the names of the Inst subtypes | 22 #include "IceInst.h" // for the names of the Inst subtypes |
| 23 #include "IceTypes.h" | 23 #include "IceTypes.h" |
| 24 | 24 |
| 25 namespace Ice { | 25 namespace Ice { |
| 26 | 26 |
| 27 typedef uint8_t AsmCodeByte; | 27 typedef uint8_t AsmCodeByte; |
| 28 | 28 |
| 29 class Assembler; | 29 class Assembler; |
| 30 class GlobalAddress; | |
| 31 | 30 |
| 32 // LoweringContext makes it easy to iterate through non-deleted | 31 // LoweringContext makes it easy to iterate through non-deleted |
| 33 // instructions in a node, and insert new (lowered) instructions at | 32 // instructions in a node, and insert new (lowered) instructions at |
| 34 // the current point. Along with the instruction list container and | 33 // the current point. Along with the instruction list container and |
| 35 // associated iterators, it holds the current node, which is needed | 34 // associated iterators, it holds the current node, which is needed |
| 36 // when inserting new instructions in order to track whether variables | 35 // when inserting new instructions in order to track whether variables |
| 37 // are used as single-block or multi-block. | 36 // are used as single-block or multi-block. |
| 38 class LoweringContext { | 37 class LoweringContext { |
| 39 public: | 38 public: |
| 40 LoweringContext() : Node(NULL) {} | 39 LoweringContext() : Node(NULL) {} |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 | 241 |
| 243 // TargetGlobalInitLowering is used for "lowering" global | 242 // TargetGlobalInitLowering is used for "lowering" global |
| 244 // initializers. It is separated out from TargetLowering because it | 243 // initializers. It is separated out from TargetLowering because it |
| 245 // does not require a Cfg. | 244 // does not require a Cfg. |
| 246 class TargetGlobalInitLowering { | 245 class TargetGlobalInitLowering { |
| 247 public: | 246 public: |
| 248 static TargetGlobalInitLowering *createLowering(TargetArch Target, | 247 static TargetGlobalInitLowering *createLowering(TargetArch Target, |
| 249 GlobalContext *Ctx); | 248 GlobalContext *Ctx); |
| 250 virtual ~TargetGlobalInitLowering(); | 249 virtual ~TargetGlobalInitLowering(); |
| 251 | 250 |
| 252 virtual void lower(const GlobalAddress &Addr, bool DisableTranslation) = 0; | 251 virtual void lower(const VariableDeclaration &Var) = 0; |
| 253 | 252 |
| 254 protected: | 253 protected: |
| 255 TargetGlobalInitLowering(GlobalContext *Ctx) : Ctx(Ctx) {} | 254 TargetGlobalInitLowering(GlobalContext *Ctx) : Ctx(Ctx) {} |
| 256 GlobalContext *Ctx; | 255 GlobalContext *Ctx; |
| 257 | 256 |
| 258 private: | 257 private: |
| 259 TargetGlobalInitLowering(const TargetGlobalInitLowering &) = delete; | 258 TargetGlobalInitLowering(const TargetGlobalInitLowering &) = delete; |
| 260 TargetGlobalInitLowering &operator=(const TargetGlobalInitLowering &) = | 259 TargetGlobalInitLowering &operator=(const TargetGlobalInitLowering &) = |
| 261 delete; | 260 delete; |
| 262 }; | 261 }; |
| 263 | 262 |
| 264 } // end of namespace Ice | 263 } // end of namespace Ice |
| 265 | 264 |
| 266 #endif // SUBZERO_SRC_ICETARGETLOWERING_H | 265 #endif // SUBZERO_SRC_ICETARGETLOWERING_H |
| OLD | NEW |