blob: b1379b4cdb0aa3a7859acb28e54855cbff0cf429 [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"
19#include "PTXSubtarget.h"
20#include "llvm/Target/TargetData.h"
21#include "llvm/Target/TargetFrameInfo.h"
Nick Lewyckyf7a3c502010-09-07 18:14:24 +000022#include "llvm/Target/TargetMachine.h"
23
24namespace llvm {
Eric Christopher50880d02010-09-18 18:52:28 +000025class PTXTargetMachine : public LLVMTargetMachine {
26 private:
27 const TargetData DataLayout;
28 TargetFrameInfo FrameInfo;
29 PTXInstrInfo InstrInfo;
30 PTXTargetLowering TLInfo;
31 PTXSubtarget Subtarget;
32
33 public:
34 PTXTargetMachine(const Target &T, const std::string &TT,
35 const std::string &FS);
36
37 virtual const TargetData *getTargetData() const { return &DataLayout; }
38
39 virtual const TargetFrameInfo *getFrameInfo() const { return &FrameInfo; }
40
41 virtual const PTXInstrInfo *getInstrInfo() const { return &InstrInfo; }
42 virtual const TargetRegisterInfo *getRegisterInfo() const {
43 return &InstrInfo.getRegisterInfo(); }
44
45 virtual const PTXTargetLowering *getTargetLowering() const {
46 return &TLInfo; }
47
48 virtual const PTXSubtarget *getSubtargetImpl() const { return &Subtarget; }
49
50 virtual bool addInstSelector(PassManagerBase &PM,
51 CodeGenOpt::Level OptLevel);
52}; // class PTXTargetMachine
Nick Lewyckyf7a3c502010-09-07 18:14:24 +000053} // namespace llvm
54
55#endif // PTX_TARGET_MACHINE_H