LLVM API Documentation
00001 //===-- MipsTargetMachine.h - Define TargetMachine for Mips -00--*- C++ -*-===// 00002 // 00003 // The LLVM Compiler Infrastructure 00004 // 00005 // This file is distributed under the University of Illinois Open Source 00006 // License. See LICENSE.TXT for details. 00007 // 00008 //===----------------------------------------------------------------------===// 00009 // 00010 // This file declares the Mips specific subclass of TargetMachine. 00011 // 00012 //===----------------------------------------------------------------------===// 00013 00014 #ifndef MIPSTARGETMACHINE_H 00015 #define MIPSTARGETMACHINE_H 00016 00017 #include "MipsSubtarget.h" 00018 #include "MipsInstrInfo.h" 00019 #include "MipsISelLowering.h" 00020 #include "llvm/Target/TargetMachine.h" 00021 #include "llvm/Target/TargetData.h" 00022 #include "llvm/Target/TargetFrameInfo.h" 00023 00024 namespace llvm { 00025 class formatted_raw_ostream; 00026 00027 class MipsTargetMachine : public LLVMTargetMachine { 00028 MipsSubtarget Subtarget; 00029 const TargetData DataLayout; // Calculates type size & alignment 00030 MipsInstrInfo InstrInfo; 00031 TargetFrameInfo FrameInfo; 00032 MipsTargetLowering TLInfo; 00033 public: 00034 MipsTargetMachine(const Target &T, const std::string &TT, 00035 const std::string &FS, bool isLittle); 00036 00037 virtual const MipsInstrInfo *getInstrInfo() const 00038 { return &InstrInfo; } 00039 virtual const TargetFrameInfo *getFrameInfo() const 00040 { return &FrameInfo; } 00041 virtual const MipsSubtarget *getSubtargetImpl() const 00042 { return &Subtarget; } 00043 virtual const TargetData *getTargetData() const 00044 { return &DataLayout;} 00045 00046 virtual const MipsRegisterInfo *getRegisterInfo() const { 00047 return &InstrInfo.getRegisterInfo(); 00048 } 00049 00050 virtual MipsTargetLowering *getTargetLowering() const { 00051 return const_cast<MipsTargetLowering*>(&TLInfo); 00052 } 00053 00054 // Pass Pipeline Configuration 00055 virtual bool addInstSelector(PassManagerBase &PM, 00056 CodeGenOpt::Level OptLevel); 00057 virtual bool addPreEmitPass(PassManagerBase &PM, 00058 CodeGenOpt::Level OptLevel); 00059 }; 00060 00061 /// MipselTargetMachine - Mipsel target machine. 00062 /// 00063 class MipselTargetMachine : public MipsTargetMachine { 00064 public: 00065 MipselTargetMachine(const Target &T, const std::string &TT, 00066 const std::string &FS); 00067 }; 00068 00069 } // End llvm namespace 00070 00071 #endif