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 "MipsInstrInfo.h"
19 #include "MipsISelLowering.h"
20 #include "MipsJITInfo.h"
21 #include "MipsSelectionDAGInfo.h"
22 #include "MipsSubtarget.h"
23 #include "MipsELFWriterInfo.h"
24 #include "llvm/Target/TargetMachine.h"
25 #include "llvm/Target/TargetData.h"
26 #include "llvm/Target/TargetFrameLowering.h"
29 class formatted_raw_ostream;
30 class MipsRegisterInfo;
32 class MipsTargetMachine : public LLVMTargetMachine {
33 MipsSubtarget Subtarget;
34 const TargetData DataLayout; // Calculates type size & alignment
35 const MipsInstrInfo *InstrInfo;
36 const MipsFrameLowering *FrameLowering;
37 MipsTargetLowering TLInfo;
38 MipsSelectionDAGInfo TSInfo;
40 MipsELFWriterInfo ELFWriterInfo;
43 MipsTargetMachine(const Target &T, StringRef TT,
44 StringRef CPU, StringRef FS, const TargetOptions &Options,
45 Reloc::Model RM, CodeModel::Model CM,
49 virtual ~MipsTargetMachine() { delete InstrInfo; }
51 virtual const MipsInstrInfo *getInstrInfo() const
53 virtual const TargetFrameLowering *getFrameLowering() const
54 { return FrameLowering; }
55 virtual const MipsSubtarget *getSubtargetImpl() const
56 { return &Subtarget; }
57 virtual const TargetData *getTargetData() const
58 { return &DataLayout;}
59 virtual MipsJITInfo *getJITInfo()
62 virtual const MipsRegisterInfo *getRegisterInfo() const {
63 return &InstrInfo->getRegisterInfo();
66 virtual const MipsTargetLowering *getTargetLowering() const {
70 virtual const MipsSelectionDAGInfo* getSelectionDAGInfo() const {
74 virtual const MipsELFWriterInfo *getELFWriterInfo() const {
75 return &ELFWriterInfo;
78 // Pass Pipeline Configuration
79 virtual TargetPassConfig *createPassConfig(PassManagerBase &PM);
80 virtual bool addCodeEmitter(PassManagerBase &PM, JITCodeEmitter &JCE);
83 /// MipsebTargetMachine - Mips32/64 big endian target machine.
85 class MipsebTargetMachine : public MipsTargetMachine {
86 virtual void anchor();
88 MipsebTargetMachine(const Target &T, StringRef TT,
89 StringRef CPU, StringRef FS, const TargetOptions &Options,
90 Reloc::Model RM, CodeModel::Model CM,
91 CodeGenOpt::Level OL);
94 /// MipselTargetMachine - Mips32/64 little endian target machine.
96 class MipselTargetMachine : public MipsTargetMachine {
97 virtual void anchor();
99 MipselTargetMachine(const Target &T, StringRef TT,
100 StringRef CPU, StringRef FS, const TargetOptions &Options,
101 Reloc::Model RM, CodeModel::Model CM,
102 CodeGenOpt::Level OL);
105 } // End llvm namespace