LLVM API Documentation

PPCTargetMachine.h

Go to the documentation of this file.
00001 //===-- PPCTargetMachine.h - Define TargetMachine for PowerPC -----*- C++ -*-=//
00002 //
00003 //                     The LLVM Compiler Infrastructure
00004 //
00005 // This file was developed by the LLVM research group and is distributed under
00006 // the University of Illinois Open Source License. See LICENSE.TXT for details.
00007 //
00008 //===----------------------------------------------------------------------===//
00009 //
00010 // This file declares the PowerPC specific subclass of TargetMachine.
00011 //
00012 //===----------------------------------------------------------------------===//
00013 
00014 #ifndef PPC_TARGETMACHINE_H
00015 #define PPC_TARGETMACHINE_H
00016 
00017 #include "PPCFrameInfo.h"
00018 #include "PPCSubtarget.h"
00019 #include "PPCJITInfo.h"
00020 #include "PPCInstrInfo.h"
00021 #include "PPCISelLowering.h"
00022 #include "llvm/Target/TargetMachine.h"
00023 
00024 namespace llvm {
00025 class PassManager;
00026 class GlobalValue;
00027 
00028 class PPCTargetMachine : public TargetMachine {
00029   PPCInstrInfo           InstrInfo;
00030   PPCSubtarget           Subtarget;
00031   PPCFrameInfo           FrameInfo;
00032   PPCJITInfo             JITInfo;
00033   PPCTargetLowering      TLInfo;
00034   InstrItineraryData     InstrItins;
00035 public:
00036   PPCTargetMachine(const Module &M, const std::string &FS);
00037 
00038   virtual const PPCInstrInfo     *getInstrInfo() const { return &InstrInfo; }
00039   virtual const TargetFrameInfo  *getFrameInfo() const { return &FrameInfo; }
00040   virtual       TargetJITInfo    *getJITInfo()         { return &JITInfo; }
00041   virtual const TargetSubtarget  *getSubtargetImpl() const{ return &Subtarget; }
00042   virtual       PPCTargetLowering *getTargetLowering() { return &TLInfo; }
00043   virtual const MRegisterInfo    *getRegisterInfo() const {
00044     return &InstrInfo.getRegisterInfo();
00045   }
00046   virtual const InstrItineraryData getInstrItineraryData() const {  
00047     return InstrItins;
00048   }
00049   
00050 
00051   static unsigned getJITMatchQuality();
00052 
00053   static unsigned getModuleMatchQuality(const Module &M);
00054   
00055   virtual bool addPassesToEmitFile(PassManager &PM, std::ostream &Out,
00056                                    CodeGenFileType FileType, bool Fast);
00057   
00058   bool addPassesToEmitMachineCode(FunctionPassManager &PM,
00059                                   MachineCodeEmitter &MCE);
00060 };
00061   
00062 } // end namespace llvm
00063 
00064 #endif