Add pass that expands pseudo instructions into target instructions after register...
[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, const std::string &TT,
38                       const std::string &FS, bool isLittle);
39
40     virtual const MipsInstrInfo   *getInstrInfo()     const
41     { return &InstrInfo; }
42     virtual const TargetFrameLowering *getFrameLowering()     const
43     { return &FrameLowering; }
44     virtual const MipsSubtarget   *getSubtargetImpl() const
45     { return &Subtarget; }
46     virtual const TargetData      *getTargetData()    const
47     { return &DataLayout;}
48
49     virtual const MipsRegisterInfo *getRegisterInfo()  const {
50       return &InstrInfo.getRegisterInfo();
51     }
52
53     virtual const MipsTargetLowering *getTargetLowering() const {
54       return &TLInfo;
55     }
56
57     virtual const MipsSelectionDAGInfo* getSelectionDAGInfo() const {
58       return &TSInfo;
59     }
60
61     // Pass Pipeline Configuration
62     virtual bool addInstSelector(PassManagerBase &PM,
63                                  CodeGenOpt::Level OptLevel);
64     virtual bool addPreEmitPass(PassManagerBase &PM,
65                                 CodeGenOpt::Level OptLevel);
66     virtual bool addPostRegAlloc(PassManagerBase &, CodeGenOpt::Level);
67   };
68
69 /// MipselTargetMachine - Mipsel target machine.
70 ///
71 class MipselTargetMachine : public MipsTargetMachine {
72 public:
73   MipselTargetMachine(const Target &T, const std::string &TT,
74                       const std::string &FS);
75 };
76
77 } // End llvm namespace
78
79 #endif