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" |
Anton Korobeynikov | 3346491 | 2010-11-15 00:06:54 +0000 | [diff] [blame] | 19 | #include "PTXFrameInfo.h" |
Eric Christopher | 50880d0 | 2010-09-18 18:52:28 +0000 | [diff] [blame] | 20 | #include "PTXSubtarget.h" |
| 21 | #include "llvm/Target/TargetData.h" |
| 22 | #include "llvm/Target/TargetFrameInfo.h" |
Nick Lewycky | f7a3c50 | 2010-09-07 18:14:24 +0000 | [diff] [blame] | 23 | #include "llvm/Target/TargetMachine.h" |
| 24 | |
| 25 | namespace llvm { |
Eric Christopher | 50880d0 | 2010-09-18 18:52:28 +0000 | [diff] [blame] | 26 | class PTXTargetMachine : public LLVMTargetMachine { |
| 27 | private: |
| 28 | const TargetData DataLayout; |
Anton Korobeynikov | 3346491 | 2010-11-15 00:06:54 +0000 | [diff] [blame] | 29 | PTXFrameInfo FrameInfo; |
Eric Christopher | 50880d0 | 2010-09-18 18:52:28 +0000 | [diff] [blame] | 30 | PTXInstrInfo InstrInfo; |
| 31 | PTXTargetLowering TLInfo; |
| 32 | PTXSubtarget Subtarget; |
| 33 | |
| 34 | public: |
| 35 | PTXTargetMachine(const Target &T, const std::string &TT, |
| 36 | const std::string &FS); |
| 37 | |
| 38 | virtual const TargetData *getTargetData() const { return &DataLayout; } |
| 39 | |
| 40 | virtual const TargetFrameInfo *getFrameInfo() const { return &FrameInfo; } |
| 41 | |
| 42 | virtual const PTXInstrInfo *getInstrInfo() const { return &InstrInfo; } |
| 43 | virtual const TargetRegisterInfo *getRegisterInfo() const { |
| 44 | return &InstrInfo.getRegisterInfo(); } |
| 45 | |
| 46 | virtual const PTXTargetLowering *getTargetLowering() const { |
| 47 | return &TLInfo; } |
| 48 | |
| 49 | virtual const PTXSubtarget *getSubtargetImpl() const { return &Subtarget; } |
| 50 | |
| 51 | virtual bool addInstSelector(PassManagerBase &PM, |
| 52 | CodeGenOpt::Level OptLevel); |
Che-Liang Chiou | ad83c1d | 2011-01-01 10:50:37 +0000 | [diff] [blame] | 53 | virtual bool addPostRegAlloc(PassManagerBase &PM, |
| 54 | CodeGenOpt::Level OptLevel); |
Eric Christopher | 50880d0 | 2010-09-18 18:52:28 +0000 | [diff] [blame] | 55 | }; // class PTXTargetMachine |
Nick Lewycky | f7a3c50 | 2010-09-07 18:14:24 +0000 | [diff] [blame] | 56 | } // namespace llvm |
| 57 | |
| 58 | #endif // PTX_TARGET_MACHINE_H |