LLVM API Documentation
00001 //==- SystemZTargetMachine.h - Define TargetMachine for SystemZ ---*- 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 SystemZ specific subclass of TargetMachine. 00011 // 00012 //===----------------------------------------------------------------------===// 00013 00014 00015 #ifndef LLVM_TARGET_SYSTEMZ_TARGETMACHINE_H 00016 #define LLVM_TARGET_SYSTEMZ_TARGETMACHINE_H 00017 00018 #include "SystemZInstrInfo.h" 00019 #include "SystemZISelLowering.h" 00020 #include "SystemZRegisterInfo.h" 00021 #include "SystemZSubtarget.h" 00022 #include "llvm/Target/TargetData.h" 00023 #include "llvm/Target/TargetFrameInfo.h" 00024 #include "llvm/Target/TargetMachine.h" 00025 00026 namespace llvm { 00027 00028 /// SystemZTargetMachine 00029 /// 00030 class SystemZTargetMachine : public LLVMTargetMachine { 00031 SystemZSubtarget Subtarget; 00032 const TargetData DataLayout; // Calculates type size & alignment 00033 SystemZInstrInfo InstrInfo; 00034 SystemZTargetLowering TLInfo; 00035 00036 // SystemZ does not have any call stack frame, therefore not having 00037 // any SystemZ specific FrameInfo class. 00038 TargetFrameInfo FrameInfo; 00039 public: 00040 SystemZTargetMachine(const Target &T, const std::string &TT, 00041 const std::string &FS); 00042 00043 virtual const TargetFrameInfo *getFrameInfo() const { return &FrameInfo; } 00044 virtual const SystemZInstrInfo *getInstrInfo() const { return &InstrInfo; } 00045 virtual const TargetData *getTargetData() const { return &DataLayout;} 00046 virtual const SystemZSubtarget *getSubtargetImpl() const { return &Subtarget; } 00047 00048 virtual const SystemZRegisterInfo *getRegisterInfo() const { 00049 return &InstrInfo.getRegisterInfo(); 00050 } 00051 00052 virtual SystemZTargetLowering *getTargetLowering() const { 00053 return const_cast<SystemZTargetLowering*>(&TLInfo); 00054 } 00055 00056 virtual bool addInstSelector(PassManagerBase &PM, CodeGenOpt::Level OptLevel); 00057 }; // SystemZTargetMachine. 00058 00059 } // end namespace llvm 00060 00061 #endif // LLVM_TARGET_SystemZ_TARGETMACHINE_H