]> CyberLeo.Net >> Repos - FreeBSD/stable/9.git/blob - contrib/llvm/lib/Target/SystemZ/SystemZTargetMachine.cpp
Copy head to stable/9 as part of 9.0-RELEASE release cycle.
[FreeBSD/stable/9.git] / contrib / llvm / 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 "SystemZTargetMachine.h"
11 #include "SystemZ.h"
12 #include "llvm/PassManager.h"
13 #include "llvm/Target/TargetRegistry.h"
14 using namespace llvm;
15
16 extern "C" void LLVMInitializeSystemZTarget() {
17   // Register the target.
18   RegisterTargetMachine<SystemZTargetMachine> X(TheSystemZTarget);
19 }
20
21 /// SystemZTargetMachine ctor - Create an ILP64 architecture model
22 ///
23 SystemZTargetMachine::SystemZTargetMachine(const Target &T,
24                                            const std::string &TT,
25                                            const std::string &CPU,
26                                            const std::string &FS)
27   : LLVMTargetMachine(T, TT, CPU, FS),
28     Subtarget(TT, CPU, FS),
29     DataLayout("E-p:64:64:64-i8:8:16-i16:16:16-i32:32:32-i64:64:64-f32:32:32"
30                "-f64:64:64-f128:128:128-a0:16:16-n32:64"),
31     InstrInfo(*this), TLInfo(*this), TSInfo(*this),
32     FrameLowering(Subtarget) {
33
34   if (getRelocationModel() == Reloc::Default)
35     setRelocationModel(Reloc::Static);
36 }
37
38 bool SystemZTargetMachine::addInstSelector(PassManagerBase &PM,
39                                           CodeGenOpt::Level OptLevel) {
40   // Install an instruction selector.
41   PM.add(createSystemZISelDag(*this, OptLevel));
42   return false;
43 }