| 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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 // instructions come between the two points. | 74 // instructions come between the two points. |
| 75 InstList::iterator Next; | 75 InstList::iterator Next; |
| 76 // Begin is a copy of Insts.begin(), used if iterators are moved backward. | 76 // Begin is a copy of Insts.begin(), used if iterators are moved backward. |
| 77 InstList::iterator Begin; | 77 InstList::iterator Begin; |
| 78 // End is a copy of Insts.end(), used if Next needs to be advanced. | 78 // End is a copy of Insts.end(), used if Next needs to be advanced. |
| 79 InstList::iterator End; | 79 InstList::iterator End; |
| 80 | 80 |
| 81 void skipDeleted(InstList::iterator &I) const; | 81 void skipDeleted(InstList::iterator &I) const; |
| 82 void advanceForward(InstList::iterator &I) const; | 82 void advanceForward(InstList::iterator &I) const; |
| 83 void advanceBackward(InstList::iterator &I) const; | 83 void advanceBackward(InstList::iterator &I) const; |
| 84 LoweringContext(const LoweringContext &) LLVM_DELETED_FUNCTION; | 84 LoweringContext(const LoweringContext &) = delete; |
| 85 LoweringContext &operator=(const LoweringContext &) LLVM_DELETED_FUNCTION; | 85 LoweringContext &operator=(const LoweringContext &) = delete; |
| 86 }; | 86 }; |
| 87 | 87 |
| 88 class TargetLowering { | 88 class TargetLowering { |
| 89 public: | 89 public: |
| 90 static TargetLowering *createLowering(TargetArch Target, Cfg *Func); | 90 static TargetLowering *createLowering(TargetArch Target, Cfg *Func); |
| 91 static Assembler *createAssembler(TargetArch Target, Cfg *Func); | 91 static Assembler *createAssembler(TargetArch Target, Cfg *Func); |
| 92 void translate() { | 92 void translate() { |
| 93 switch (Ctx->getOptLevel()) { | 93 switch (Ctx->getOptLevel()) { |
| 94 case Opt_m1: | 94 case Opt_m1: |
| 95 translateOm1(); | 95 translateOm1(); |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 Cfg *Func; | 223 Cfg *Func; |
| 224 GlobalContext *Ctx; | 224 GlobalContext *Ctx; |
| 225 bool HasComputedFrame; | 225 bool HasComputedFrame; |
| 226 bool CallsReturnsTwice; | 226 bool CallsReturnsTwice; |
| 227 // StackAdjustment keeps track of the current stack offset from its | 227 // StackAdjustment keeps track of the current stack offset from its |
| 228 // natural location, as arguments are pushed for a function call. | 228 // natural location, as arguments are pushed for a function call. |
| 229 int32_t StackAdjustment; | 229 int32_t StackAdjustment; |
| 230 LoweringContext Context; | 230 LoweringContext Context; |
| 231 | 231 |
| 232 private: | 232 private: |
| 233 TargetLowering(const TargetLowering &) LLVM_DELETED_FUNCTION; | 233 TargetLowering(const TargetLowering &) = delete; |
| 234 TargetLowering &operator=(const TargetLowering &) LLVM_DELETED_FUNCTION; | 234 TargetLowering &operator=(const TargetLowering &) = delete; |
| 235 }; | 235 }; |
| 236 | 236 |
| 237 // TargetGlobalInitLowering is used for "lowering" global | 237 // TargetGlobalInitLowering is used for "lowering" global |
| 238 // initializers. It is separated out from TargetLowering because it | 238 // initializers. It is separated out from TargetLowering because it |
| 239 // does not require a Cfg. | 239 // does not require a Cfg. |
| 240 class TargetGlobalInitLowering { | 240 class TargetGlobalInitLowering { |
| 241 public: | 241 public: |
| 242 static TargetGlobalInitLowering *createLowering(TargetArch Target, | 242 static TargetGlobalInitLowering *createLowering(TargetArch Target, |
| 243 GlobalContext *Ctx); | 243 GlobalContext *Ctx); |
| 244 virtual ~TargetGlobalInitLowering(); | 244 virtual ~TargetGlobalInitLowering(); |
| 245 | 245 |
| 246 // TODO: Allow relocations to be represented as part of the Data. | 246 // TODO: Allow relocations to be represented as part of the Data. |
| 247 virtual void lower(const IceString &Name, SizeT Align, bool IsInternal, | 247 virtual void lower(const IceString &Name, SizeT Align, bool IsInternal, |
| 248 bool IsConst, bool IsZeroInitializer, SizeT Size, | 248 bool IsConst, bool IsZeroInitializer, SizeT Size, |
| 249 const char *Data, bool DisableTranslation) = 0; | 249 const char *Data, bool DisableTranslation) = 0; |
| 250 | 250 |
| 251 protected: | 251 protected: |
| 252 TargetGlobalInitLowering(GlobalContext *Ctx) : Ctx(Ctx) {} | 252 TargetGlobalInitLowering(GlobalContext *Ctx) : Ctx(Ctx) {} |
| 253 GlobalContext *Ctx; | 253 GlobalContext *Ctx; |
| 254 | 254 |
| 255 private: | 255 private: |
| 256 TargetGlobalInitLowering(const TargetGlobalInitLowering &) | 256 TargetGlobalInitLowering(const TargetGlobalInitLowering &) = delete; |
| 257 LLVM_DELETED_FUNCTION; | 257 TargetGlobalInitLowering &operator=(const TargetGlobalInitLowering &) = |
| 258 TargetGlobalInitLowering & | 258 delete; |
| 259 operator=(const TargetGlobalInitLowering &) LLVM_DELETED_FUNCTION; | |
| 260 }; | 259 }; |
| 261 | 260 |
| 262 } // end of namespace Ice | 261 } // end of namespace Ice |
| 263 | 262 |
| 264 #endif // SUBZERO_SRC_ICETARGETLOWERING_H | 263 #endif // SUBZERO_SRC_ICETARGETLOWERING_H |
| OLD | NEW |