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