Fixing a bunch of -Woverloaded-virtual warnings due to hiding getSubtargetImpl from...
[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   using LLVMTargetMachine::getSubtargetImpl;
43   const MipsSubtarget *getSubtargetImpl() const override {
44     if (Subtarget)
45       return Subtarget;
46     return &DefaultSubtarget;
47   }
48
49   /// \brief Reset the subtarget for the Mips target.
50   void resetSubtarget(MachineFunction *MF);
51
52   // Pass Pipeline Configuration
53   TargetPassConfig *createPassConfig(PassManagerBase &PM) override;
54 };
55
56 /// MipsebTargetMachine - Mips32/64 big endian target machine.
57 ///
58 class MipsebTargetMachine : public MipsTargetMachine {
59   virtual void anchor();
60 public:
61   MipsebTargetMachine(const Target &T, StringRef TT,
62                       StringRef CPU, StringRef FS, const TargetOptions &Options,
63                       Reloc::Model RM, CodeModel::Model CM,
64                       CodeGenOpt::Level OL);
65 };
66
67 /// MipselTargetMachine - Mips32/64 little endian target machine.
68 ///
69 class MipselTargetMachine : public MipsTargetMachine {
70   virtual void anchor();
71 public:
72   MipselTargetMachine(const Target &T, StringRef TT,
73                       StringRef CPU, StringRef FS, const TargetOptions &Options,
74                       Reloc::Model RM, CodeModel::Model CM,
75                       CodeGenOpt::Level OL);
76 };
77
78 } // End llvm namespace
79
80 #endif