LLVM API Documentation

MipsTargetMachine.h

Go to the documentation of this file.
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 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   
00034   protected:
00035     virtual const TargetAsmInfo *createTargetAsmInfo() const;
00036   
00037   public:
00038     MipsTargetMachine(const Module &M, const std::string &FS, bool isLittle);
00039 
00040     virtual const MipsInstrInfo   *getInstrInfo()     const 
00041     { return &InstrInfo; }
00042     virtual const TargetFrameInfo *getFrameInfo()     const 
00043     { return &FrameInfo; }
00044     virtual const MipsSubtarget   *getSubtargetImpl() const 
00045     { return &Subtarget; }
00046     virtual const TargetData      *getTargetData()    const 
00047     { return &DataLayout;}
00048 
00049     virtual const MipsRegisterInfo *getRegisterInfo()  const {
00050       return &InstrInfo.getRegisterInfo();
00051     }
00052 
00053     virtual MipsTargetLowering   *getTargetLowering() const { 
00054       return const_cast<MipsTargetLowering*>(&TLInfo); 
00055     }
00056 
00057     static unsigned getModuleMatchQuality(const Module &M);
00058 
00059     // Pass Pipeline Configuration
00060     virtual bool addInstSelector(PassManagerBase &PM, bool Fast);
00061     virtual bool addPreEmitPass(PassManagerBase &PM, bool Fast);
00062     virtual bool addAssemblyEmitter(PassManagerBase &PM, bool Fast, 
00063                                     raw_ostream &Out);
00064   };
00065 
00066 /// MipselTargetMachine - Mipsel target machine.
00067 ///
00068 class MipselTargetMachine : public MipsTargetMachine {
00069 public:
00070   MipselTargetMachine(const Module &M, const std::string &FS);
00071 
00072   static unsigned getModuleMatchQuality(const Module &M);
00073 };
00074 
00075 } // End llvm namespace
00076 
00077 #endif



This web site is hosted by the Computer Science Department at the University of Illinois at Urbana-Champaign.