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/Support/TargetRegistry.h" 14using namespace llvm; 15 16extern "C" void LLVMInitializeSystemZTarget() { 17 // Register the target. 18 RegisterTargetMachine<SystemZTargetMachine> X(TheSystemZTarget); 19} 20 21/// SystemZTargetMachine ctor - Create an ILP64 architecture model 22/// 23SystemZTargetMachine::SystemZTargetMachine(const Target &T, 24 StringRef TT, StringRef CPU, 25 StringRef FS, Reloc::Model RM, 26 CodeModel::Model CM) 27 : LLVMTargetMachine(T, TT, CPU, FS, RM, CM), 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 35bool SystemZTargetMachine::addInstSelector(PassManagerBase &PM, 36 CodeGenOpt::Level OptLevel) { 37 // Install an instruction selector. 38 PM.add(createSystemZISelDag(*this, OptLevel)); 39 return false; 40} 41