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 "IceGlobalInits.h" |
22 #include "IceInst.h" // for the names of the Inst subtypes | 23 #include "IceInst.h" // for the names of the Inst subtypes |
23 #include "IceTypes.h" | 24 #include "IceTypes.h" |
24 | 25 |
25 namespace Ice { | 26 namespace Ice { |
26 | 27 |
27 class Assembler; | 28 class Assembler; |
28 | 29 |
29 // LoweringContext makes it easy to iterate through non-deleted | 30 // LoweringContext makes it easy to iterate through non-deleted |
30 // instructions in a node, and insert new (lowered) instructions at | 31 // instructions in a node, and insert new (lowered) instructions at |
31 // the current point. Along with the instruction list container and | 32 // the current point. Along with the instruction list container and |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 | 237 |
237 // TargetGlobalInitLowering is used for "lowering" global | 238 // TargetGlobalInitLowering is used for "lowering" global |
238 // initializers. It is separated out from TargetLowering because it | 239 // initializers. It is separated out from TargetLowering because it |
239 // does not require a Cfg. | 240 // does not require a Cfg. |
240 class TargetGlobalInitLowering { | 241 class TargetGlobalInitLowering { |
241 public: | 242 public: |
242 static TargetGlobalInitLowering *createLowering(TargetArch Target, | 243 static TargetGlobalInitLowering *createLowering(TargetArch Target, |
243 GlobalContext *Ctx); | 244 GlobalContext *Ctx); |
244 virtual ~TargetGlobalInitLowering(); | 245 virtual ~TargetGlobalInitLowering(); |
245 | 246 |
246 // TODO: Allow relocations to be represented as part of the Data. | 247 virtual void lower(const GlobalAddress &Addr, bool DisableTranslation) = 0; |
247 virtual void lower(const IceString &Name, SizeT Align, bool IsInternal, | |
248 bool IsConst, bool IsZeroInitializer, SizeT Size, | |
249 const char *Data, bool DisableTranslation) = 0; | |
250 | 248 |
251 protected: | 249 protected: |
252 TargetGlobalInitLowering(GlobalContext *Ctx) : Ctx(Ctx) {} | 250 TargetGlobalInitLowering(GlobalContext *Ctx) : Ctx(Ctx) {} |
253 GlobalContext *Ctx; | 251 GlobalContext *Ctx; |
254 | 252 |
255 private: | 253 private: |
256 TargetGlobalInitLowering(const TargetGlobalInitLowering &) | 254 TargetGlobalInitLowering(const TargetGlobalInitLowering &) |
257 LLVM_DELETED_FUNCTION; | 255 LLVM_DELETED_FUNCTION; |
258 TargetGlobalInitLowering & | 256 TargetGlobalInitLowering & |
259 operator=(const TargetGlobalInitLowering &) LLVM_DELETED_FUNCTION; | 257 operator=(const TargetGlobalInitLowering &) LLVM_DELETED_FUNCTION; |
260 }; | 258 }; |
261 | 259 |
262 } // end of namespace Ice | 260 } // end of namespace Ice |
263 | 261 |
264 #endif // SUBZERO_SRC_ICETARGETLOWERING_H | 262 #endif // SUBZERO_SRC_ICETARGETLOWERING_H |
OLD | NEW |