blob: 7f0d28288a3e9c4dc095b35a8a397781941984d0 [file] [log] [blame]
Nick Lewyckyf7a3c502010-09-07 18:14:24 +00001//===-- 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
Eric Christopher50880d02010-09-18 18:52:28 +000017#include "PTXISelLowering.h"
18#include "PTXInstrInfo.h"
Anton Korobeynikov33464912010-11-15 00:06:54 +000019#include "PTXFrameInfo.h"
Eric Christopher50880d02010-09-18 18:52:28 +000020#include "PTXSubtarget.h"
21#include "llvm/Target/TargetData.h"
22#include "llvm/Target/TargetFrameInfo.h"
Nick Lewyckyf7a3c502010-09-07 18:14:24 +000023#include "llvm/Target/TargetMachine.h"
24
25namespace llvm {
Eric Christopher50880d02010-09-18 18:52:28 +000026class PTXTargetMachine : public LLVMTargetMachine {
27 private:
28 const TargetData DataLayout;
Anton Korobeynikov33464912010-11-15 00:06:54 +000029 PTXFrameInfo FrameInfo;
Eric Christopher50880d02010-09-18 18:52:28 +000030 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);
Che-Liang Chiouad83c1d2011-01-01 10:50:37 +000053 virtual bool addPostRegAlloc(PassManagerBase &PM,
54 CodeGenOpt::Level OptLevel);
Eric Christopher50880d02010-09-18 18:52:28 +000055}; // class PTXTargetMachine
Nick Lewyckyf7a3c502010-09-07 18:14:24 +000056} // namespace llvm
57
58#endif // PTX_TARGET_MACHINE_H