• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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/CodeGen/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,
35                      const TargetOptions &Options,
36                      Optional<Reloc::Model> RelocationModel,
37                      Optional<CodeModel::Model> CodeModel,
38                      CodeGenOpt::Level OptLevel, bool JIT);
39 
40   const LanaiSubtarget *
getSubtargetImpl(const llvm::Function &)41   getSubtargetImpl(const llvm::Function & /*Fn*/) const override {
42     return &Subtarget;
43   }
44 
45   TargetTransformInfo getTargetTransformInfo(const Function &F) override;
46 
47   // Pass Pipeline Configuration
48   TargetPassConfig *createPassConfig(PassManagerBase &pass_manager) override;
49 
getObjFileLowering()50   TargetLoweringObjectFile *getObjFileLowering() const override {
51     return TLOF.get();
52   }
53 
isMachineVerifierClean()54   bool isMachineVerifierClean() const override {
55     return false;
56   }
57 };
58 } // namespace llvm
59 
60 #endif // LLVM_LIB_TARGET_LANAI_LANAITARGETMACHINE_H
61