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 "llvm/Target/TargetMachine.h"
24 #include "llvm/Target/TargetData.h"
25 #include "llvm/Target/TargetFrameLowering.h"
28 class formatted_raw_ostream;
29 class MipsRegisterInfo;
31 class MipsTargetMachine : public LLVMTargetMachine {
32 MipsSubtarget Subtarget;
33 const TargetData DataLayout; // Calculates type size & alignment
34 const MipsInstrInfo *InstrInfo;
35 const MipsFrameLowering *FrameLowering;
36 MipsTargetLowering TLInfo;
37 MipsSelectionDAGInfo TSInfo;
41 MipsTargetMachine(const Target &T, StringRef TT,
42 StringRef CPU, StringRef FS, const TargetOptions &Options,
43 Reloc::Model RM, CodeModel::Model CM,
47 virtual ~MipsTargetMachine() { delete InstrInfo; }
49 virtual const MipsInstrInfo *getInstrInfo() const
51 virtual const TargetFrameLowering *getFrameLowering() const
52 { return FrameLowering; }
53 virtual const MipsSubtarget *getSubtargetImpl() const
54 { return &Subtarget; }
55 virtual const TargetData *getTargetData() const
56 { return &DataLayout;}
57 virtual MipsJITInfo *getJITInfo()
60 virtual const MipsRegisterInfo *getRegisterInfo() const {
61 return &InstrInfo->getRegisterInfo();
64 virtual const MipsTargetLowering *getTargetLowering() const {
68 virtual const MipsSelectionDAGInfo* getSelectionDAGInfo() const {
72 // Pass Pipeline Configuration
73 virtual TargetPassConfig *createPassConfig(PassManagerBase &PM);
74 virtual bool addCodeEmitter(PassManagerBase &PM, JITCodeEmitter &JCE);
77 /// MipsebTargetMachine - Mips32/64 big endian target machine.
79 class MipsebTargetMachine : public MipsTargetMachine {
80 virtual void anchor();
82 MipsebTargetMachine(const Target &T, StringRef TT,
83 StringRef CPU, StringRef FS, const TargetOptions &Options,
84 Reloc::Model RM, CodeModel::Model CM,
85 CodeGenOpt::Level OL);
88 /// MipselTargetMachine - Mips32/64 little endian target machine.
90 class MipselTargetMachine : public MipsTargetMachine {
91 virtual void anchor();
93 MipselTargetMachine(const Target &T, StringRef TT,
94 StringRef CPU, StringRef FS, const TargetOptions &Options,
95 Reloc::Model RM, CodeModel::Model CM,
96 CodeGenOpt::Level OL);
99 } // End llvm namespace