1 //===-- MipsTargetMachine.h - Define TargetMachine for Mips -00--*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file declares the Mips specific subclass of TargetMachine.
12 //===----------------------------------------------------------------------===//
14 #ifndef MIPSTARGETMACHINE_H
15 #define MIPSTARGETMACHINE_H
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"
27 class formatted_raw_ostream
;
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
;
37 MipsTargetMachine(const Target
&T
, const std::string
&TT
,
38 const std::string
&CPU
, const std::string
&FS
,
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
;}
50 virtual const MipsRegisterInfo
*getRegisterInfo() const {
51 return &InstrInfo
.getRegisterInfo();
54 virtual const MipsTargetLowering
*getTargetLowering() const {
58 virtual const MipsSelectionDAGInfo
* getSelectionDAGInfo() const {
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
);
72 /// MipselTargetMachine - Mipsel target machine.
74 class MipselTargetMachine
: public MipsTargetMachine
{
76 MipselTargetMachine(const Target
&T
, const std::string
&TT
,
77 const std::string
&CPU
, const std::string
&FS
);
80 } // End llvm namespace