Introduce MCCodeGenInfo, which keeps information that can affect codegen
[oota-llvm.git] / lib / Target / Mips / MipsTargetMachine.h
1 //===-- MipsTargetMachine.h - Define TargetMachine for Mips -00--*- 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 "MipsSubtarget.h"
18 #include "MipsInstrInfo.h"
19 #include "MipsISelLowering.h"
20 #include "MipsFrameLowering.h"
21 #include "MipsSelectionDAGInfo.h"
22 #include "llvm/Target/TargetMachine.h"
23 #include "llvm/Target/TargetData.h"
24 #include "llvm/Target/TargetFrameLowering.h"
25
26 namespace llvm {
27   class formatted_raw_ostream;
28
29   class MipsTargetMachine : public LLVMTargetMachine {
30     MipsSubtarget       Subtarget;
31     const TargetData    DataLayout; // Calculates type size & alignment
32     MipsInstrInfo       InstrInfo;
33     MipsFrameLowering   FrameLowering;
34     MipsTargetLowering  TLInfo;
35     MipsSelectionDAGInfo TSInfo;
36   public:
37     MipsTargetMachine(const Target &T, StringRef TT,
38                       StringRef CPU, StringRef FS,
39                       Reloc::Model RM, bool isLittle);
40
41     virtual const MipsInstrInfo   *getInstrInfo()     const
42     { return &InstrInfo; }
43     virtual const TargetFrameLowering *getFrameLowering()     const
44     { return &FrameLowering; }
45     virtual const MipsSubtarget   *getSubtargetImpl() const
46     { return &Subtarget; }
47     virtual const TargetData      *getTargetData()    const
48     { return &DataLayout;}
49
50     virtual const MipsRegisterInfo *getRegisterInfo()  const {
51       return &InstrInfo.getRegisterInfo();
52     }
53
54     virtual const MipsTargetLowering *getTargetLowering() const {
55       return &TLInfo;
56     }
57
58     virtual const MipsSelectionDAGInfo* getSelectionDAGInfo() const {
59       return &TSInfo;
60     }
61
62     // Pass Pipeline Configuration
63     virtual bool addInstSelector(PassManagerBase &PM,
64                                  CodeGenOpt::Level OptLevel);
65     virtual bool addPreEmitPass(PassManagerBase &PM,
66                                 CodeGenOpt::Level OptLevel);
67     virtual bool addPreRegAlloc(PassManagerBase &PM,
68                                 CodeGenOpt::Level OptLevel);
69     virtual bool addPostRegAlloc(PassManagerBase &, CodeGenOpt::Level);
70   };
71
72 /// MipselTargetMachine - Mipsel target machine.
73 ///
74 class MipselTargetMachine : public MipsTargetMachine {
75 public:
76   MipselTargetMachine(const Target &T, StringRef TT,
77                       StringRef CPU, StringRef FS, Reloc::Model RM);
78 };
79
80 } // End llvm namespace
81
82 #endif