Fixed some bugs.
[llvm/zpu.git] / lib / Target / SystemZ / SystemZTargetMachine.cpp
blobf45827b2b300d47fae5f8a10240ed6ce71f1e778
1 //===-- SystemZTargetMachine.cpp - Define TargetMachine for SystemZ -------===//
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 //===----------------------------------------------------------------------===//
10 #include "SystemZMCAsmInfo.h"
11 #include "SystemZTargetMachine.h"
12 #include "SystemZ.h"
13 #include "llvm/PassManager.h"
14 #include "llvm/Target/TargetRegistry.h"
15 using namespace llvm;
17 extern "C" void LLVMInitializeSystemZTarget() {
18 // Register the target.
19 RegisterTargetMachine<SystemZTargetMachine> X(TheSystemZTarget);
20 RegisterAsmInfo<SystemZMCAsmInfo> Y(TheSystemZTarget);
23 /// SystemZTargetMachine ctor - Create an ILP64 architecture model
24 ///
25 SystemZTargetMachine::SystemZTargetMachine(const Target &T,
26 const std::string &TT,
27 const std::string &FS)
28 : LLVMTargetMachine(T, TT),
29 Subtarget(TT, FS),
30 DataLayout("E-p:64:64:64-i8:8:16-i16:16:16-i32:32:32-i64:64:64-f32:32:32"
31 "-f64:64:64-f128:128:128-a0:16:16-n32:64"),
32 InstrInfo(*this), TLInfo(*this), TSInfo(*this),
33 FrameInfo(TargetFrameInfo::StackGrowsDown, 8, -160) {
35 if (getRelocationModel() == Reloc::Default)
36 setRelocationModel(Reloc::Static);
39 bool SystemZTargetMachine::addInstSelector(PassManagerBase &PM,
40 CodeGenOpt::Level OptLevel) {
41 // Install an instruction selector.
42 PM.add(createSystemZISelDag(*this, OptLevel));
43 return false;