LLVM API Documentation
00001 //===-- BlackfinTargetMachine.h - TargetMachine for Blackfin ----*- 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 Blackfin specific subclass of TargetMachine. 00011 // 00012 //===----------------------------------------------------------------------===// 00013 00014 #ifndef BLACKFINTARGETMACHINE_H 00015 #define BLACKFINTARGETMACHINE_H 00016 00017 #include "llvm/Target/TargetMachine.h" 00018 #include "llvm/Target/TargetData.h" 00019 #include "llvm/Target/TargetFrameInfo.h" 00020 #include "BlackfinInstrInfo.h" 00021 #include "BlackfinSubtarget.h" 00022 #include "BlackfinISelLowering.h" 00023 00024 namespace llvm { 00025 00026 class BlackfinTargetMachine : public LLVMTargetMachine { 00027 const TargetData DataLayout; 00028 BlackfinSubtarget Subtarget; 00029 BlackfinTargetLowering TLInfo; 00030 BlackfinInstrInfo InstrInfo; 00031 TargetFrameInfo FrameInfo; 00032 public: 00033 BlackfinTargetMachine(const Target &T, const std::string &TT, 00034 const std::string &FS); 00035 00036 virtual const BlackfinInstrInfo *getInstrInfo() const { return &InstrInfo; } 00037 virtual const TargetFrameInfo *getFrameInfo() const { return &FrameInfo; } 00038 virtual const BlackfinSubtarget *getSubtargetImpl() const { 00039 return &Subtarget; 00040 } 00041 virtual const BlackfinRegisterInfo *getRegisterInfo() const { 00042 return &InstrInfo.getRegisterInfo(); 00043 } 00044 virtual BlackfinTargetLowering* getTargetLowering() const { 00045 return const_cast<BlackfinTargetLowering*>(&TLInfo); 00046 } 00047 virtual const TargetData *getTargetData() const { return &DataLayout; } 00048 virtual bool addInstSelector(PassManagerBase &PM, 00049 CodeGenOpt::Level OptLevel); 00050 }; 00051 00052 } // end namespace llvm 00053 00054 #endif