1 //===-- SparcMCTargetDesc.cpp - Sparc 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 Sparc specific target descriptions.
11 //
12 //===----------------------------------------------------------------------===//
13
14 #include "SparcMCTargetDesc.h"
15 #include "SparcMCAsmInfo.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 "SparcGenInstrInfo.inc"
23
24 #define GET_SUBTARGETINFO_MC_DESC
25 #include "SparcGenSubtargetInfo.inc"
26
27 #define GET_REGINFO_MC_DESC
28 #include "SparcGenRegisterInfo.inc"
29
30 using namespace llvm;
31
createSparcMCInstrInfo()32 static MCInstrInfo *createSparcMCInstrInfo() {
33 MCInstrInfo *X = new MCInstrInfo();
34 InitSparcMCInstrInfo(X);
35 return X;
36 }
37
LLVMInitializeSparcMCInstrInfo()38 extern "C" void LLVMInitializeSparcMCInstrInfo() {
39 TargetRegistry::RegisterMCInstrInfo(TheSparcTarget, createSparcMCInstrInfo);
40 }
41
createSparcMCRegisterInfo(StringRef TT)42 static MCRegisterInfo *createSparcMCRegisterInfo(StringRef TT) {
43 MCRegisterInfo *X = new MCRegisterInfo();
44 InitSparcMCRegisterInfo(X, SP::I7);
45 return X;
46 }
47
LLVMInitializeSparcMCRegisterInfo()48 extern "C" void LLVMInitializeSparcMCRegisterInfo() {
49 TargetRegistry::RegisterMCRegInfo(TheSparcTarget, createSparcMCRegisterInfo);
50 }
51
createSparcMCSubtargetInfo(StringRef TT,StringRef CPU,StringRef FS)52 static MCSubtargetInfo *createSparcMCSubtargetInfo(StringRef TT, StringRef CPU,
53 StringRef FS) {
54 MCSubtargetInfo *X = new MCSubtargetInfo();
55 InitSparcMCSubtargetInfo(X, TT, CPU, FS);
56 return X;
57 }
58
LLVMInitializeSparcMCSubtargetInfo()59 extern "C" void LLVMInitializeSparcMCSubtargetInfo() {
60 TargetRegistry::RegisterMCSubtargetInfo(TheSparcTarget,
61 createSparcMCSubtargetInfo);
62 }
63
LLVMInitializeSparcMCAsmInfo()64 extern "C" void LLVMInitializeSparcMCAsmInfo() {
65 RegisterMCAsmInfo<SparcELFMCAsmInfo> X(TheSparcTarget);
66 RegisterMCAsmInfo<SparcELFMCAsmInfo> Y(TheSparcV9Target);
67 }
68
createSparcMCCodeGenInfo(StringRef TT,Reloc::Model RM)69 MCCodeGenInfo *createSparcMCCodeGenInfo(StringRef TT, Reloc::Model RM) {
70 MCCodeGenInfo *X = new MCCodeGenInfo();
71 X->InitMCCodeGenInfo(RM);
72 return X;
73 }
74
LLVMInitializeSparcMCCodeGenInfo()75 extern "C" void LLVMInitializeSparcMCCodeGenInfo() {
76 TargetRegistry::RegisterMCCodeGenInfo(TheSparcTarget,
77 createSparcMCCodeGenInfo);
78 TargetRegistry::RegisterMCCodeGenInfo(TheSparcV9Target,
79 createSparcMCCodeGenInfo);
80 }
81
82