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/DataLayout.h"
25 #include "llvm/Target/TargetFrameLowering.h"
26 #include "llvm/Target/TargetMachine.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 OwningPtr<const MipsInstrInfo> InstrInfo;
37 OwningPtr<const MipsFrameLowering> FrameLowering;
38 MipsTargetLowering TLInfo;
39 MipsSelectionDAGInfo TSInfo;
41 ScalarTargetTransformImpl STTI;
42 VectorTargetTransformImpl VTTI;
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() {}
53 virtual const MipsInstrInfo *getInstrInfo() const
54 { return InstrInfo.get(); }
55 virtual const TargetFrameLowering *getFrameLowering() const
56 { return FrameLowering.get(); }
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 ScalarTargetTransformInfo *getScalarTargetTransformInfo()const {
79 virtual const VectorTargetTransformInfo *getVectorTargetTransformInfo()const {
83 // Pass Pipeline Configuration
84 virtual TargetPassConfig *createPassConfig(PassManagerBase &PM);
85 virtual bool addCodeEmitter(PassManagerBase &PM, JITCodeEmitter &JCE);
88 /// MipsebTargetMachine - Mips32/64 big endian target machine.
90 class MipsebTargetMachine : public MipsTargetMachine {
91 virtual void anchor();
93 MipsebTargetMachine(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 /// MipselTargetMachine - Mips32/64 little endian target machine.
101 class MipselTargetMachine : public MipsTargetMachine {
102 virtual void anchor();
104 MipselTargetMachine(const Target &T, StringRef TT,
105 StringRef CPU, StringRef FS, const TargetOptions &Options,
106 Reloc::Model RM, CodeModel::Model CM,
107 CodeGenOpt::Level OL);
110 } // End llvm namespace