Flag -> Glue, the ongoing saga
[oota-llvm.git] / lib / Target / PTX / PTXTargetMachine.h
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
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"
24
25 namespace llvm {
26 class PTXTargetMachine : public LLVMTargetMachine {
27   private:
28     const TargetData DataLayout;
29     PTXFrameInfo FrameInfo;
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);
53 }; // class PTXTargetMachine
54 } // namespace llvm
55
56 #endif // PTX_TARGET_MACHINE_H