LLVM API Documentation

SystemZTargetMachine.cpp

Go to the documentation of this file.
00001 //===-- SystemZTargetMachine.cpp - Define TargetMachine for SystemZ -------===//
00002 //
00003 //                     The LLVM Compiler Infrastructure
00004 //
00005 // This file is distributed under the University of Illinois Open Source
00006 // License. See LICENSE.TXT for details.
00007 //
00008 //===----------------------------------------------------------------------===//
00009 
00010 #include "SystemZTargetAsmInfo.h"
00011 #include "SystemZTargetMachine.h"
00012 #include "SystemZ.h"
00013 #include "llvm/PassManager.h"
00014 #include "llvm/Target/TargetRegistry.h"
00015 using namespace llvm;
00016 
00017 extern "C" void LLVMInitializeSystemZTarget() {
00018   // Register the target.
00019   RegisterTargetMachine<SystemZTargetMachine> X(TheSystemZTarget);
00020   RegisterAsmInfo<SystemZTargetAsmInfo> Y(TheSystemZTarget);
00021 }
00022 
00023 /// SystemZTargetMachine ctor - Create an ILP64 architecture model
00024 ///
00025 SystemZTargetMachine::SystemZTargetMachine(const Target &T,
00026                                            const std::string &TT,
00027                                            const std::string &FS)
00028   : LLVMTargetMachine(T, TT),
00029     Subtarget(TT, FS),
00030     DataLayout("E-p:64:64:64-i8:8:16-i16:16:16-i32:32:32-i64:64:64-f32:32:32"
00031                "-f64:64:64-f128:128:128-a0:16:16"),
00032     InstrInfo(*this), TLInfo(*this),
00033     FrameInfo(TargetFrameInfo::StackGrowsDown, 8, -160) {
00034 
00035   if (getRelocationModel() == Reloc::Default)
00036     setRelocationModel(Reloc::Static);
00037 }
00038 
00039 bool SystemZTargetMachine::addInstSelector(PassManagerBase &PM,
00040                                           CodeGenOpt::Level OptLevel) {
00041   // Install an instruction selector.
00042   PM.add(createSystemZISelDag(*this, OptLevel));
00043   return false;
00044 }