Nick Lewycky | f7a3c50 | 2010-09-07 18:14:24 +0000 | [diff] [blame] | 1 | //===-- PTXTargetMachine.h - Define TargetMachine for PTX -------*- 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 PTX specific subclass of TargetMachine. |
| 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
| 14 | #ifndef PTX_TARGET_MACHINE_H |
| 15 | #define PTX_TARGET_MACHINE_H |
| 16 | |
Eric Christopher | 50880d0 | 2010-09-18 18:52:28 +0000 | [diff] [blame^] | 17 | #include "PTXISelLowering.h" |
| 18 | #include "PTXInstrInfo.h" |
| 19 | #include "PTXSubtarget.h" |
| 20 | #include "llvm/Target/TargetData.h" |
| 21 | #include "llvm/Target/TargetFrameInfo.h" |
Nick Lewycky | f7a3c50 | 2010-09-07 18:14:24 +0000 | [diff] [blame] | 22 | #include "llvm/Target/TargetMachine.h" |
| 23 | |
| 24 | namespace llvm { |
Eric Christopher | 50880d0 | 2010-09-18 18:52:28 +0000 | [diff] [blame^] | 25 | class PTXTargetMachine : public LLVMTargetMachine { |
| 26 | private: |
| 27 | const TargetData DataLayout; |
| 28 | TargetFrameInfo FrameInfo; |
| 29 | PTXInstrInfo InstrInfo; |
| 30 | PTXTargetLowering TLInfo; |
| 31 | PTXSubtarget Subtarget; |
| 32 | |
| 33 | public: |
| 34 | PTXTargetMachine(const Target &T, const std::string &TT, |
| 35 | const std::string &FS); |
| 36 | |
| 37 | virtual const TargetData *getTargetData() const { return &DataLayout; } |
| 38 | |
| 39 | virtual const TargetFrameInfo *getFrameInfo() const { return &FrameInfo; } |
| 40 | |
| 41 | virtual const PTXInstrInfo *getInstrInfo() const { return &InstrInfo; } |
| 42 | virtual const TargetRegisterInfo *getRegisterInfo() const { |
| 43 | return &InstrInfo.getRegisterInfo(); } |
| 44 | |
| 45 | virtual const PTXTargetLowering *getTargetLowering() const { |
| 46 | return &TLInfo; } |
| 47 | |
| 48 | virtual const PTXSubtarget *getSubtargetImpl() const { return &Subtarget; } |
| 49 | |
| 50 | virtual bool addInstSelector(PassManagerBase &PM, |
| 51 | CodeGenOpt::Level OptLevel); |
| 52 | }; // class PTXTargetMachine |
Nick Lewycky | f7a3c50 | 2010-09-07 18:14:24 +0000 | [diff] [blame] | 53 | } // namespace llvm |
| 54 | |
| 55 | #endif // PTX_TARGET_MACHINE_H |