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