1 //===-- BlackfinMCTargetDesc.cpp - Blackfin 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 Blackfin specific target descriptions.
12 //===----------------------------------------------------------------------===//
14 #include "BlackfinMCTargetDesc.h"
15 #include "BlackfinMCAsmInfo.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"
21 #define GET_INSTRINFO_MC_DESC
22 #include "BlackfinGenInstrInfo.inc"
24 #define GET_SUBTARGETINFO_MC_DESC
25 #include "BlackfinGenSubtargetInfo.inc"
27 #define GET_REGINFO_MC_DESC
28 #include "BlackfinGenRegisterInfo.inc"
33 static MCInstrInfo *createBlackfinMCInstrInfo() {
34 MCInstrInfo *X = new MCInstrInfo();
35 InitBlackfinMCInstrInfo(X);
39 static MCRegisterInfo *createBlackfinMCRegisterInfo(StringRef TT) {
40 MCRegisterInfo *X = new MCRegisterInfo();
41 InitBlackfinMCRegisterInfo(X, BF::RETS);
45 static MCSubtargetInfo *createBlackfinMCSubtargetInfo(StringRef TT,
48 MCSubtargetInfo *X = new MCSubtargetInfo();
49 InitBlackfinMCSubtargetInfo(X, TT, CPU, FS);
53 static MCCodeGenInfo *createBlackfinMCCodeGenInfo(StringRef TT, Reloc::Model RM,
54 CodeModel::Model CM) {
55 MCCodeGenInfo *X = new MCCodeGenInfo();
56 X->InitMCCodeGenInfo(RM, CM);
60 // Force static initialization.
61 extern "C" void LLVMInitializeBlackfinTargetMC() {
62 // Register the MC asm info.
63 RegisterMCAsmInfo<BlackfinMCAsmInfo> X(TheBlackfinTarget);
65 // Register the MC codegen info.
66 TargetRegistry::RegisterMCCodeGenInfo(TheBlackfinTarget,
67 createBlackfinMCCodeGenInfo);
69 // Register the MC instruction info.
70 TargetRegistry::RegisterMCInstrInfo(TheBlackfinTarget,
71 createBlackfinMCInstrInfo);
73 // Register the MC register info.
74 TargetRegistry::RegisterMCRegInfo(TheBlackfinTarget,
75 createBlackfinMCRegisterInfo);
77 // Register the MC subtarget info.
78 TargetRegistry::RegisterMCSubtargetInfo(TheBlackfinTarget,
79 createBlackfinMCSubtargetInfo);