1 //===-- PTXTargetMachine.h - Define TargetMachine for PTX -------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file declares the PTX specific subclass of TargetMachine.
12 //===----------------------------------------------------------------------===//
14 #ifndef PTX_TARGET_MACHINE_H
15 #define PTX_TARGET_MACHINE_H
17 #include "PTXISelLowering.h"
18 #include "PTXInstrInfo.h"
19 #include "PTXSubtarget.h"
20 #include "llvm/Target/TargetData.h"
21 #include "llvm/Target/TargetFrameInfo.h"
22 #include "llvm/Target/TargetMachine.h"
25 class PTXTargetMachine
: public LLVMTargetMachine
{
27 const TargetData DataLayout
;
28 TargetFrameInfo FrameInfo
;
29 PTXInstrInfo InstrInfo
;
30 PTXTargetLowering TLInfo
;
31 PTXSubtarget Subtarget
;
34 PTXTargetMachine(const Target
&T
, const std::string
&TT
,
35 const std::string
&FS
);
37 virtual const TargetData
*getTargetData() const { return &DataLayout
; }
39 virtual const TargetFrameInfo
*getFrameInfo() const { return &FrameInfo
; }
41 virtual const PTXInstrInfo
*getInstrInfo() const { return &InstrInfo
; }
42 virtual const TargetRegisterInfo
*getRegisterInfo() const {
43 return &InstrInfo
.getRegisterInfo(); }
45 virtual const PTXTargetLowering
*getTargetLowering() const {
48 virtual const PTXSubtarget
*getSubtargetImpl() const { return &Subtarget
; }
50 virtual bool addInstSelector(PassManagerBase
&PM
,
51 CodeGenOpt::Level OptLevel
);
52 }; // class PTXTargetMachine
55 #endif // PTX_TARGET_MACHINE_H