| OLD | NEW |
| 1 //===- subzero/src/IceTargetLowering.cpp - Basic lowering implementation --===// | 1 //===- subzero/src/IceTargetLowering.cpp - Basic lowering implementation --===// |
| 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 implements the skeleton of the TargetLowering class, | 10 // This file implements the skeleton of the TargetLowering class, |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 #define SUBZERO_TARGET(X) \ | 70 #define SUBZERO_TARGET(X) \ |
| 71 if (Target == Target_##X) \ | 71 if (Target == Target_##X) \ |
| 72 return Target##X::create(Func); | 72 return Target##X::create(Func); |
| 73 #include "llvm/Config/SZTargets.def" | 73 #include "llvm/Config/SZTargets.def" |
| 74 | 74 |
| 75 Func->setError("Unsupported target"); | 75 Func->setError("Unsupported target"); |
| 76 return nullptr; | 76 return nullptr; |
| 77 } | 77 } |
| 78 | 78 |
| 79 TargetLowering::TargetLowering(Cfg *Func) | 79 TargetLowering::TargetLowering(Cfg *Func) |
| 80 : Func(Func), Ctx(Func->getContext()), HasComputedFrame(false), | 80 : Func(Func), Ctx(Func->getContext()), Context() {} |
| 81 CallsReturnsTwice(false), StackAdjustment(0), NextLabelNumber(0), | |
| 82 Context(), SnapshotStackAdjustment(0) {} | |
| 83 | 81 |
| 84 std::unique_ptr<Assembler> TargetLowering::createAssembler(TargetArch Target, | 82 std::unique_ptr<Assembler> TargetLowering::createAssembler(TargetArch Target, |
| 85 Cfg *Func) { | 83 Cfg *Func) { |
| 86 #define SUBZERO_TARGET(X) \ | 84 #define SUBZERO_TARGET(X) \ |
| 87 if (Target == Target_##X) \ | 85 if (Target == Target_##X) \ |
| 88 return std::unique_ptr<Assembler>(new X::Assembler##X()); | 86 return std::unique_ptr<Assembler>(new X::Assembler##X()); |
| 89 #include "llvm/Config/SZTargets.def" | 87 #include "llvm/Config/SZTargets.def" |
| 90 | 88 |
| 91 Func->setError("Unsupported target assembler"); | 89 Func->setError("Unsupported target assembler"); |
| 92 return nullptr; | 90 return nullptr; |
| (...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 438 TargetDataLowering::createLowering(GlobalContext *Ctx) { | 436 TargetDataLowering::createLowering(GlobalContext *Ctx) { |
| 439 TargetArch Target = Ctx->getFlags().getTargetArch(); | 437 TargetArch Target = Ctx->getFlags().getTargetArch(); |
| 440 #define SUBZERO_TARGET(X) \ | 438 #define SUBZERO_TARGET(X) \ |
| 441 if (Target == Target_##X) \ | 439 if (Target == Target_##X) \ |
| 442 return TargetData##X::create(Ctx); | 440 return TargetData##X::create(Ctx); |
| 443 #include "llvm/Config/SZTargets.def" | 441 #include "llvm/Config/SZTargets.def" |
| 444 | 442 |
| 445 llvm::report_fatal_error("Unsupported target data lowering"); | 443 llvm::report_fatal_error("Unsupported target data lowering"); |
| 446 } | 444 } |
| 447 | 445 |
| 448 TargetDataLowering::~TargetDataLowering() {} | 446 TargetDataLowering::~TargetDataLowering() = default; |
| 449 | 447 |
| 450 namespace { | 448 namespace { |
| 451 | 449 |
| 452 // dataSectionSuffix decides whether to use SectionSuffix or MangledVarName as | 450 // dataSectionSuffix decides whether to use SectionSuffix or MangledVarName as |
| 453 // data section suffix. Essentially, when using separate data sections for | 451 // data section suffix. Essentially, when using separate data sections for |
| 454 // globals SectionSuffix is not necessary. | 452 // globals SectionSuffix is not necessary. |
| 455 IceString dataSectionSuffix(const IceString &SectionSuffix, | 453 IceString dataSectionSuffix(const IceString &SectionSuffix, |
| 456 const IceString &MangledVarName, | 454 const IceString &MangledVarName, |
| 457 const bool DataSections) { | 455 const bool DataSections) { |
| 458 if (SectionSuffix.empty() && !DataSections) { | 456 if (SectionSuffix.empty() && !DataSections) { |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 559 TargetHeaderLowering::createLowering(GlobalContext *Ctx) { | 557 TargetHeaderLowering::createLowering(GlobalContext *Ctx) { |
| 560 TargetArch Target = Ctx->getFlags().getTargetArch(); | 558 TargetArch Target = Ctx->getFlags().getTargetArch(); |
| 561 #define SUBZERO_TARGET(X) \ | 559 #define SUBZERO_TARGET(X) \ |
| 562 if (Target == Target_##X) \ | 560 if (Target == Target_##X) \ |
| 563 return TargetHeader##X::create(Ctx); | 561 return TargetHeader##X::create(Ctx); |
| 564 #include "llvm/Config/SZTargets.def" | 562 #include "llvm/Config/SZTargets.def" |
| 565 | 563 |
| 566 llvm::report_fatal_error("Unsupported target header lowering"); | 564 llvm::report_fatal_error("Unsupported target header lowering"); |
| 567 } | 565 } |
| 568 | 566 |
| 569 TargetHeaderLowering::~TargetHeaderLowering() {} | 567 TargetHeaderLowering::~TargetHeaderLowering() = default; |
| 570 | 568 |
| 571 } // end of namespace Ice | 569 } // end of namespace Ice |
| OLD | NEW |