LLVM API Documentation
00001 //===-- AlphaTargetMachine.h - Define TargetMachine for Alpha ---*- C++ -*-===// 00002 // 00003 // The LLVM Compiler Infrastructure 00004 // 00005 // This file is distributed under the University of Illinois Open Source 00006 // 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 "AlphaInstrInfo.h" 00021 #include "AlphaJITInfo.h" 00022 #include "AlphaISelLowering.h" 00023 #include "AlphaSubtarget.h" 00024 00025 namespace llvm { 00026 00027 class GlobalValue; 00028 00029 class AlphaTargetMachine : public LLVMTargetMachine { 00030 const TargetData DataLayout; // Calculates type size & alignment 00031 AlphaInstrInfo InstrInfo; 00032 TargetFrameInfo FrameInfo; 00033 AlphaJITInfo JITInfo; 00034 AlphaSubtarget Subtarget; 00035 AlphaTargetLowering TLInfo; 00036 00037 protected: 00038 virtual const TargetAsmInfo *createTargetAsmInfo() const; 00039 00040 public: 00041 AlphaTargetMachine(const Module &M, const std::string &FS); 00042 00043 virtual const AlphaInstrInfo *getInstrInfo() const { return &InstrInfo; } 00044 virtual const TargetFrameInfo *getFrameInfo() const { return &FrameInfo; } 00045 virtual const AlphaSubtarget *getSubtargetImpl() const{ return &Subtarget; } 00046 virtual const AlphaRegisterInfo *getRegisterInfo() const { 00047 return &InstrInfo.getRegisterInfo(); 00048 } 00049 virtual AlphaTargetLowering* getTargetLowering() const { 00050 return const_cast<AlphaTargetLowering*>(&TLInfo); 00051 } 00052 virtual const TargetData *getTargetData() const { return &DataLayout; } 00053 virtual AlphaJITInfo* getJITInfo() { 00054 return &JITInfo; 00055 } 00056 00057 static unsigned getJITMatchQuality(); 00058 static unsigned getModuleMatchQuality(const Module &M); 00059 00060 // Pass Pipeline Configuration 00061 virtual bool addInstSelector(PassManagerBase &PM, bool Fast); 00062 virtual bool addPreEmitPass(PassManagerBase &PM, bool Fast); 00063 virtual bool addAssemblyEmitter(PassManagerBase &PM, bool Fast, 00064 raw_ostream &Out); 00065 virtual bool addCodeEmitter(PassManagerBase &PM, bool Fast, 00066 bool DumpAsm, MachineCodeEmitter &MCE); 00067 virtual bool addSimpleCodeEmitter(PassManagerBase &PM, bool Fast, 00068 bool DumpAsm, MachineCodeEmitter &MCE); 00069 }; 00070 00071 } // end namespace llvm 00072 00073 #endif