1 //===-- SparcTargetMachine.h - Define TargetMachine for Sparc ---*- C++ -*-===// 2 // 3 // The LLVM Compiler Infrastructure 4 // 5 // This file is distributed under the University of Illinois Open Source 6 // License. See LICENSE.TXT for details. 7 // 8 //===----------------------------------------------------------------------===// 9 // 10 // This file declares the Sparc specific subclass of TargetMachine. 11 // 12 //===----------------------------------------------------------------------===// 13 14 #ifndef LLVM_LIB_TARGET_SPARC_SPARCTARGETMACHINE_H 15 #define LLVM_LIB_TARGET_SPARC_SPARCTARGETMACHINE_H 16 17 #include "SparcInstrInfo.h" 18 #include "SparcSubtarget.h" 19 #include "llvm/Target/TargetMachine.h" 20 21 namespace llvm { 22 23 class SparcTargetMachine : public LLVMTargetMachine { 24 std::unique_ptr<TargetLoweringObjectFile> TLOF; 25 SparcSubtarget Subtarget; 26 public: 27 SparcTargetMachine(const Target &T, StringRef TT, 28 StringRef CPU, StringRef FS, const TargetOptions &Options, 29 Reloc::Model RM, CodeModel::Model CM, 30 CodeGenOpt::Level OL, bool is64bit); 31 ~SparcTargetMachine() override; 32 getSubtargetImpl()33 const SparcSubtarget *getSubtargetImpl() const override { return &Subtarget; } 34 35 // Pass Pipeline Configuration 36 TargetPassConfig *createPassConfig(PassManagerBase &PM) override; getObjFileLowering()37 TargetLoweringObjectFile *getObjFileLowering() const override { 38 return TLOF.get(); 39 } 40 }; 41 42 /// SparcV8TargetMachine - Sparc 32-bit target machine 43 /// 44 class SparcV8TargetMachine : public SparcTargetMachine { 45 virtual void anchor(); 46 public: 47 SparcV8TargetMachine(const Target &T, StringRef TT, 48 StringRef CPU, StringRef FS, 49 const TargetOptions &Options, 50 Reloc::Model RM, CodeModel::Model CM, 51 CodeGenOpt::Level OL); 52 }; 53 54 /// SparcV9TargetMachine - Sparc 64-bit target machine 55 /// 56 class SparcV9TargetMachine : public SparcTargetMachine { 57 virtual void anchor(); 58 public: 59 SparcV9TargetMachine(const Target &T, StringRef TT, 60 StringRef CPU, StringRef FS, 61 const TargetOptions &Options, 62 Reloc::Model RM, CodeModel::Model CM, 63 CodeGenOpt::Level OL); 64 }; 65 66 } // end namespace llvm 67 68 #endif 69