1 //===-- SystemZMCTargetDesc.cpp - SystemZ Target Descriptions ---*- C++ -*-===// 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 // This file provides SystemZ specific target descriptions. 11 // 12 //===----------------------------------------------------------------------===// 13 14 #include "SystemZMCTargetDesc.h" 15 #include "SystemZMCAsmInfo.h" 16 #include "llvm/MC/MCInstrInfo.h" 17 #include "llvm/MC/MCRegisterInfo.h" 18 #include "llvm/MC/MCSubtargetInfo.h" 19 #include "llvm/Target/TargetRegistry.h" 20 21 #define GET_INSTRINFO_MC_DESC 22 #include "SystemZGenInstrInfo.inc" 23 24 #define GET_SUBTARGETINFO_MC_DESC 25 #include "SystemZGenSubtargetInfo.inc" 26 27 #define GET_REGINFO_MC_DESC 28 #include "SystemZGenRegisterInfo.inc" 29 30 using namespace llvm; 31 32 static MCInstrInfo *createSystemZMCInstrInfo() { 33 MCInstrInfo *X = new MCInstrInfo(); 34 InitSystemZMCInstrInfo(X); 35 return X; 36 } 37 38 extern "C" void LLVMInitializeSystemZMCInstrInfo() { 39 TargetRegistry::RegisterMCInstrInfo(TheSystemZTarget, 40 createSystemZMCInstrInfo); 41 } 42 43 static MCRegisterInfo *createSystemZMCRegisterInfo(StringRef TT) { 44 MCRegisterInfo *X = new MCRegisterInfo(); 45 InitSystemZMCRegisterInfo(X, 0); 46 return X; 47 } 48 49 extern "C" void LLVMInitializeSystemZMCRegisterInfo() { 50 TargetRegistry::RegisterMCRegInfo(TheSystemZTarget, 51 createSystemZMCRegisterInfo); 52 } 53 54 static MCSubtargetInfo *createSystemZMCSubtargetInfo(StringRef TT, 55 StringRef CPU, 56 StringRef FS) { 57 MCSubtargetInfo *X = new MCSubtargetInfo(); 58 InitSystemZMCSubtargetInfo(X, TT, CPU, FS); 59 return X; 60 } 61 62 extern "C" void LLVMInitializeSystemZMCSubtargetInfo() { 63 TargetRegistry::RegisterMCSubtargetInfo(TheSystemZTarget, 64 createSystemZMCSubtargetInfo); 65 } 66 67 extern "C" void LLVMInitializeSystemZMCAsmInfo() { 68 RegisterMCAsmInfo<SystemZMCAsmInfo> X(TheSystemZTarget); 69 } 70 71 MCCodeGenInfo *createSystemZMCCodeGenInfo(StringRef TT, Reloc::Model RM) { 72 MCCodeGenInfo *X = new MCCodeGenInfo(); 73 if (RM == Reloc::Default) 74 RM = Reloc::Static; 75 X->InitMCCodeGenInfo(RM); 76 return X; 77 } 78 79 extern "C" void LLVMInitializeSystemZMCCodeGenInfo() { 80 TargetRegistry::RegisterMCCodeGenInfo(TheSystemZTarget, 81 createSystemZMCCodeGenInfo); 82 } 83