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 "MipsSelectionDAGInfo.h"
21 #include "llvm/Target/TargetMachine.h"
22 #include "llvm/Target/TargetData.h"
23 #include "llvm/Target/TargetFrameInfo.h"
26 class formatted_raw_ostream
;
28 class MipsTargetMachine
: public LLVMTargetMachine
{
29 MipsSubtarget Subtarget
;
30 const TargetData DataLayout
; // Calculates type size & alignment
31 MipsInstrInfo InstrInfo
;
32 TargetFrameInfo FrameInfo
;
33 MipsTargetLowering TLInfo
;
34 MipsSelectionDAGInfo TSInfo
;
36 MipsTargetMachine(const Target
&T
, const std::string
&TT
,
37 const std::string
&FS
, bool isLittle
);
39 virtual const MipsInstrInfo
*getInstrInfo() const
40 { return &InstrInfo
; }
41 virtual const TargetFrameInfo
*getFrameInfo() const
42 { return &FrameInfo
; }
43 virtual const MipsSubtarget
*getSubtargetImpl() const
44 { return &Subtarget
; }
45 virtual const TargetData
*getTargetData() const
46 { return &DataLayout
;}
48 virtual const MipsRegisterInfo
*getRegisterInfo() const {
49 return &InstrInfo
.getRegisterInfo();
52 virtual const MipsTargetLowering
*getTargetLowering() const {
56 virtual const MipsSelectionDAGInfo
* getSelectionDAGInfo() const {
60 // Pass Pipeline Configuration
61 virtual bool addInstSelector(PassManagerBase
&PM
,
62 CodeGenOpt::Level OptLevel
);
63 virtual bool addPreEmitPass(PassManagerBase
&PM
,
64 CodeGenOpt::Level OptLevel
);
67 /// MipselTargetMachine - Mipsel target machine.
69 class MipselTargetMachine
: public MipsTargetMachine
{
71 MipselTargetMachine(const Target
&T
, const std::string
&TT
,
72 const std::string
&FS
);
75 } // End llvm namespace