Move all of the header files which are involved in modelling the LLVM IR
[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 MIPSTARGETMACHINE_H
15 #define MIPSTARGETMACHINE_H
16
17 #include "MipsFrameLowering.h"
18 #include "MipsISelLowering.h"
19 #include "MipsInstrInfo.h"
20 #include "MipsJITInfo.h"
21 #include "MipsSelectionDAGInfo.h"
22 #include "MipsSubtarget.h"
23 #include "llvm/ADT/OwningPtr.h"
24 #include "llvm/IR/DataLayout.h"
25 #include "llvm/Target/TargetFrameLowering.h"
26 #include "llvm/Target/TargetMachine.h"
27 #include "llvm/Target/TargetTransformImpl.h"
28
29 namespace llvm {
30 class formatted_raw_ostream;
31 class MipsRegisterInfo;
32
33 class MipsTargetMachine : public LLVMTargetMachine {
34   MipsSubtarget       Subtarget;
35   const DataLayout    DL; // Calculates type size & alignment
36   OwningPtr<const MipsInstrInfo> InstrInfo;
37   OwningPtr<const MipsFrameLowering> FrameLowering;
38   MipsTargetLowering  TLInfo;
39   MipsSelectionDAGInfo TSInfo;
40   MipsJITInfo JITInfo;
41   ScalarTargetTransformImpl STTI;
42   VectorTargetTransformImpl VTTI;
43
44 public:
45   MipsTargetMachine(const Target &T, StringRef TT,
46                     StringRef CPU, StringRef FS, const TargetOptions &Options,
47                     Reloc::Model RM, CodeModel::Model CM,
48                     CodeGenOpt::Level OL,
49                     bool isLittle);
50
51   virtual ~MipsTargetMachine() {}
52
53   virtual const MipsInstrInfo *getInstrInfo() const
54   { return InstrInfo.get(); }
55   virtual const TargetFrameLowering *getFrameLowering() const
56   { return FrameLowering.get(); }
57   virtual const MipsSubtarget *getSubtargetImpl() const
58   { return &Subtarget; }
59   virtual const DataLayout *getDataLayout()    const
60   { return &DL;}
61   virtual MipsJITInfo *getJITInfo()
62   { return &JITInfo; }
63
64   virtual const MipsRegisterInfo *getRegisterInfo()  const {
65     return &InstrInfo->getRegisterInfo();
66   }
67
68   virtual const MipsTargetLowering *getTargetLowering() const {
69     return &TLInfo;
70   }
71
72   virtual const MipsSelectionDAGInfo* getSelectionDAGInfo() const {
73     return &TSInfo;
74   }
75
76   virtual const ScalarTargetTransformInfo *getScalarTargetTransformInfo()const {
77     return &STTI;
78   }
79   virtual const VectorTargetTransformInfo *getVectorTargetTransformInfo()const {
80     return &VTTI;
81   }
82
83   // Pass Pipeline Configuration
84   virtual TargetPassConfig *createPassConfig(PassManagerBase &PM);
85   virtual bool addCodeEmitter(PassManagerBase &PM, JITCodeEmitter &JCE);
86 };
87
88 /// MipsebTargetMachine - Mips32/64 big endian target machine.
89 ///
90 class MipsebTargetMachine : public MipsTargetMachine {
91   virtual void anchor();
92 public:
93   MipsebTargetMachine(const Target &T, StringRef TT,
94                       StringRef CPU, StringRef FS, const TargetOptions &Options,
95                       Reloc::Model RM, CodeModel::Model CM,
96                       CodeGenOpt::Level OL);
97 };
98
99 /// MipselTargetMachine - Mips32/64 little endian target machine.
100 ///
101 class MipselTargetMachine : public MipsTargetMachine {
102   virtual void anchor();
103 public:
104   MipselTargetMachine(const Target &T, StringRef TT,
105                       StringRef CPU, StringRef FS, const TargetOptions &Options,
106                       Reloc::Model RM, CodeModel::Model CM,
107                       CodeGenOpt::Level OL);
108 };
109
110 } // End llvm namespace
111
112 #endif