1 //===-- MipsTargetMachine.h - Define TargetMachine for Mips -----*- 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 "MipsFrameLowering.h"
18 #include "MipsISelLowering.h"
19 #include "MipsInstrInfo.h"
20 #include "MipsJITInfo.h"
21 #include "MipsSelectionDAGInfo.h"
22 #include "MipsSubtarget.h"
23 #include "llvm/ADT/OwningPtr.h"
24 #include "llvm/IR/DataLayout.h"
25 #include "llvm/Target/TargetFrameLowering.h"
26 #include "llvm/Target/TargetMachine.h"
29 class formatted_raw_ostream;
30 class MipsRegisterInfo;
32 class MipsTargetMachine : public LLVMTargetMachine {
33 MipsSubtarget Subtarget;
34 const DataLayout DL; // Calculates type size & alignment
35 OwningPtr<const MipsInstrInfo> InstrInfo;
36 OwningPtr<const MipsFrameLowering> FrameLowering;
37 OwningPtr<const MipsTargetLowering> TLInfo;
38 MipsSelectionDAGInfo TSInfo;
42 MipsTargetMachine(const Target &T, StringRef TT,
43 StringRef CPU, StringRef FS, const TargetOptions &Options,
44 Reloc::Model RM, CodeModel::Model CM,
48 virtual ~MipsTargetMachine() {}
50 virtual const MipsInstrInfo *getInstrInfo() const
51 { return InstrInfo.get(); }
52 virtual const TargetFrameLowering *getFrameLowering() const
53 { return FrameLowering.get(); }
54 virtual const MipsSubtarget *getSubtargetImpl() const
55 { return &Subtarget; }
56 virtual const DataLayout *getDataLayout() const
58 virtual MipsJITInfo *getJITInfo()
61 virtual const MipsRegisterInfo *getRegisterInfo() const {
62 return &InstrInfo->getRegisterInfo();
65 virtual const MipsTargetLowering *getTargetLowering() const {
69 virtual const MipsSelectionDAGInfo* getSelectionDAGInfo() const {
73 // Pass Pipeline Configuration
74 virtual TargetPassConfig *createPassConfig(PassManagerBase &PM);
75 virtual bool addCodeEmitter(PassManagerBase &PM, JITCodeEmitter &JCE);
78 /// MipsebTargetMachine - Mips32/64 big endian target machine.
80 class MipsebTargetMachine : public MipsTargetMachine {
81 virtual void anchor();
83 MipsebTargetMachine(const Target &T, StringRef TT,
84 StringRef CPU, StringRef FS, const TargetOptions &Options,
85 Reloc::Model RM, CodeModel::Model CM,
86 CodeGenOpt::Level OL);
89 /// MipselTargetMachine - Mips32/64 little endian target machine.
91 class MipselTargetMachine : public MipsTargetMachine {
92 virtual void anchor();
94 MipselTargetMachine(const Target &T, StringRef TT,
95 StringRef CPU, StringRef FS, const TargetOptions &Options,
96 Reloc::Model RM, CodeModel::Model CM,
97 CodeGenOpt::Level OL);
100 } // End llvm namespace