Reinstate "Nuke the old JIT."
[oota-llvm.git] / lib / Target / Mips / MipsTargetMachine.h
1 //===-- MipsTargetMachine.h - Define TargetMachine for Mips -----*- 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 Mips specific subclass of TargetMachine.
11 //
12 //===----------------------------------------------------------------------===//
13
14 #ifndef LLVM_LIB_TARGET_MIPS_MIPSTARGETMACHINE_H
15 #define LLVM_LIB_TARGET_MIPS_MIPSTARGETMACHINE_H
16
17 #include "MipsSubtarget.h"
18 #include "llvm/CodeGen/Passes.h"
19 #include "llvm/CodeGen/SelectionDAGISel.h"
20 #include "llvm/Target/TargetFrameLowering.h"
21 #include "llvm/Target/TargetMachine.h"
22
23 namespace llvm {
24 class formatted_raw_ostream;
25 class MipsRegisterInfo;
26
27 class MipsTargetMachine : public LLVMTargetMachine {
28   MipsSubtarget *Subtarget;
29   MipsSubtarget DefaultSubtarget;
30   MipsSubtarget NoMips16Subtarget;
31   MipsSubtarget Mips16Subtarget;
32
33 public:
34   MipsTargetMachine(const Target &T, StringRef TT, StringRef CPU, StringRef FS,
35                     const TargetOptions &Options, Reloc::Model RM,
36                     CodeModel::Model CM, CodeGenOpt::Level OL, bool isLittle);
37
38   virtual ~MipsTargetMachine() {}
39
40   void addAnalysisPasses(PassManagerBase &PM) override;
41
42   const MipsSubtarget *getSubtargetImpl() const override {
43     if (Subtarget)
44       return Subtarget;
45     return &DefaultSubtarget;
46   }
47
48   /// \brief Reset the subtarget for the Mips target.
49   void resetSubtarget(MachineFunction *MF);
50
51   // Pass Pipeline Configuration
52   TargetPassConfig *createPassConfig(PassManagerBase &PM) override;
53 };
54
55 /// MipsebTargetMachine - Mips32/64 big endian target machine.
56 ///
57 class MipsebTargetMachine : public MipsTargetMachine {
58   virtual void anchor();
59 public:
60   MipsebTargetMachine(const Target &T, StringRef TT,
61                       StringRef CPU, StringRef FS, const TargetOptions &Options,
62                       Reloc::Model RM, CodeModel::Model CM,
63                       CodeGenOpt::Level OL);
64 };
65
66 /// MipselTargetMachine - Mips32/64 little endian target machine.
67 ///
68 class MipselTargetMachine : public MipsTargetMachine {
69   virtual void anchor();
70 public:
71   MipselTargetMachine(const Target &T, StringRef TT,
72                       StringRef CPU, StringRef FS, const TargetOptions &Options,
73                       Reloc::Model RM, CodeModel::Model CM,
74                       CodeGenOpt::Level OL);
75 };
76
77 } // End llvm namespace
78
79 #endif