|
1 | | -#include "RubiniusTargetMachine.h" |
2 | | -#include "RubiniusGenSubtargetInfo.inc" |
3 | | -#include "RubiniusISelLowering.h" |
4 | | -#include "llvm/CodeGen/Passes.h" |
5 | | -#include "llvm/CodeGen/TargetPassConfig.h" |
| 1 | +#include "llvm/Target/TargetMachine.h" |
6 | 2 | #include "llvm/MC/TargetRegistry.h" |
7 | | -using namespace llvm; |
8 | 3 |
|
9 | | -static Target &getTheRubiniusTarget(); // from RubiniusTargetInfo.cpp |
| 4 | +using namespace llvm; |
10 | 5 |
|
11 | | -RubiniusTargetMachine::RubiniusTargetMachine(const Target &T, const Triple &TT, |
12 | | - StringRef CPU, StringRef FS, |
13 | | - const TargetOptions &Options, |
14 | | - Optional<Reloc::Model> RM, |
15 | | - Optional<CodeModel::Model> CM, |
16 | | - CodeGenOptLevel OL) |
17 | | - : LLVMTargetMachine(T, "e", TT, CPU, FS, Options, RM.value_or(Reloc::Static), |
18 | | - CM.value_or(CodeModel::Small), OL), |
19 | | - Subtarget(TT, CPU, FS, *this) {} |
| 6 | +extern Target &getTheRubiniusTarget(); |
20 | 7 |
|
21 | | -const RubiniusSubtarget * |
22 | | -RubiniusTargetMachine::getSubtargetImpl(const Function &) const { |
23 | | - return &Subtarget; |
24 | | -} |
| 8 | +class RubiniusTargetMachine : public LLVMTargetMachine { |
| 9 | +public: |
| 10 | + RubiniusTargetMachine(const Target &T, const Triple &TT, StringRef CPU, |
| 11 | + StringRef FS, const TargetOptions &Options, |
| 12 | + std::optional<Reloc::Model> RM, |
| 13 | + std::optional<CodeModel::Model> CM, |
| 14 | + CodeGenOptLevel OL) |
| 15 | + : LLVMTargetMachine(T, "e", TT, CPU, FS, Options, RM, CM, OL) {} |
| 16 | +}; |
25 | 17 |
|
26 | 18 | extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeRubiniusTarget() { |
27 | | - RegisterTargetMachine<RubiniusTargetMachine> X(getTheRubiniusTarget()); |
| 19 | + Target &T = getTheRubiniusTarget(); |
| 20 | + RegisterTargetMachine<RubiniusTargetMachine> X(T); |
28 | 21 | } |
0 commit comments