| 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 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 377 TargetDataLowering &operator=(const TargetDataLowering &) = delete; | 377 TargetDataLowering &operator=(const TargetDataLowering &) = delete; |
| 378 | 378 |
| 379 public: | 379 public: |
| 380 static std::unique_ptr<TargetDataLowering> createLowering(GlobalContext *Ctx); | 380 static std::unique_ptr<TargetDataLowering> createLowering(GlobalContext *Ctx); |
| 381 virtual ~TargetDataLowering(); | 381 virtual ~TargetDataLowering(); |
| 382 | 382 |
| 383 virtual void lowerGlobals(std::unique_ptr<VariableDeclarationList> Vars) = 0; | 383 virtual void lowerGlobals(std::unique_ptr<VariableDeclarationList> Vars) = 0; |
| 384 virtual void lowerConstants() = 0; | 384 virtual void lowerConstants() = 0; |
| 385 | 385 |
| 386 protected: | 386 protected: |
| 387 void emitGlobal(const VariableDeclaration &Var); |
| 388 |
| 389 // For now, we assume .long is the right directive for emitting 4 byte |
| 390 // emit global relocations. However, LLVM MIPS usually uses .4byte instead. |
| 391 // Perhaps there is some difference when the location is unaligned. |
| 392 const char *getEmit32Directive() { return ".long"; } |
| 393 |
| 387 explicit TargetDataLowering(GlobalContext *Ctx) : Ctx(Ctx) {} | 394 explicit TargetDataLowering(GlobalContext *Ctx) : Ctx(Ctx) {} |
| 388 GlobalContext *Ctx; | 395 GlobalContext *Ctx; |
| 389 }; | 396 }; |
| 390 | 397 |
| 391 // TargetHeaderLowering is used to "lower" the header of an output file. | 398 // TargetHeaderLowering is used to "lower" the header of an output file. |
| 392 // It writes out the target-specific header attributes. E.g., for ARM | 399 // It writes out the target-specific header attributes. E.g., for ARM |
| 393 // this writes out the build attributes (float ABI, etc.). | 400 // this writes out the build attributes (float ABI, etc.). |
| 394 class TargetHeaderLowering { | 401 class TargetHeaderLowering { |
| 395 TargetHeaderLowering() = delete; | 402 TargetHeaderLowering() = delete; |
| 396 TargetHeaderLowering(const TargetHeaderLowering &) = delete; | 403 TargetHeaderLowering(const TargetHeaderLowering &) = delete; |
| 397 TargetHeaderLowering &operator=(const TargetHeaderLowering &) = delete; | 404 TargetHeaderLowering &operator=(const TargetHeaderLowering &) = delete; |
| 398 | 405 |
| 399 public: | 406 public: |
| 400 static std::unique_ptr<TargetHeaderLowering> | 407 static std::unique_ptr<TargetHeaderLowering> |
| 401 createLowering(GlobalContext *Ctx); | 408 createLowering(GlobalContext *Ctx); |
| 402 virtual ~TargetHeaderLowering(); | 409 virtual ~TargetHeaderLowering(); |
| 403 | 410 |
| 404 virtual void lower() {} | 411 virtual void lower() {} |
| 405 | 412 |
| 406 protected: | 413 protected: |
| 407 explicit TargetHeaderLowering(GlobalContext *Ctx) : Ctx(Ctx) {} | 414 explicit TargetHeaderLowering(GlobalContext *Ctx) : Ctx(Ctx) {} |
| 408 GlobalContext *Ctx; | 415 GlobalContext *Ctx; |
| 409 }; | 416 }; |
| 410 | 417 |
| 411 } // end of namespace Ice | 418 } // end of namespace Ice |
| 412 | 419 |
| 413 #endif // SUBZERO_SRC_ICETARGETLOWERING_H | 420 #endif // SUBZERO_SRC_ICETARGETLOWERING_H |
| OLD | NEW |