]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - lib/Target/SystemZ/SystemZTargetMachine.cpp
Update llvm to r84119.
[FreeBSD/FreeBSD.git] / lib / Target / SystemZ / SystemZTargetMachine.cpp
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 //===----------------------------------------------------------------------===//
9
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;
16
17 extern "C" void LLVMInitializeSystemZTarget() {
18   // Register the target.
19   RegisterTargetMachine<SystemZTargetMachine> X(TheSystemZTarget);
20   RegisterAsmInfo<SystemZMCAsmInfo> Y(TheSystemZTarget);
21 }
22
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"),
32     InstrInfo(*this), TLInfo(*this),
33     FrameInfo(TargetFrameInfo::StackGrowsDown, 8, -160) {
34
35   if (getRelocationModel() == Reloc::Default)
36     setRelocationModel(Reloc::Static);
37 }
38
39 bool SystemZTargetMachine::addInstSelector(PassManagerBase &PM,
40                                           CodeGenOpt::Level OptLevel) {
41   // Install an instruction selector.
42   PM.add(createSystemZISelDag(*this, OptLevel));
43   return false;
44 }