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 "llvm/Target/TargetMachine.h"
21 #include "llvm/Target/TargetData.h"
22 #include "llvm/Target/TargetFrameInfo.h"
25 class formatted_raw_ostream
;
27 class MipsTargetMachine
: public LLVMTargetMachine
{
28 MipsSubtarget Subtarget
;
29 const TargetData DataLayout
; // Calculates type size & alignment
30 MipsInstrInfo InstrInfo
;
31 TargetFrameInfo FrameInfo
;
32 MipsTargetLowering TLInfo
;
34 MipsTargetMachine(const Target
&T
, const std::string
&TT
,
35 const std::string
&FS
, bool isLittle
);
37 virtual const MipsInstrInfo
*getInstrInfo() const
38 { return &InstrInfo
; }
39 virtual const TargetFrameInfo
*getFrameInfo() const
40 { return &FrameInfo
; }
41 virtual const MipsSubtarget
*getSubtargetImpl() const
42 { return &Subtarget
; }
43 virtual const TargetData
*getTargetData() const
44 { return &DataLayout
;}
46 virtual const MipsRegisterInfo
*getRegisterInfo() const {
47 return &InstrInfo
.getRegisterInfo();
50 virtual MipsTargetLowering
*getTargetLowering() const {
51 return const_cast<MipsTargetLowering
*>(&TLInfo
);
54 // Pass Pipeline Configuration
55 virtual bool addInstSelector(PassManagerBase
&PM
,
56 CodeGenOpt::Level OptLevel
);
57 virtual bool addPreEmitPass(PassManagerBase
&PM
,
58 CodeGenOpt::Level OptLevel
);
61 /// MipselTargetMachine - Mipsel target machine.
63 class MipselTargetMachine
: public MipsTargetMachine
{
65 MipselTargetMachine(const Target
&T
, const std::string
&TT
,
66 const std::string
&FS
);
69 } // End llvm namespace