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;
43 VectorTargetTransformInfo VTTI;
46 MipsTargetMachine(const Target &T, StringRef TT,
47 StringRef CPU, StringRef FS, const TargetOptions &Options,
48 Reloc::Model RM, CodeModel::Model CM,
52 virtual ~MipsTargetMachine() { delete InstrInfo; }
54 virtual const MipsInstrInfo *getInstrInfo() const
56 virtual const TargetFrameLowering *getFrameLowering() const
57 { return FrameLowering; }
58 virtual const MipsSubtarget *getSubtargetImpl() const
59 { return &Subtarget; }
60 virtual const DataLayout *getDataLayout() const
62 virtual MipsJITInfo *getJITInfo()
65 virtual const MipsRegisterInfo *getRegisterInfo() const {
66 return &InstrInfo->getRegisterInfo();
69 virtual const MipsTargetLowering *getTargetLowering() const {
73 virtual const MipsSelectionDAGInfo* getSelectionDAGInfo() const {
77 virtual const MipsELFWriterInfo *getELFWriterInfo() const {
78 return &ELFWriterInfo;
80 virtual const ScalarTargetTransformInfo *getScalarTargetTransformInfo()const {
83 virtual const VectorTargetTransformInfo *getVectorTargetTransformInfo()const {
87 // Pass Pipeline Configuration
88 virtual TargetPassConfig *createPassConfig(PassManagerBase &PM);
89 virtual bool addCodeEmitter(PassManagerBase &PM, JITCodeEmitter &JCE);
92 /// MipsebTargetMachine - Mips32/64 big endian target machine.
94 class MipsebTargetMachine : public MipsTargetMachine {
95 virtual void anchor();
97 MipsebTargetMachine(const Target &T, StringRef TT,
98 StringRef CPU, StringRef FS, const TargetOptions &Options,
99 Reloc::Model RM, CodeModel::Model CM,
100 CodeGenOpt::Level OL);
103 /// MipselTargetMachine - Mips32/64 little endian target machine.
105 class MipselTargetMachine : public MipsTargetMachine {
106 virtual void anchor();
108 MipselTargetMachine(const Target &T, StringRef TT,
109 StringRef CPU, StringRef FS, const TargetOptions &Options,
110 Reloc::Model RM, CodeModel::Model CM,
111 CodeGenOpt::Level OL);
114 } // End llvm namespace