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