PTX: Add intrinsics to list of built-in intrinsics, which allows them to be
[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 "PTXFrameLowering.h"
20 #include "PTXSubtarget.h"
21 #include "llvm/Target/TargetData.h"
22 #include "llvm/Target/TargetFrameLowering.h"
23 #include "llvm/Target/TargetMachine.h"
24
25 namespace llvm {
26 class PTXTargetMachine : public LLVMTargetMachine {
27   private:
28     const TargetData  DataLayout;
29     PTXSubtarget      Subtarget; // has to be initialized before FrameLowering
30     PTXFrameLowering  FrameLowering;
31     PTXInstrInfo      InstrInfo;
32     PTXTargetLowering TLInfo;
33
34   public:
35     PTXTargetMachine(const Target &T, const std::string &TT,
36                      const std::string &FS, bool is64Bit);
37
38     virtual const TargetData *getTargetData() const { return &DataLayout; }
39
40     virtual const TargetFrameLowering *getFrameLowering() const {
41       return &FrameLowering;
42     }
43
44     virtual const PTXInstrInfo *getInstrInfo() const { return &InstrInfo; }
45     virtual const TargetRegisterInfo *getRegisterInfo() const {
46       return &InstrInfo.getRegisterInfo(); }
47
48     virtual const PTXTargetLowering *getTargetLowering() const {
49       return &TLInfo; }
50
51     virtual const PTXSubtarget *getSubtargetImpl() const { return &Subtarget; }
52
53     virtual bool addInstSelector(PassManagerBase &PM,
54                                  CodeGenOpt::Level OptLevel);
55     virtual bool addPostRegAlloc(PassManagerBase &PM,
56                                  CodeGenOpt::Level OptLevel);
57 }; // class PTXTargetMachine
58
59
60 class PTX32TargetMachine : public PTXTargetMachine {
61 public:
62
63   PTX32TargetMachine(const Target &T, const std::string &TT,
64                      const std::string& FS);
65 }; // class PTX32TargetMachine
66
67 class PTX64TargetMachine : public PTXTargetMachine {
68 public:
69
70   PTX64TargetMachine(const Target &T, const std::string &TT,
71                      const std::string& FS);
72 }; // class PTX32TargetMachine
73
74 } // namespace llvm
75
76 #endif // PTX_TARGET_MACHINE_H