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/DataLayout.h"
26 #include "llvm/Target/TargetFrameLowering.h"
27 #include "llvm/Target/TargetTransformImpl.h"
30 class formatted_raw_ostream;
31 class MipsRegisterInfo;
33 class MipsTargetMachine : public LLVMTargetMachine {
34 MipsSubtarget Subtarget;
35 const DataLayout DL; // Calculates type size & alignment
36 const MipsInstrInfo *InstrInfo;
37 const MipsFrameLowering *FrameLowering;
38 MipsTargetLowering TLInfo;
39 MipsSelectionDAGInfo TSInfo;
41 MipsELFWriterInfo ELFWriterInfo;
42 ScalarTargetTransformImpl STTI;
45 MipsTargetMachine(const Target &T, StringRef TT,
46 StringRef CPU, StringRef FS, const TargetOptions &Options,
47 Reloc::Model RM, CodeModel::Model CM,
51 virtual ~MipsTargetMachine() { delete InstrInfo; }
53 virtual const MipsInstrInfo *getInstrInfo() const
55 virtual const TargetFrameLowering *getFrameLowering() const
56 { return FrameLowering; }
57 virtual const MipsSubtarget *getSubtargetImpl() const
58 { return &Subtarget; }
59 virtual const DataLayout *getDataLayout() const
61 virtual MipsJITInfo *getJITInfo()
64 virtual const MipsRegisterInfo *getRegisterInfo() const {
65 return &InstrInfo->getRegisterInfo();
68 virtual const MipsTargetLowering *getTargetLowering() const {
72 virtual const MipsSelectionDAGInfo* getSelectionDAGInfo() const {
76 virtual const MipsELFWriterInfo *getELFWriterInfo() const {
77 return &ELFWriterInfo;
80 // Pass Pipeline Configuration
81 virtual TargetPassConfig *createPassConfig(PassManagerBase &PM);
82 virtual bool addCodeEmitter(PassManagerBase &PM, JITCodeEmitter &JCE);
85 /// MipsebTargetMachine - Mips32/64 big endian target machine.
87 class MipsebTargetMachine : public MipsTargetMachine {
88 virtual void anchor();
90 MipsebTargetMachine(const Target &T, StringRef TT,
91 StringRef CPU, StringRef FS, const TargetOptions &Options,
92 Reloc::Model RM, CodeModel::Model CM,
93 CodeGenOpt::Level OL);
96 /// MipselTargetMachine - Mips32/64 little endian target machine.
98 class MipselTargetMachine : public MipsTargetMachine {
99 virtual void anchor();
101 MipselTargetMachine(const Target &T, StringRef TT,
102 StringRef CPU, StringRef FS, const TargetOptions &Options,
103 Reloc::Model RM, CodeModel::Model CM,
104 CodeGenOpt::Level OL);
107 } // End llvm namespace