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 "PTXFrameInfo.h"
20 #include "PTXSubtarget.h"
21 #include "llvm/Target/TargetData.h"
22 #include "llvm/Target/TargetFrameInfo.h"
23 #include "llvm/Target/TargetMachine.h"
26 class PTXTargetMachine : public LLVMTargetMachine {
28 const TargetData DataLayout;
29 PTXFrameInfo FrameInfo;
30 PTXInstrInfo InstrInfo;
31 PTXTargetLowering TLInfo;
32 PTXSubtarget Subtarget;
35 PTXTargetMachine(const Target &T, const std::string &TT,
36 const std::string &FS);
38 virtual const TargetData *getTargetData() const { return &DataLayout; }
40 virtual const TargetFrameInfo *getFrameInfo() const { return &FrameInfo; }
42 virtual const PTXInstrInfo *getInstrInfo() const { return &InstrInfo; }
43 virtual const TargetRegisterInfo *getRegisterInfo() const {
44 return &InstrInfo.getRegisterInfo(); }
46 virtual const PTXTargetLowering *getTargetLowering() const {
49 virtual const PTXSubtarget *getSubtargetImpl() const { return &Subtarget; }
51 virtual bool addInstSelector(PassManagerBase &PM,
52 CodeGenOpt::Level OptLevel);
53 }; // class PTXTargetMachine
56 #endif // PTX_TARGET_MACHINE_H