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, LoweringContext, and |
11 // classes. TargetLowering is an abstract class used to drive the | 11 // TargetDataLowering classes. TargetLowering is an abstract class |
12 // translation/lowering process. LoweringContext maintains a | 12 // used to drive the translation/lowering process. LoweringContext |
13 // context for lowering each instruction, offering conveniences such | 13 // maintains a context for lowering each instruction, offering |
14 // as iterating over non-deleted instructions. | 14 // conveniences such as iterating over non-deleted instructions. |
| 15 // TargetDataLowering is an abstract class used to drive the |
| 16 // lowering/emission of global initializers, external global |
| 17 // declarations, and internal constant pools. |
15 // | 18 // |
16 //===----------------------------------------------------------------------===// | 19 //===----------------------------------------------------------------------===// |
17 | 20 |
18 #ifndef SUBZERO_SRC_ICETARGETLOWERING_H | 21 #ifndef SUBZERO_SRC_ICETARGETLOWERING_H |
19 #define SUBZERO_SRC_ICETARGETLOWERING_H | 22 #define SUBZERO_SRC_ICETARGETLOWERING_H |
20 | 23 |
21 #include "IceDefs.h" | 24 #include "IceDefs.h" |
22 #include "IceInst.h" // for the names of the Inst subtypes | 25 #include "IceInst.h" // for the names of the Inst subtypes |
23 #include "IceTypes.h" | 26 #include "IceTypes.h" |
24 | 27 |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 | 243 |
241 // TargetDataLowering is used for "lowering" data including initializers | 244 // TargetDataLowering is used for "lowering" data including initializers |
242 // for global variables, and the internal constant pools. It is separated | 245 // for global variables, and the internal constant pools. It is separated |
243 // out from TargetLowering because it does not require a Cfg. | 246 // out from TargetLowering because it does not require a Cfg. |
244 class TargetDataLowering { | 247 class TargetDataLowering { |
245 TargetDataLowering() = delete; | 248 TargetDataLowering() = delete; |
246 TargetDataLowering(const TargetDataLowering &) = delete; | 249 TargetDataLowering(const TargetDataLowering &) = delete; |
247 TargetDataLowering &operator=(const TargetDataLowering &) = delete; | 250 TargetDataLowering &operator=(const TargetDataLowering &) = delete; |
248 | 251 |
249 public: | 252 public: |
250 static TargetDataLowering *createLowering(GlobalContext *Ctx); | 253 static std::unique_ptr<TargetDataLowering> createLowering(GlobalContext *Ctx); |
251 virtual ~TargetDataLowering(); | 254 virtual ~TargetDataLowering(); |
252 | 255 |
253 virtual void lowerGlobal(const VariableDeclaration &Var) const = 0; | 256 virtual void |
254 virtual void lowerGlobalsELF(const VariableDeclarationList &Vars) const = 0; | 257 lowerGlobals(std::unique_ptr<VariableDeclarationList> Vars) const = 0; |
255 virtual void lowerConstants(GlobalContext *Ctx) const = 0; | 258 virtual void lowerConstants() const = 0; |
256 | 259 |
257 protected: | 260 protected: |
258 TargetDataLowering(GlobalContext *Ctx) : Ctx(Ctx) {} | 261 TargetDataLowering(GlobalContext *Ctx) : Ctx(Ctx) {} |
259 GlobalContext *Ctx; | 262 GlobalContext *Ctx; |
260 }; | 263 }; |
261 | 264 |
262 } // end of namespace Ice | 265 } // end of namespace Ice |
263 | 266 |
264 #endif // SUBZERO_SRC_ICETARGETLOWERING_H | 267 #endif // SUBZERO_SRC_ICETARGETLOWERING_H |
OLD | NEW |