1 //===-- SystemZMCTargetDesc.cpp - SystemZ Target Descriptions ---*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file provides SystemZ specific target descriptions.
12 //===----------------------------------------------------------------------===//
14 #include "SystemZMCTargetDesc.h"
15 #include "SystemZMCAsmInfo.h"
16 #include "llvm/MC/MCCodeGenInfo.h"
17 #include "llvm/MC/MCInstrInfo.h"
18 #include "llvm/MC/MCRegisterInfo.h"
19 #include "llvm/MC/MCSubtargetInfo.h"
20 #include "llvm/Support/TargetRegistry.h"
22 #define GET_INSTRINFO_MC_DESC
23 #include "SystemZGenInstrInfo.inc"
25 #define GET_SUBTARGETINFO_MC_DESC
26 #include "SystemZGenSubtargetInfo.inc"
28 #define GET_REGINFO_MC_DESC
29 #include "SystemZGenRegisterInfo.inc"
33 static MCInstrInfo *createSystemZMCInstrInfo() {
34 MCInstrInfo *X = new MCInstrInfo();
35 InitSystemZMCInstrInfo(X);
39 static MCRegisterInfo *createSystemZMCRegisterInfo(StringRef TT) {
40 MCRegisterInfo *X = new MCRegisterInfo();
41 InitSystemZMCRegisterInfo(X, 0);
45 static MCSubtargetInfo *createSystemZMCSubtargetInfo(StringRef TT,
48 MCSubtargetInfo *X = new MCSubtargetInfo();
49 InitSystemZMCSubtargetInfo(X, TT, CPU, FS);
53 static MCCodeGenInfo *createSystemZMCCodeGenInfo(StringRef TT, Reloc::Model RM,
54 CodeModel::Model CM) {
55 MCCodeGenInfo *X = new MCCodeGenInfo();
56 if (RM == Reloc::Default)
58 X->InitMCCodeGenInfo(RM, CM);
62 extern "C" void LLVMInitializeSystemZTargetMC() {
63 // Register the MC asm info.
64 RegisterMCAsmInfo<SystemZMCAsmInfo> X(TheSystemZTarget);
66 // Register the MC codegen info.
67 TargetRegistry::RegisterMCCodeGenInfo(TheSystemZTarget,
68 createSystemZMCCodeGenInfo);
70 // Register the MC instruction info.
71 TargetRegistry::RegisterMCInstrInfo(TheSystemZTarget,
72 createSystemZMCInstrInfo);
74 // Register the MC register info.
75 TargetRegistry::RegisterMCRegInfo(TheSystemZTarget,
76 createSystemZMCRegisterInfo);
78 // Register the MC subtarget info.
79 TargetRegistry::RegisterMCSubtargetInfo(TheSystemZTarget,
80 createSystemZMCSubtargetInfo);