- Move CodeModel from a TargetMachine global option to MCCodeGenInfo.
[oota-llvm.git] / lib / Target / Alpha / MCTargetDesc / AlphaMCTargetDesc.cpp
1 //===-- AlphaMCTargetDesc.cpp - Alpha 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 Alpha specific target descriptions.
11 //
12 //===----------------------------------------------------------------------===//
13
14 #include "AlphaMCTargetDesc.h"
15 #include "AlphaMCAsmInfo.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 "AlphaGenInstrInfo.inc"
23
24 #define GET_SUBTARGETINFO_MC_DESC
25 #include "AlphaGenSubtargetInfo.inc"
26
27 #define GET_REGINFO_MC_DESC
28 #include "AlphaGenRegisterInfo.inc"
29
30 using namespace llvm;
31
32
33 static MCInstrInfo *createAlphaMCInstrInfo() {
34   MCInstrInfo *X = new MCInstrInfo();
35   InitAlphaMCInstrInfo(X);
36   return X;
37 }
38
39 extern "C" void LLVMInitializeAlphaMCInstrInfo() {
40   TargetRegistry::RegisterMCInstrInfo(TheAlphaTarget, createAlphaMCInstrInfo);
41 }
42
43 static MCRegisterInfo *createAlphaMCRegisterInfo(StringRef TT) {
44   MCRegisterInfo *X = new MCRegisterInfo();
45   InitAlphaMCRegisterInfo(X, Alpha::R26);
46   return X;
47 }
48
49 extern "C" void LLVMInitializeAlphaMCRegisterInfo() {
50   TargetRegistry::RegisterMCRegInfo(TheAlphaTarget, createAlphaMCRegisterInfo);
51 }
52
53 static MCSubtargetInfo *createAlphaMCSubtargetInfo(StringRef TT, StringRef CPU,
54                                                    StringRef FS) {
55   MCSubtargetInfo *X = new MCSubtargetInfo();
56   InitAlphaMCSubtargetInfo(X, TT, CPU, FS);
57   return X;
58 }
59
60 extern "C" void LLVMInitializeAlphaMCSubtargetInfo() {
61   TargetRegistry::RegisterMCSubtargetInfo(TheAlphaTarget,
62                                           createAlphaMCSubtargetInfo);
63 }
64
65 extern "C" void LLVMInitializeAlphaMCAsmInfo() {
66   RegisterMCAsmInfo<AlphaMCAsmInfo> X(TheAlphaTarget);
67 }
68
69 MCCodeGenInfo *createAlphaMCCodeGenInfo(StringRef TT, Reloc::Model RM,
70                                         CodeModel::Model CM) {
71   MCCodeGenInfo *X = new MCCodeGenInfo();
72   X->InitMCCodeGenInfo(Reloc::PIC_, CM);
73   return X;
74 }
75
76 extern "C" void LLVMInitializeAlphaMCCodeGenInfo() {
77   TargetRegistry::RegisterMCCodeGenInfo(TheAlphaTarget,
78                                         createAlphaMCCodeGenInfo);
79 }
80