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 |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
195 const llvm::SmallBitVector &ExcludeRegisters) const = 0; | 195 const llvm::SmallBitVector &ExcludeRegisters) const = 0; |
196 | 196 |
197 virtual void emitVariable(const Variable *Var) const = 0; | 197 virtual void emitVariable(const Variable *Var) const = 0; |
198 | 198 |
199 // Performs target-specific argument lowering. | 199 // Performs target-specific argument lowering. |
200 virtual void lowerArguments() = 0; | 200 virtual void lowerArguments() = 0; |
201 | 201 |
202 virtual void addProlog(CfgNode *Node) = 0; | 202 virtual void addProlog(CfgNode *Node) = 0; |
203 virtual void addEpilog(CfgNode *Node) = 0; | 203 virtual void addEpilog(CfgNode *Node) = 0; |
204 | 204 |
205 virtual void emitConstants() const = 0; | |
206 | |
207 virtual ~TargetLowering() {} | 205 virtual ~TargetLowering() {} |
208 | 206 |
209 protected: | 207 protected: |
210 TargetLowering(Cfg *Func); | 208 TargetLowering(Cfg *Func); |
211 virtual void lowerAlloca(const InstAlloca *Inst) = 0; | 209 virtual void lowerAlloca(const InstAlloca *Inst) = 0; |
212 virtual void lowerArithmetic(const InstArithmetic *Inst) = 0; | 210 virtual void lowerArithmetic(const InstArithmetic *Inst) = 0; |
213 virtual void lowerAssign(const InstAssign *Inst) = 0; | 211 virtual void lowerAssign(const InstAssign *Inst) = 0; |
214 virtual void lowerBr(const InstBr *Inst) = 0; | 212 virtual void lowerBr(const InstBr *Inst) = 0; |
215 virtual void lowerCall(const InstCall *Inst) = 0; | 213 virtual void lowerCall(const InstCall *Inst) = 0; |
216 virtual void lowerCast(const InstCast *Inst) = 0; | 214 virtual void lowerCast(const InstCast *Inst) = 0; |
(...skipping 21 matching lines...) Expand all Loading... | |
238 GlobalContext *Ctx; | 236 GlobalContext *Ctx; |
239 const bool RandomizeRegisterAllocation; | 237 const bool RandomizeRegisterAllocation; |
240 bool HasComputedFrame; | 238 bool HasComputedFrame; |
241 bool CallsReturnsTwice; | 239 bool CallsReturnsTwice; |
242 // StackAdjustment keeps track of the current stack offset from its | 240 // StackAdjustment keeps track of the current stack offset from its |
243 // natural location, as arguments are pushed for a function call. | 241 // natural location, as arguments are pushed for a function call. |
244 int32_t StackAdjustment; | 242 int32_t StackAdjustment; |
245 LoweringContext Context; | 243 LoweringContext Context; |
246 }; | 244 }; |
247 | 245 |
248 // TargetGlobalInitLowering is used for "lowering" global | 246 // TargetGlobalLowering is used for "lowering" global initializers, |
249 // initializers. It is separated out from TargetLowering because it | 247 // including the internal constant pool. It is separated out from |
250 // does not require a Cfg. | 248 // TargetLowering because it does not require a Cfg. |
251 class TargetGlobalInitLowering { | 249 class TargetGlobalLowering { |
252 TargetGlobalInitLowering(const TargetGlobalInitLowering &) = delete; | 250 TargetGlobalLowering(const TargetGlobalLowering &) = delete; |
253 TargetGlobalInitLowering &operator=(const TargetGlobalInitLowering &) = | 251 TargetGlobalLowering &operator=(const TargetGlobalLowering &) = delete; |
JF
2015/01/23 17:22:43
TargetGlobalLowering() = delete;
Jim Stichnoth
2015/01/23 21:54:02
Done. (also for TargetGlobalX8632)
| |
254 delete; | |
255 | 252 |
256 public: | 253 public: |
257 static TargetGlobalInitLowering *createLowering(TargetArch Target, | 254 static TargetGlobalLowering *createLowering(GlobalContext *Ctx); |
258 GlobalContext *Ctx); | 255 virtual ~TargetGlobalLowering(); |
259 virtual ~TargetGlobalInitLowering(); | |
260 | 256 |
261 virtual void lower(const VariableDeclaration &Var) = 0; | 257 virtual void lowerInit(const VariableDeclaration &Var) const = 0; |
258 virtual void lowerConstants(GlobalContext *Ctx) const = 0; | |
262 | 259 |
263 protected: | 260 protected: |
264 TargetGlobalInitLowering(GlobalContext *Ctx) : Ctx(Ctx) {} | 261 TargetGlobalLowering(GlobalContext *Ctx) : Ctx(Ctx) {} |
265 GlobalContext *Ctx; | 262 GlobalContext *Ctx; |
266 }; | 263 }; |
267 | 264 |
268 } // end of namespace Ice | 265 } // end of namespace Ice |
269 | 266 |
270 #endif // SUBZERO_SRC_ICETARGETLOWERING_H | 267 #endif // SUBZERO_SRC_ICETARGETLOWERING_H |
OLD | NEW |