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 "llvm/Target/TargetMachine.h"
21 #include "llvm/Target/TargetData.h"
22 #include "llvm/Target/TargetFrameInfo.h"
25 class MipsTargetMachine : public LLVMTargetMachine {
26 MipsSubtarget Subtarget;
27 const TargetData DataLayout; // Calculates type size & alignment
28 MipsInstrInfo InstrInfo;
29 TargetFrameInfo FrameInfo;
30 MipsTargetLowering TLInfo;
33 virtual const TargetAsmInfo *createTargetAsmInfo() const;
36 MipsTargetMachine(const Module &M, const std::string &FS, bool isLittle);
38 virtual const MipsInstrInfo *getInstrInfo() const
39 { return &InstrInfo; }
40 virtual const TargetFrameInfo *getFrameInfo() const
41 { return &FrameInfo; }
42 virtual const MipsSubtarget *getSubtargetImpl() const
43 { return &Subtarget; }
44 virtual const TargetData *getTargetData() const
45 { return &DataLayout;}
47 virtual const MipsRegisterInfo *getRegisterInfo() const {
48 return &InstrInfo.getRegisterInfo();
51 virtual MipsTargetLowering *getTargetLowering() const {
52 return const_cast<MipsTargetLowering*>(&TLInfo);
55 static unsigned getModuleMatchQuality(const Module &M);
57 // Pass Pipeline Configuration
58 virtual bool addInstSelector(PassManagerBase &PM, bool Fast);
59 virtual bool addPreEmitPass(PassManagerBase &PM, bool Fast);
60 virtual bool addAssemblyEmitter(PassManagerBase &PM, bool Fast,
64 /// MipselTargetMachine - Mipsel target machine.
66 class MipselTargetMachine : public MipsTargetMachine {
68 MipselTargetMachine(const Module &M, const std::string &FS);
70 static unsigned getModuleMatchQuality(const Module &M);
73 } // End llvm namespace