1 //===-- MBlazeMCTargetDesc.cpp - MBlaze 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 MBlaze specific target descriptions.
11 //
12 //===----------------------------------------------------------------------===//
13
14 #include "MBlazeMCTargetDesc.h"
15 #include "MBlazeMCAsmInfo.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 "MBlazeGenInstrInfo.inc"
23
24 #define GET_SUBTARGETINFO_MC_DESC
25 #include "MBlazeGenSubtargetInfo.inc"
26
27 #define GET_REGINFO_MC_DESC
28 #include "MBlazeGenRegisterInfo.inc"
29
30 using namespace llvm;
31
32
createMBlazeMCInstrInfo()33 static MCInstrInfo *createMBlazeMCInstrInfo() {
34 MCInstrInfo *X = new MCInstrInfo();
35 InitMBlazeMCInstrInfo(X);
36 return X;
37 }
38
LLVMInitializeMBlazeMCInstrInfo()39 extern "C" void LLVMInitializeMBlazeMCInstrInfo() {
40 TargetRegistry::RegisterMCInstrInfo(TheMBlazeTarget, createMBlazeMCInstrInfo);
41 }
42
createMBlazeMCRegisterInfo(StringRef TT)43 static MCRegisterInfo *createMBlazeMCRegisterInfo(StringRef TT) {
44 MCRegisterInfo *X = new MCRegisterInfo();
45 InitMBlazeMCRegisterInfo(X, MBlaze::R15);
46 return X;
47 }
48
LLVMInitializeMBlazeMCRegisterInfo()49 extern "C" void LLVMInitializeMBlazeMCRegisterInfo() {
50 TargetRegistry::RegisterMCRegInfo(TheMBlazeTarget,
51 createMBlazeMCRegisterInfo);
52 }
53
createMBlazeMCSubtargetInfo(StringRef TT,StringRef CPU,StringRef FS)54 static MCSubtargetInfo *createMBlazeMCSubtargetInfo(StringRef TT, StringRef CPU,
55 StringRef FS) {
56 MCSubtargetInfo *X = new MCSubtargetInfo();
57 InitMBlazeMCSubtargetInfo(X, TT, CPU, FS);
58 return X;
59 }
60
LLVMInitializeMBlazeMCSubtargetInfo()61 extern "C" void LLVMInitializeMBlazeMCSubtargetInfo() {
62 TargetRegistry::RegisterMCSubtargetInfo(TheMBlazeTarget,
63 createMBlazeMCSubtargetInfo);
64 }
65
createMCAsmInfo(const Target & T,StringRef TT)66 static MCAsmInfo *createMCAsmInfo(const Target &T, StringRef TT) {
67 Triple TheTriple(TT);
68 switch (TheTriple.getOS()) {
69 default:
70 return new MBlazeMCAsmInfo();
71 }
72 }
73
LLVMInitializeMBlazeMCAsmInfo()74 extern "C" void LLVMInitializeMBlazeMCAsmInfo() {
75 RegisterMCAsmInfoFn X(TheMBlazeTarget, createMCAsmInfo);
76 }
77
createMBlazeMCCodeGenInfo(StringRef TT,Reloc::Model RM)78 MCCodeGenInfo *createMBlazeMCCodeGenInfo(StringRef TT, Reloc::Model RM) {
79 MCCodeGenInfo *X = new MCCodeGenInfo();
80 if (RM == Reloc::Default)
81 RM = Reloc::Static;
82 X->InitMCCodeGenInfo(RM);
83 return X;
84 }
85
LLVMInitializeMBlazeMCCodeGenInfo()86 extern "C" void LLVMInitializeMBlazeMCCodeGenInfo() {
87 TargetRegistry::RegisterMCCodeGenInfo(TheMBlazeTarget,
88 createMBlazeMCCodeGenInfo);
89 }
90