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"
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
;
35 virtual const TargetAsmInfo
*createTargetAsmInfo() const;
38 MipsTargetMachine(const Module
&M
, const std::string
&FS
, bool isLittle
);
40 virtual const MipsInstrInfo
*getInstrInfo() const
41 { return &InstrInfo
; }
42 virtual const TargetFrameInfo
*getFrameInfo() const
43 { return &FrameInfo
; }
44 virtual const MipsSubtarget
*getSubtargetImpl() const
45 { return &Subtarget
; }
46 virtual const TargetData
*getTargetData() const
47 { return &DataLayout
;}
49 virtual const MipsRegisterInfo
*getRegisterInfo() const {
50 return &InstrInfo
.getRegisterInfo();
53 virtual MipsTargetLowering
*getTargetLowering() const {
54 return const_cast<MipsTargetLowering
*>(&TLInfo
);
57 static unsigned getModuleMatchQuality(const Module
&M
);
59 // Pass Pipeline Configuration
60 virtual bool addInstSelector(PassManagerBase
&PM
, bool Fast
);
61 virtual bool addPreEmitPass(PassManagerBase
&PM
, bool Fast
);
62 virtual bool addAssemblyEmitter(PassManagerBase
&PM
, bool Fast
,
63 bool Verbose
, raw_ostream
&Out
);
66 /// MipselTargetMachine - Mipsel target machine.
68 class MipselTargetMachine
: public MipsTargetMachine
{
70 MipselTargetMachine(const Module
&M
, const std::string
&FS
);
72 static unsigned getModuleMatchQuality(const Module
&M
);
75 } // End llvm namespace