LLVM API Documentation

Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

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 "X86InstrInfo.h"
00021 #include "X86JITInfo.h"
00022 
00023 namespace llvm {
00024 class IntrinsicLowering;
00025 
00026 class X86TargetMachine : public TargetMachine {
00027   X86InstrInfo    InstrInfo;
00028   TargetFrameInfo FrameInfo;
00029   X86JITInfo      JITInfo;
00030 public:
00031   X86TargetMachine(const Module &M, IntrinsicLowering *IL);
00032 
00033   virtual const X86InstrInfo     *getInstrInfo() const { return &InstrInfo; }
00034   virtual const TargetFrameInfo  *getFrameInfo() const { return &FrameInfo; }
00035   virtual       TargetJITInfo    *getJITInfo()         { return &JITInfo; }
00036   virtual const MRegisterInfo    *getRegisterInfo() const {
00037     return &InstrInfo.getRegisterInfo();
00038   }
00039 
00040   /// addPassesToEmitMachineCode - Add passes to the specified pass manager to
00041   /// get machine code emitted.  This uses a MachineCodeEmitter object to handle
00042   /// actually outputting the machine code and resolving things like the address
00043   /// of functions.  This method should returns true if machine code emission is
00044   /// not supported.
00045   ///
00046   virtual bool addPassesToEmitMachineCode(FunctionPassManager &PM,
00047                                           MachineCodeEmitter &MCE);
00048   
00049   virtual bool addPassesToEmitAssembly(PassManager &PM, std::ostream &Out);
00050 
00051   static unsigned getModuleMatchQuality(const Module &M);
00052   static unsigned getJITMatchQuality();
00053 };
00054 } // End llvm namespace
00055 
00056 #endif