1 //===-- XCoreTargetMachine.h - Define TargetMachine for XCore ---*- 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 XCore specific subclass of TargetMachine. 11 // 12 //===----------------------------------------------------------------------===// 13 14 #ifndef XCORETARGETMACHINE_H 15 #define XCORETARGETMACHINE_H 16 17 #include "XCoreFrameLowering.h" 18 #include "XCoreSubtarget.h" 19 #include "XCoreInstrInfo.h" 20 #include "XCoreISelLowering.h" 21 #include "XCoreSelectionDAGInfo.h" 22 #include "llvm/Target/TargetMachine.h" 23 #include "llvm/Target/TargetData.h" 24 25 namespace llvm { 26 27 class XCoreTargetMachine : public LLVMTargetMachine { 28 XCoreSubtarget Subtarget; 29 const TargetData DataLayout; // Calculates type size & alignment 30 XCoreInstrInfo InstrInfo; 31 XCoreFrameLowering FrameLowering; 32 XCoreTargetLowering TLInfo; 33 XCoreSelectionDAGInfo TSInfo; 34 public: 35 XCoreTargetMachine(const Target &T, StringRef TT, 36 StringRef CPU, StringRef FS, const TargetOptions &Options, 37 Reloc::Model RM, CodeModel::Model CM, 38 CodeGenOpt::Level OL); 39 getInstrInfo()40 virtual const XCoreInstrInfo *getInstrInfo() const { return &InstrInfo; } getFrameLowering()41 virtual const XCoreFrameLowering *getFrameLowering() const { 42 return &FrameLowering; 43 } getSubtargetImpl()44 virtual const XCoreSubtarget *getSubtargetImpl() const { return &Subtarget; } getTargetLowering()45 virtual const XCoreTargetLowering *getTargetLowering() const { 46 return &TLInfo; 47 } 48 getSelectionDAGInfo()49 virtual const XCoreSelectionDAGInfo* getSelectionDAGInfo() const { 50 return &TSInfo; 51 } 52 getRegisterInfo()53 virtual const TargetRegisterInfo *getRegisterInfo() const { 54 return &InstrInfo.getRegisterInfo(); 55 } getTargetData()56 virtual const TargetData *getTargetData() const { return &DataLayout; } 57 58 // Pass Pipeline Configuration 59 virtual TargetPassConfig *createPassConfig(PassManagerBase &PM); 60 }; 61 62 } // end namespace llvm 63 64 #endif 65