LLVM API Documentation
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/TargetData.h" 00019 #include "llvm/Target/TargetFrameInfo.h" 00020 #include "llvm/PassManager.h" 00021 #include "AlphaInstrInfo.h" 00022 #include "AlphaJITInfo.h" 00023 #include "AlphaSubtarget.h" 00024 00025 namespace llvm { 00026 00027 class GlobalValue; 00028 00029 class AlphaTargetMachine : public TargetMachine { 00030 const TargetData DataLayout; // Calculates type size & alignment 00031 AlphaInstrInfo InstrInfo; 00032 TargetFrameInfo FrameInfo; 00033 AlphaJITInfo JITInfo; 00034 AlphaSubtarget Subtarget; 00035 00036 public: 00037 AlphaTargetMachine(const Module &M, const std::string &FS); 00038 00039 virtual const AlphaInstrInfo *getInstrInfo() const { return &InstrInfo; } 00040 virtual const TargetFrameInfo *getFrameInfo() const { return &FrameInfo; } 00041 virtual const TargetSubtarget *getSubtargetImpl() const{ return &Subtarget; } 00042 virtual const MRegisterInfo *getRegisterInfo() const { 00043 return &InstrInfo.getRegisterInfo(); 00044 } 00045 virtual const TargetData *getTargetData() const { return &DataLayout; } 00046 virtual TargetJITInfo* getJITInfo() { 00047 return &JITInfo; 00048 } 00049 00050 static unsigned getJITMatchQuality(); 00051 00052 virtual bool addPassesToEmitMachineCode(FunctionPassManager &PM, 00053 MachineCodeEmitter &MCE); 00054 00055 virtual bool addPassesToEmitFile(PassManager &PM, std::ostream &Out, 00056 CodeGenFileType FileType, bool Fast); 00057 00058 static unsigned getModuleMatchQuality(const Module &M); 00059 }; 00060 00061 } // end namespace llvm 00062 00063 #endif