LLVM API Documentation

AlphaTargetMachine.h

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