1 //===-- MBlazeTargetMachine.h - Define TargetMachine for MBlaze -*- 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 MBlaze specific subclass of TargetMachine. 11 // 12 //===----------------------------------------------------------------------===// 13 14 #ifndef MBLAZE_TARGETMACHINE_H 15 #define MBLAZE_TARGETMACHINE_H 16 17 #include "MBlazeFrameLowering.h" 18 #include "MBlazeISelLowering.h" 19 #include "MBlazeInstrInfo.h" 20 #include "MBlazeIntrinsicInfo.h" 21 #include "MBlazeSelectionDAGInfo.h" 22 #include "MBlazeSubtarget.h" 23 #include "llvm/IR/DataLayout.h" 24 #include "llvm/MC/MCStreamer.h" 25 #include "llvm/Target/TargetFrameLowering.h" 26 #include "llvm/Target/TargetMachine.h" 27 28 namespace llvm { 29 class formatted_raw_ostream; 30 31 class MBlazeTargetMachine : public LLVMTargetMachine { 32 MBlazeSubtarget Subtarget; 33 const DataLayout DL; // Calculates type size & alignment 34 MBlazeInstrInfo InstrInfo; 35 MBlazeFrameLowering FrameLowering; 36 MBlazeTargetLowering TLInfo; 37 MBlazeSelectionDAGInfo TSInfo; 38 MBlazeIntrinsicInfo IntrinsicInfo; 39 InstrItineraryData InstrItins; 40 41 public: 42 MBlazeTargetMachine(const Target &T, StringRef TT, 43 StringRef CPU, StringRef FS, 44 const TargetOptions &Options, 45 Reloc::Model RM, CodeModel::Model CM, 46 CodeGenOpt::Level OL); 47 getInstrInfo()48 virtual const MBlazeInstrInfo *getInstrInfo() const 49 { return &InstrInfo; } 50 getInstrItineraryData()51 virtual const InstrItineraryData *getInstrItineraryData() const 52 { return &InstrItins; } 53 getFrameLowering()54 virtual const TargetFrameLowering *getFrameLowering() const 55 { return &FrameLowering; } 56 getSubtargetImpl()57 virtual const MBlazeSubtarget *getSubtargetImpl() const 58 { return &Subtarget; } 59 getDataLayout()60 virtual const DataLayout *getDataLayout() const 61 { return &DL;} 62 getRegisterInfo()63 virtual const MBlazeRegisterInfo *getRegisterInfo() const 64 { return &InstrInfo.getRegisterInfo(); } 65 getTargetLowering()66 virtual const MBlazeTargetLowering *getTargetLowering() const 67 { return &TLInfo; } 68 getSelectionDAGInfo()69 virtual const MBlazeSelectionDAGInfo* getSelectionDAGInfo() const 70 { return &TSInfo; } 71 getIntrinsicInfo()72 const TargetIntrinsicInfo *getIntrinsicInfo() const 73 { return &IntrinsicInfo; } 74 75 // Pass Pipeline Configuration 76 virtual TargetPassConfig *createPassConfig(PassManagerBase &PM); 77 }; 78 } // End llvm namespace 79 80 #endif 81