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/DataLayout.h"
25 #include "llvm/Target/TargetFrameLowering.h"
26 #include "llvm/Target/TargetTransformImpl.h"
29 class formatted_raw_ostream;
30 class MipsRegisterInfo;
32 class MipsTargetMachine : public LLVMTargetMachine {
33 MipsSubtarget Subtarget;
34 const DataLayout DL; // Calculates type size & alignment
35 const MipsInstrInfo *InstrInfo;
36 const MipsFrameLowering *FrameLowering;
37 MipsTargetLowering TLInfo;
38 MipsSelectionDAGInfo TSInfo;
40 ScalarTargetTransformImpl STTI;
41 VectorTargetTransformImpl VTTI;
44 MipsTargetMachine(const Target &T, StringRef TT,
45 StringRef CPU, StringRef FS, const TargetOptions &Options,
46 Reloc::Model RM, CodeModel::Model CM,
50 virtual ~MipsTargetMachine() { delete InstrInfo; }
52 virtual const MipsInstrInfo *getInstrInfo() const
54 virtual const TargetFrameLowering *getFrameLowering() const
55 { return FrameLowering; }
56 virtual const MipsSubtarget *getSubtargetImpl() const
57 { return &Subtarget; }
58 virtual const DataLayout *getDataLayout() const
60 virtual MipsJITInfo *getJITInfo()
63 virtual const MipsRegisterInfo *getRegisterInfo() const {
64 return &InstrInfo->getRegisterInfo();
67 virtual const MipsTargetLowering *getTargetLowering() const {
71 virtual const MipsSelectionDAGInfo* getSelectionDAGInfo() const {
75 virtual const ScalarTargetTransformInfo *getScalarTargetTransformInfo()const {
78 virtual const VectorTargetTransformInfo *getVectorTargetTransformInfo()const {
82 // Pass Pipeline Configuration
83 virtual TargetPassConfig *createPassConfig(PassManagerBase &PM);
84 virtual bool addCodeEmitter(PassManagerBase &PM, JITCodeEmitter &JCE);
87 /// MipsebTargetMachine - Mips32/64 big endian target machine.
89 class MipsebTargetMachine : public MipsTargetMachine {
90 virtual void anchor();
92 MipsebTargetMachine(const Target &T, StringRef TT,
93 StringRef CPU, StringRef FS, const TargetOptions &Options,
94 Reloc::Model RM, CodeModel::Model CM,
95 CodeGenOpt::Level OL);
98 /// MipselTargetMachine - Mips32/64 little endian target machine.
100 class MipselTargetMachine : public MipsTargetMachine {
101 virtual void anchor();
103 MipselTargetMachine(const Target &T, StringRef TT,
104 StringRef CPU, StringRef FS, const TargetOptions &Options,
105 Reloc::Model RM, CodeModel::Model CM,
106 CodeGenOpt::Level OL);
109 } // End llvm namespace