| 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 |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 // Begin is a copy of Insts.begin(), used if iterators are moved backward. | 83 // Begin is a copy of Insts.begin(), used if iterators are moved backward. |
| 84 InstList::iterator Begin; | 84 InstList::iterator Begin; |
| 85 // End is a copy of Insts.end(), used if Next needs to be advanced. | 85 // End is a copy of Insts.end(), used if Next needs to be advanced. |
| 86 InstList::iterator End; | 86 InstList::iterator End; |
| 87 | 87 |
| 88 void skipDeleted(InstList::iterator &I) const; | 88 void skipDeleted(InstList::iterator &I) const; |
| 89 void advanceForward(InstList::iterator &I) const; | 89 void advanceForward(InstList::iterator &I) const; |
| 90 }; | 90 }; |
| 91 | 91 |
| 92 class TargetLowering { | 92 class TargetLowering { |
| 93 TargetLowering() = delete; |
| 93 TargetLowering(const TargetLowering &) = delete; | 94 TargetLowering(const TargetLowering &) = delete; |
| 94 TargetLowering &operator=(const TargetLowering &) = delete; | 95 TargetLowering &operator=(const TargetLowering &) = delete; |
| 95 | 96 |
| 96 public: | 97 public: |
| 97 static TargetLowering *createLowering(TargetArch Target, Cfg *Func); | 98 static TargetLowering *createLowering(TargetArch Target, Cfg *Func); |
| 98 static std::unique_ptr<Assembler> createAssembler(TargetArch Target, | 99 static std::unique_ptr<Assembler> createAssembler(TargetArch Target, |
| 99 Cfg *Func); | 100 Cfg *Func); |
| 100 void translate() { | 101 void translate() { |
| 101 switch (Ctx->getOptLevel()) { | 102 switch (Ctx->getOptLevel()) { |
| 102 case Opt_m1: | 103 case Opt_m1: |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 | 208 |
| 208 // Performs target-specific argument lowering. | 209 // Performs target-specific argument lowering. |
| 209 virtual void lowerArguments() = 0; | 210 virtual void lowerArguments() = 0; |
| 210 | 211 |
| 211 virtual void addProlog(CfgNode *Node) = 0; | 212 virtual void addProlog(CfgNode *Node) = 0; |
| 212 virtual void addEpilog(CfgNode *Node) = 0; | 213 virtual void addEpilog(CfgNode *Node) = 0; |
| 213 | 214 |
| 214 virtual ~TargetLowering() {} | 215 virtual ~TargetLowering() {} |
| 215 | 216 |
| 216 protected: | 217 protected: |
| 217 TargetLowering(Cfg *Func); | 218 explicit TargetLowering(Cfg *Func); |
| 218 virtual void lowerAlloca(const InstAlloca *Inst) = 0; | 219 virtual void lowerAlloca(const InstAlloca *Inst) = 0; |
| 219 virtual void lowerArithmetic(const InstArithmetic *Inst) = 0; | 220 virtual void lowerArithmetic(const InstArithmetic *Inst) = 0; |
| 220 virtual void lowerAssign(const InstAssign *Inst) = 0; | 221 virtual void lowerAssign(const InstAssign *Inst) = 0; |
| 221 virtual void lowerBr(const InstBr *Inst) = 0; | 222 virtual void lowerBr(const InstBr *Inst) = 0; |
| 222 virtual void lowerCall(const InstCall *Inst) = 0; | 223 virtual void lowerCall(const InstCall *Inst) = 0; |
| 223 virtual void lowerCast(const InstCast *Inst) = 0; | 224 virtual void lowerCast(const InstCast *Inst) = 0; |
| 224 virtual void lowerFcmp(const InstFcmp *Inst) = 0; | 225 virtual void lowerFcmp(const InstFcmp *Inst) = 0; |
| 225 virtual void lowerExtractElement(const InstExtractElement *Inst) = 0; | 226 virtual void lowerExtractElement(const InstExtractElement *Inst) = 0; |
| 226 virtual void lowerIcmp(const InstIcmp *Inst) = 0; | 227 virtual void lowerIcmp(const InstIcmp *Inst) = 0; |
| 227 virtual void lowerInsertElement(const InstInsertElement *Inst) = 0; | 228 virtual void lowerInsertElement(const InstInsertElement *Inst) = 0; |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 265 | 266 |
| 266 public: | 267 public: |
| 267 static std::unique_ptr<TargetDataLowering> createLowering(GlobalContext *Ctx); | 268 static std::unique_ptr<TargetDataLowering> createLowering(GlobalContext *Ctx); |
| 268 virtual ~TargetDataLowering(); | 269 virtual ~TargetDataLowering(); |
| 269 | 270 |
| 270 virtual void | 271 virtual void |
| 271 lowerGlobals(std::unique_ptr<VariableDeclarationList> Vars) const = 0; | 272 lowerGlobals(std::unique_ptr<VariableDeclarationList> Vars) const = 0; |
| 272 virtual void lowerConstants() const = 0; | 273 virtual void lowerConstants() const = 0; |
| 273 | 274 |
| 274 protected: | 275 protected: |
| 275 TargetDataLowering(GlobalContext *Ctx) : Ctx(Ctx) {} | 276 explicit TargetDataLowering(GlobalContext *Ctx) : Ctx(Ctx) {} |
| 276 GlobalContext *Ctx; | 277 GlobalContext *Ctx; |
| 277 }; | 278 }; |
| 278 | 279 |
| 279 } // end of namespace Ice | 280 } // end of namespace Ice |
| 280 | 281 |
| 281 #endif // SUBZERO_SRC_ICETARGETLOWERING_H | 282 #endif // SUBZERO_SRC_ICETARGETLOWERING_H |
| OLD | NEW |