1 //===-- MSP430MCTargetDesc.cpp - MSP430 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 MSP430 specific target descriptions.
12 //===----------------------------------------------------------------------===//
14 #include "MSP430MCTargetDesc.h"
15 #include "MSP430MCAsmInfo.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 "MSP430GenInstrInfo.inc"
24 #define GET_SUBTARGETINFO_MC_DESC
25 #include "MSP430GenSubtargetInfo.inc"
27 #define GET_REGINFO_MC_DESC
28 #include "MSP430GenRegisterInfo.inc"
32 static MCInstrInfo *createMSP430MCInstrInfo() {
33 MCInstrInfo *X = new MCInstrInfo();
34 InitMSP430MCInstrInfo(X);
38 static MCRegisterInfo *createMSP430MCRegisterInfo(StringRef TT) {
39 MCRegisterInfo *X = new MCRegisterInfo();
40 InitMSP430MCRegisterInfo(X, MSP430::PCW);
44 static MCSubtargetInfo *createMSP430MCSubtargetInfo(StringRef TT, StringRef CPU,
46 MCSubtargetInfo *X = new MCSubtargetInfo();
47 InitMSP430MCSubtargetInfo(X, TT, CPU, FS);
51 MCCodeGenInfo *createMSP430MCCodeGenInfo(StringRef TT, Reloc::Model RM,
52 CodeModel::Model CM) {
53 MCCodeGenInfo *X = new MCCodeGenInfo();
54 X->InitMCCodeGenInfo(RM, CM);
58 extern "C" void LLVMInitializeMSP430TargetMC() {
59 // Register the MC asm info.
60 RegisterMCAsmInfo<MSP430MCAsmInfo> X(TheMSP430Target);
62 // Register the MC codegen info.
63 TargetRegistry::RegisterMCCodeGenInfo(TheMSP430Target,
64 createMSP430MCCodeGenInfo);
66 // Register the MC instruction info.
67 TargetRegistry::RegisterMCInstrInfo(TheMSP430Target, createMSP430MCInstrInfo);
69 // Register the MC register info.
70 TargetRegistry::RegisterMCRegInfo(TheMSP430Target,
71 createMSP430MCRegisterInfo);
73 // Register the MC subtarget info.
74 TargetRegistry::RegisterMCSubtargetInfo(TheMSP430Target,
75 createMSP430MCSubtargetInfo);