1 //===-- MipsTargetMachine.h - Define TargetMachine for Mips -00--*- 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 "MipsSubtarget.h"
18 #include "MipsInstrInfo.h"
19 #include "MipsISelLowering.h"
20 #include "MipsFrameLowering.h"
21 #include "MipsSelectionDAGInfo.h"
22 #include "llvm/Target/TargetMachine.h"
23 #include "llvm/Target/TargetData.h"
24 #include "llvm/Target/TargetFrameLowering.h"
27 class formatted_raw_ostream;
29 class MipsTargetMachine : public LLVMTargetMachine {
30 MipsSubtarget Subtarget;
31 const TargetData DataLayout; // Calculates type size & alignment
32 MipsInstrInfo InstrInfo;
33 MipsFrameLowering FrameLowering;
34 MipsTargetLowering TLInfo;
35 MipsSelectionDAGInfo TSInfo;
37 MipsTargetMachine(const Target &T, StringRef TT,
38 StringRef CPU, StringRef FS,
39 Reloc::Model RM, CodeModel::Model CM,
42 virtual const MipsInstrInfo *getInstrInfo() const
43 { return &InstrInfo; }
44 virtual const TargetFrameLowering *getFrameLowering() const
45 { return &FrameLowering; }
46 virtual const MipsSubtarget *getSubtargetImpl() const
47 { return &Subtarget; }
48 virtual const TargetData *getTargetData() const
49 { return &DataLayout;}
51 virtual const MipsRegisterInfo *getRegisterInfo() const {
52 return &InstrInfo.getRegisterInfo();
55 virtual const MipsTargetLowering *getTargetLowering() const {
59 virtual const MipsSelectionDAGInfo* getSelectionDAGInfo() const {
63 // Pass Pipeline Configuration
64 virtual bool addInstSelector(PassManagerBase &PM,
65 CodeGenOpt::Level OptLevel);
66 virtual bool addPreEmitPass(PassManagerBase &PM,
67 CodeGenOpt::Level OptLevel);
68 virtual bool addPreRegAlloc(PassManagerBase &PM,
69 CodeGenOpt::Level OptLevel);
70 virtual bool addPostRegAlloc(PassManagerBase &, CodeGenOpt::Level);
73 /// MipselTargetMachine - Mipsel target machine.
75 class MipselTargetMachine : public MipsTargetMachine {
77 MipselTargetMachine(const Target &T, StringRef TT,
78 StringRef CPU, StringRef FS,
79 Reloc::Model RM, CodeModel::Model CM);
82 } // End llvm namespace