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" |
| 22 | #include "llvm/Target/TargetFrameLowering.h" |
| 23 | #include "llvm/Target/TargetMachine.h" |
| 24 | |
| 25 | namespace llvm { |
| 26 | class formatted_raw_ostream; |
| 27 | |
| 28 | class LanaiTargetMachine : public LLVMTargetMachine { |
| 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, |
Jacques Pienaar | fcef3e4 | 2016-03-28 13:09:54 +0000 | [diff] [blame] | 37 | CodeModel::Model CodeModel, CodeGenOpt::Level OptLevel); |
| 38 | |
| 39 | const LanaiSubtarget * |
| 40 | getSubtargetImpl(const llvm::Function &Fn) const override { |
| 41 | return &Subtarget; |
| 42 | } |
| 43 | |
| 44 | TargetIRAnalysis getTargetIRAnalysis() override; |
| 45 | |
| 46 | // Pass Pipeline Configuration |
| 47 | TargetPassConfig *createPassConfig(PassManagerBase &pass_manager) override; |
| 48 | |
| 49 | TargetLoweringObjectFile *getObjFileLowering() const override { |
| 50 | return TLOF.get(); |
| 51 | } |
| 52 | }; |
| 53 | } // namespace llvm |
| 54 | |
| 55 | #endif // LLVM_LIB_TARGET_LANAI_LANAITARGETMACHINE_H |