Introduce MCCodeGenInfo, which keeps information that can affect codegen
[oota-llvm.git] / lib / Target / MSP430 / MCTargetDesc / MSP430MCTargetDesc.cpp
1 //===-- MSP430MCTargetDesc.cpp - MSP430 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 MSP430 specific target descriptions.
11 //
12 //===----------------------------------------------------------------------===//
13
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"
20
21 #define GET_INSTRINFO_MC_DESC
22 #include "MSP430GenInstrInfo.inc"
23
24 #define GET_SUBTARGETINFO_MC_DESC
25 #include "MSP430GenSubtargetInfo.inc"
26
27 #define GET_REGINFO_MC_DESC
28 #include "MSP430GenRegisterInfo.inc"
29
30 using namespace llvm;
31
32 static MCInstrInfo *createMSP430MCInstrInfo() {
33   MCInstrInfo *X = new MCInstrInfo();
34   InitMSP430MCInstrInfo(X);
35   return X;
36 }
37
38 extern "C" void LLVMInitializeMSP430MCInstrInfo() {
39   TargetRegistry::RegisterMCInstrInfo(TheMSP430Target, createMSP430MCInstrInfo);
40 }
41
42
43 static MCRegisterInfo *createMSP430MCRegisterInfo(StringRef TT) {
44   MCRegisterInfo *X = new MCRegisterInfo();
45   InitMSP430MCRegisterInfo(X, MSP430::PCW);
46   return X;
47 }
48
49 extern "C" void LLVMInitializeMSP430MCRegisterInfo() {
50   TargetRegistry::RegisterMCRegInfo(TheMSP430Target,
51                                     createMSP430MCRegisterInfo);
52 }
53
54 static MCSubtargetInfo *createMSP430MCSubtargetInfo(StringRef TT, StringRef CPU,
55                                                     StringRef FS) {
56   MCSubtargetInfo *X = new MCSubtargetInfo();
57   InitMSP430MCSubtargetInfo(X, TT, CPU, FS);
58   return X;
59 }
60
61 extern "C" void LLVMInitializeMSP430MCSubtargetInfo() {
62   TargetRegistry::RegisterMCSubtargetInfo(TheMSP430Target,
63                                           createMSP430MCSubtargetInfo);
64 }
65
66 extern "C" void LLVMInitializeMSP430MCAsmInfo() {
67   RegisterMCAsmInfo<MSP430MCAsmInfo> X(TheMSP430Target);
68 }
69
70 MCCodeGenInfo *createMSP430MCCodeGenInfo(StringRef TT, Reloc::Model RM) {
71   MCCodeGenInfo *X = new MCCodeGenInfo();
72   X->InitMCCodeGenInfo(RM);
73   return X;
74 }
75
76 extern "C" void LLVMInitializeMSP430MCCodeGenInfo() {
77   TargetRegistry::RegisterMCCodeGenInfo(TheMSP430Target,
78                                         createMSP430MCCodeGenInfo);
79 }