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 "SparcFrameLowering.h" 00018 #include "SparcISelLowering.h" 00019 #include "SparcInstrInfo.h" 00020 #include "SparcSelectionDAGInfo.h" 00021 #include "SparcSubtarget.h" 00022 #include "llvm/IR/DataLayout.h" 00023 #include "llvm/Target/TargetFrameLowering.h" 00024 #include "llvm/Target/TargetMachine.h" 00025 00026 namespace llvm { 00027 00028 class SparcTargetMachine : public LLVMTargetMachine { 00029 SparcSubtarget Subtarget; 00030 const DataLayout DL; // Calculates type size & alignment 00031 SparcInstrInfo InstrInfo; 00032 SparcTargetLowering TLInfo; 00033 SparcSelectionDAGInfo TSInfo; 00034 SparcFrameLowering FrameLowering; 00035 public: 00036 SparcTargetMachine(const Target &T, StringRef TT, 00037 StringRef CPU, StringRef FS, const TargetOptions &Options, 00038 Reloc::Model RM, CodeModel::Model CM, 00039 CodeGenOpt::Level OL, bool is64bit); 00040 00041 virtual const SparcInstrInfo *getInstrInfo() const { return &InstrInfo; } 00042 virtual const TargetFrameLowering *getFrameLowering() const { 00043 return &FrameLowering; 00044 } 00045 virtual const SparcSubtarget *getSubtargetImpl() const{ return &Subtarget; } 00046 virtual const SparcRegisterInfo *getRegisterInfo() const { 00047 return &InstrInfo.getRegisterInfo(); 00048 } 00049 virtual const SparcTargetLowering* getTargetLowering() const { 00050 return &TLInfo; 00051 } 00052 virtual const SparcSelectionDAGInfo* getSelectionDAGInfo() const { 00053 return &TSInfo; 00054 } 00055 virtual const DataLayout *getDataLayout() const { return &DL; } 00056 00057 // Pass Pipeline Configuration 00058 virtual TargetPassConfig *createPassConfig(PassManagerBase &PM); 00059 }; 00060 00061 /// SparcV8TargetMachine - Sparc 32-bit target machine 00062 /// 00063 class SparcV8TargetMachine : public SparcTargetMachine { 00064 virtual void anchor(); 00065 public: 00066 SparcV8TargetMachine(const Target &T, StringRef TT, 00067 StringRef CPU, StringRef FS, 00068 const TargetOptions &Options, 00069 Reloc::Model RM, CodeModel::Model CM, 00070 CodeGenOpt::Level OL); 00071 }; 00072 00073 /// SparcV9TargetMachine - Sparc 64-bit target machine 00074 /// 00075 class SparcV9TargetMachine : public SparcTargetMachine { 00076 virtual void anchor(); 00077 public: 00078 SparcV9TargetMachine(const Target &T, StringRef TT, 00079 StringRef CPU, StringRef FS, 00080 const TargetOptions &Options, 00081 Reloc::Model RM, CodeModel::Model CM, 00082 CodeGenOpt::Level OL); 00083 }; 00084 00085 } // end namespace llvm 00086 00087 #endif