Fixed some bugs.
[llvm/zpu.git] / lib / Target / PTX / PTXTargetMachine.h
blobb1379b4cdb0aa3a7859acb28e54855cbff0cf429
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.
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"
24 namespace llvm {
25 class PTXTargetMachine : public LLVMTargetMachine {
26 private:
27 const TargetData DataLayout;
28 TargetFrameInfo FrameInfo;
29 PTXInstrInfo InstrInfo;
30 PTXTargetLowering TLInfo;
31 PTXSubtarget Subtarget;
33 public:
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 {
46 return &TLInfo; }
48 virtual const PTXSubtarget *getSubtargetImpl() const { return &Subtarget; }
50 virtual bool addInstSelector(PassManagerBase &PM,
51 CodeGenOpt::Level OptLevel);
52 }; // class PTXTargetMachine
53 } // namespace llvm
55 #endif // PTX_TARGET_MACHINE_H