2010-09-07 18:14:24 +00:00
|
|
|
//===-- PTXTargetMachine.h - Define TargetMachine for PTX -------*- C++ -*-===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This file declares the PTX specific subclass of TargetMachine.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef PTX_TARGET_MACHINE_H
|
|
|
|
#define PTX_TARGET_MACHINE_H
|
|
|
|
|
2010-09-18 18:52:28 +00:00
|
|
|
#include "PTXISelLowering.h"
|
|
|
|
#include "PTXInstrInfo.h"
|
2010-11-15 00:06:54 +00:00
|
|
|
#include "PTXFrameInfo.h"
|
2010-09-18 18:52:28 +00:00
|
|
|
#include "PTXSubtarget.h"
|
|
|
|
#include "llvm/Target/TargetData.h"
|
|
|
|
#include "llvm/Target/TargetFrameInfo.h"
|
2010-09-07 18:14:24 +00:00
|
|
|
#include "llvm/Target/TargetMachine.h"
|
|
|
|
|
|
|
|
namespace llvm {
|
2010-09-18 18:52:28 +00:00
|
|
|
class PTXTargetMachine : public LLVMTargetMachine {
|
|
|
|
private:
|
|
|
|
const TargetData DataLayout;
|
2010-11-15 00:06:54 +00:00
|
|
|
PTXFrameInfo FrameInfo;
|
2010-09-18 18:52:28 +00:00
|
|
|
PTXInstrInfo InstrInfo;
|
|
|
|
PTXTargetLowering TLInfo;
|
|
|
|
PTXSubtarget Subtarget;
|
|
|
|
|
|
|
|
public:
|
|
|
|
PTXTargetMachine(const Target &T, const std::string &TT,
|
|
|
|
const std::string &FS);
|
|
|
|
|
|
|
|
virtual const TargetData *getTargetData() const { return &DataLayout; }
|
|
|
|
|
|
|
|
virtual const TargetFrameInfo *getFrameInfo() const { return &FrameInfo; }
|
|
|
|
|
|
|
|
virtual const PTXInstrInfo *getInstrInfo() const { return &InstrInfo; }
|
|
|
|
virtual const TargetRegisterInfo *getRegisterInfo() const {
|
|
|
|
return &InstrInfo.getRegisterInfo(); }
|
|
|
|
|
|
|
|
virtual const PTXTargetLowering *getTargetLowering() const {
|
|
|
|
return &TLInfo; }
|
|
|
|
|
|
|
|
virtual const PTXSubtarget *getSubtargetImpl() const { return &Subtarget; }
|
|
|
|
|
|
|
|
virtual bool addInstSelector(PassManagerBase &PM,
|
|
|
|
CodeGenOpt::Level OptLevel);
|
|
|
|
}; // class PTXTargetMachine
|
2010-09-07 18:14:24 +00:00
|
|
|
} // namespace llvm
|
|
|
|
|
|
|
|
#endif // PTX_TARGET_MACHINE_H
|