LLVM API Documentation

X86TargetMachine.h

Go to the documentation of this file.
00001 //===-- X86TargetMachine.h - Define TargetMachine for the X86 ---*- 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 X86 specific subclass of TargetMachine.
00011 //
00012 //===----------------------------------------------------------------------===//
00013 
00014 #ifndef X86TARGETMACHINE_H
00015 #define X86TARGETMACHINE_H
00016 
00017 #include "llvm/Target/TargetMachine.h"
00018 #include "llvm/Target/TargetFrameInfo.h"
00019 #include "llvm/PassManager.h"
00020 #include "X86.h"
00021 #include "X86InstrInfo.h"
00022 #include "X86JITInfo.h"
00023 #include "X86Subtarget.h"
00024 #include "X86ISelLowering.h"
00025 
00026 namespace llvm {
00027 
00028 class X86TargetMachine : public TargetMachine {
00029   X86InstrInfo      InstrInfo;
00030   X86Subtarget      Subtarget;
00031   TargetFrameInfo   FrameInfo;
00032   X86JITInfo        JITInfo;
00033   X86TargetLowering TLInfo;
00034 public:
00035   X86TargetMachine(const Module &M, const std::string &FS);
00036 
00037   virtual const X86InstrInfo     *getInstrInfo() const { return &InstrInfo; }
00038   virtual const TargetFrameInfo  *getFrameInfo() const { return &FrameInfo; }
00039   virtual       TargetJITInfo    *getJITInfo()         { return &JITInfo; }
00040   virtual const TargetSubtarget  *getSubtargetImpl() const{ return &Subtarget; }
00041   virtual       X86TargetLowering *getTargetLowering() { return &TLInfo; }
00042   virtual const MRegisterInfo    *getRegisterInfo() const {
00043     return &InstrInfo.getRegisterInfo();
00044   }
00045 
00046   virtual bool addPassesToEmitMachineCode(FunctionPassManager &PM,
00047                                           MachineCodeEmitter &MCE);
00048 
00049   virtual bool addPassesToEmitFile(PassManager &PM, std::ostream &Out,
00050                                    CodeGenFileType FileType, bool Fast);
00051 
00052   static unsigned getModuleMatchQuality(const Module &M);
00053   static unsigned getJITMatchQuality();
00054 };
00055 } // End llvm namespace
00056 
00057 #endif