Fixed some bugs.
[llvm/zpu.git] / lib / Target / PTX / PTXTargetMachine.cpp
blob1e846e5059586562bf698c0f1121ce16c75ec489
1 //===-- PTXTargetMachine.cpp - Define TargetMachine for PTX ---------------===//
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 // Top-level implementation for the PTX target.
12 //===----------------------------------------------------------------------===//
14 #include "PTX.h"
15 #include "PTXMCAsmInfo.h"
16 #include "PTXTargetMachine.h"
17 #include "llvm/PassManager.h"
18 #include "llvm/Target/TargetRegistry.h"
20 using namespace llvm;
22 extern "C" void LLVMInitializePTXTarget() {
23 RegisterTargetMachine<PTXTargetMachine> X(ThePTXTarget);
24 RegisterAsmInfo<PTXMCAsmInfo> Y(ThePTXTarget);
27 // DataLayout and FrameInfo are filled with dummy data
28 PTXTargetMachine::PTXTargetMachine(const Target &T,
29 const std::string &TT,
30 const std::string &FS)
31 : LLVMTargetMachine(T, TT),
32 DataLayout("e-p:32:32-i64:32:32-f64:32:32-v128:32:128-v64:32:64-n32:64"),
33 FrameInfo(TargetFrameInfo::StackGrowsDown, 2, -2),
34 InstrInfo(*this),
35 TLInfo(*this),
36 Subtarget(TT, FS) {
39 bool PTXTargetMachine::addInstSelector(PassManagerBase &PM,
40 CodeGenOpt::Level OptLevel) {
41 PM.add(createPTXISelDag(*this, OptLevel));
42 return false;