Jacques Pienaar | fcef3e4 | 2016-03-28 13:09:54 +0000 | [diff] [blame] | 1 | //===-- LanaiTargetMachine.h - Define TargetMachine for Lanai --- C++ ---===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
| 10 | // This file declares the Lanai specific subclass of TargetMachine. |
| 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
| 14 | #ifndef LLVM_LIB_TARGET_LANAI_LANAITARGETMACHINE_H |
| 15 | #define LLVM_LIB_TARGET_LANAI_LANAITARGETMACHINE_H |
| 16 | |
| 17 | #include "LanaiFrameLowering.h" |
| 18 | #include "LanaiISelLowering.h" |
| 19 | #include "LanaiInstrInfo.h" |
| 20 | #include "LanaiSelectionDAGInfo.h" |
| 21 | #include "LanaiSubtarget.h" |
David Blaikie | 1be62f0 | 2017-11-03 22:32:11 +0000 | [diff] [blame] | 22 | #include "llvm/CodeGen/TargetFrameLowering.h" |
Jacques Pienaar | fcef3e4 | 2016-03-28 13:09:54 +0000 | [diff] [blame] | 23 | #include "llvm/Target/TargetMachine.h" |
| 24 | |
| 25 | namespace llvm { |
| 26 | class formatted_raw_ostream; |
| 27 | |
Matthias Braun | bb8507e | 2017-10-12 22:57:28 +0000 | [diff] [blame] | 28 | class LanaiTargetMachine : public LLVMTargetMachine { |
Jacques Pienaar | fcef3e4 | 2016-03-28 13:09:54 +0000 | [diff] [blame] | 29 | LanaiSubtarget Subtarget; |
| 30 | std::unique_ptr<TargetLoweringObjectFile> TLOF; |
| 31 | |
| 32 | public: |
| 33 | LanaiTargetMachine(const Target &TheTarget, const Triple &TargetTriple, |
| 34 | StringRef Cpu, StringRef FeatureString, |
Jacques Pienaar | 813e837 | 2016-05-20 03:21:37 +0000 | [diff] [blame] | 35 | const TargetOptions &Options, |
| 36 | Optional<Reloc::Model> RelocationModel, |
Rafael Espindola | 79e238a | 2017-08-03 02:16:21 +0000 | [diff] [blame] | 37 | Optional<CodeModel::Model> CodeModel, |
| 38 | CodeGenOpt::Level OptLevel, bool JIT); |
Jacques Pienaar | fcef3e4 | 2016-03-28 13:09:54 +0000 | [diff] [blame] | 39 | |
| 40 | const LanaiSubtarget * |
Jacques Pienaar | e2f0699 | 2016-07-15 22:38:32 +0000 | [diff] [blame] | 41 | getSubtargetImpl(const llvm::Function & /*Fn*/) const override { |
Jacques Pienaar | fcef3e4 | 2016-03-28 13:09:54 +0000 | [diff] [blame] | 42 | return &Subtarget; |
| 43 | } |
| 44 | |
Sanjoy Das | 26d11ca | 2017-12-22 18:21:59 +0000 | [diff] [blame] | 45 | TargetTransformInfo getTargetTransformInfo(const Function &F) override; |
Jacques Pienaar | fcef3e4 | 2016-03-28 13:09:54 +0000 | [diff] [blame] | 46 | |
| 47 | // Pass Pipeline Configuration |
| 48 | TargetPassConfig *createPassConfig(PassManagerBase &pass_manager) override; |
| 49 | |
| 50 | TargetLoweringObjectFile *getObjFileLowering() const override { |
| 51 | return TLOF.get(); |
| 52 | } |
Matthias Braun | d6a36ae | 2017-05-31 18:41:23 +0000 | [diff] [blame] | 53 | |
| 54 | bool isMachineVerifierClean() const override { |
| 55 | return false; |
| 56 | } |
Jacques Pienaar | fcef3e4 | 2016-03-28 13:09:54 +0000 | [diff] [blame] | 57 | }; |
| 58 | } // namespace llvm |
| 59 | |
| 60 | #endif // LLVM_LIB_TARGET_LANAI_LANAITARGETMACHINE_H |