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/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 "BlackfinGenInstrInfo.inc"
25 #define GET_SUBTARGETINFO_MC_DESC
26 #include "BlackfinGenSubtargetInfo.inc"
28 #define GET_REGINFO_MC_DESC
29 #include "BlackfinGenRegisterInfo.inc"
34 static MCInstrInfo *createBlackfinMCInstrInfo() {
35 MCInstrInfo *X = new MCInstrInfo();
36 InitBlackfinMCInstrInfo(X);
40 static MCRegisterInfo *createBlackfinMCRegisterInfo(StringRef TT) {
41 MCRegisterInfo *X = new MCRegisterInfo();
42 InitBlackfinMCRegisterInfo(X, BF::RETS);
46 static MCSubtargetInfo *createBlackfinMCSubtargetInfo(StringRef TT,
49 MCSubtargetInfo *X = new MCSubtargetInfo();
50 InitBlackfinMCSubtargetInfo(X, TT, CPU, FS);
54 static MCCodeGenInfo *createBlackfinMCCodeGenInfo(StringRef TT, Reloc::Model RM,
55 CodeModel::Model CM) {
56 MCCodeGenInfo *X = new MCCodeGenInfo();
57 X->InitMCCodeGenInfo(RM, CM);
61 // Force static initialization.
62 extern "C" void LLVMInitializeBlackfinTargetMC() {
63 // Register the MC asm info.
64 RegisterMCAsmInfo<BlackfinMCAsmInfo> X(TheBlackfinTarget);
66 // Register the MC codegen info.
67 TargetRegistry::RegisterMCCodeGenInfo(TheBlackfinTarget,
68 createBlackfinMCCodeGenInfo);
70 // Register the MC instruction info.
71 TargetRegistry::RegisterMCInstrInfo(TheBlackfinTarget,
72 createBlackfinMCInstrInfo);
74 // Register the MC register info.
75 TargetRegistry::RegisterMCRegInfo(TheBlackfinTarget,
76 createBlackfinMCRegisterInfo);
78 // Register the MC subtarget info.
79 TargetRegistry::RegisterMCSubtargetInfo(TheBlackfinTarget,
80 createBlackfinMCSubtargetInfo);