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, LoweringContext, and | 10 // This file declares the TargetLowering, LoweringContext, and |
11 // TargetDataLowering classes. TargetLowering is an abstract class | 11 // TargetDataLowering classes. TargetLowering is an abstract class |
12 // used to drive the translation/lowering process. LoweringContext | 12 // used to drive the translation/lowering process. LoweringContext |
13 // maintains a context for lowering each instruction, offering | 13 // maintains a context for lowering each instruction, offering |
14 // conveniences such 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 | 15 // TargetDataLowering is an abstract class used to drive the |
16 // lowering/emission of global initializers, external global | 16 // lowering/emission of global initializers, external global |
17 // declarations, and internal constant pools. | 17 // declarations, and internal constant pools. |
18 // | 18 // |
19 //===----------------------------------------------------------------------===// | 19 //===----------------------------------------------------------------------===// |
20 | 20 |
21 #ifndef SUBZERO_SRC_ICETARGETLOWERING_H | 21 #ifndef SUBZERO_SRC_ICETARGETLOWERING_H |
22 #define SUBZERO_SRC_ICETARGETLOWERING_H | 22 #define SUBZERO_SRC_ICETARGETLOWERING_H |
23 | 23 |
24 #include "IceDefs.h" | 24 #include "IceDefs.h" |
25 #include "IceInst.h" // for the names of the Inst subtypes | 25 #include "IceInst.h" // for the names of the Inst subtypes |
| 26 #include "IceOperand.h" |
26 #include "IceTypes.h" | 27 #include "IceTypes.h" |
27 | 28 |
28 namespace Ice { | 29 namespace Ice { |
29 | 30 |
30 // LoweringContext makes it easy to iterate through non-deleted | 31 // LoweringContext makes it easy to iterate through non-deleted |
31 // instructions in a node, and insert new (lowered) instructions at | 32 // instructions in a node, and insert new (lowered) instructions at |
32 // the current point. Along with the instruction list container and | 33 // the current point. Along with the instruction list container and |
33 // associated iterators, it holds the current node, which is needed | 34 // associated iterators, it holds the current node, which is needed |
34 // when inserting new instructions in order to track whether variables | 35 // when inserting new instructions in order to track whether variables |
35 // are used as single-block or multi-block. | 36 // are used as single-block or multi-block. |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 // sure to also call the parent class's methods. | 201 // sure to also call the parent class's methods. |
201 virtual void snapshotEmitState() { | 202 virtual void snapshotEmitState() { |
202 SnapshotStackAdjustment = StackAdjustment; | 203 SnapshotStackAdjustment = StackAdjustment; |
203 } | 204 } |
204 virtual void rollbackEmitState() { | 205 virtual void rollbackEmitState() { |
205 StackAdjustment = SnapshotStackAdjustment; | 206 StackAdjustment = SnapshotStackAdjustment; |
206 } | 207 } |
207 | 208 |
208 virtual void emitVariable(const Variable *Var) const = 0; | 209 virtual void emitVariable(const Variable *Var) const = 0; |
209 | 210 |
| 211 void emitWithoutPrefix(const ConstantRelocatable *CR) const; |
| 212 void emit(const ConstantRelocatable *CR) const; |
| 213 virtual const char *getConstantPrefix() const = 0; |
| 214 |
| 215 virtual void emit(const ConstantUndef *C) const = 0; |
| 216 virtual void emit(const ConstantInteger32 *C) const = 0; |
| 217 virtual void emit(const ConstantInteger64 *C) const = 0; |
| 218 virtual void emit(const ConstantFloat *C) const = 0; |
| 219 virtual void emit(const ConstantDouble *C) const = 0; |
| 220 |
210 // Performs target-specific argument lowering. | 221 // Performs target-specific argument lowering. |
211 virtual void lowerArguments() = 0; | 222 virtual void lowerArguments() = 0; |
212 | 223 |
213 virtual void addProlog(CfgNode *Node) = 0; | 224 virtual void addProlog(CfgNode *Node) = 0; |
214 virtual void addEpilog(CfgNode *Node) = 0; | 225 virtual void addEpilog(CfgNode *Node) = 0; |
215 | 226 |
216 virtual ~TargetLowering() {} | 227 virtual ~TargetLowering() {} |
217 | 228 |
218 protected: | 229 protected: |
219 explicit TargetLowering(Cfg *Func); | 230 explicit TargetLowering(Cfg *Func); |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
312 virtual void lowerConstants() const = 0; | 323 virtual void lowerConstants() const = 0; |
313 | 324 |
314 protected: | 325 protected: |
315 explicit TargetDataLowering(GlobalContext *Ctx) : Ctx(Ctx) {} | 326 explicit TargetDataLowering(GlobalContext *Ctx) : Ctx(Ctx) {} |
316 GlobalContext *Ctx; | 327 GlobalContext *Ctx; |
317 }; | 328 }; |
318 | 329 |
319 } // end of namespace Ice | 330 } // end of namespace Ice |
320 | 331 |
321 #endif // SUBZERO_SRC_ICETARGETLOWERING_H | 332 #endif // SUBZERO_SRC_ICETARGETLOWERING_H |
OLD | NEW |