1 //===-- AlphaMCTargetDesc.cpp - Alpha 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 Alpha specific target descriptions.
12 //===----------------------------------------------------------------------===//
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"
21 #define GET_INSTRINFO_MC_DESC
22 #include "AlphaGenInstrInfo.inc"
24 #define GET_SUBTARGETINFO_MC_DESC
25 #include "AlphaGenSubtargetInfo.inc"
27 #define GET_REGINFO_MC_DESC
28 #include "AlphaGenRegisterInfo.inc"
33 static MCInstrInfo *createAlphaMCInstrInfo() {
34 MCInstrInfo *X = new MCInstrInfo();
35 InitAlphaMCInstrInfo(X);
39 static MCRegisterInfo *createAlphaMCRegisterInfo(StringRef TT) {
40 MCRegisterInfo *X = new MCRegisterInfo();
41 InitAlphaMCRegisterInfo(X, Alpha::R26);
45 static MCSubtargetInfo *createAlphaMCSubtargetInfo(StringRef TT, StringRef CPU,
47 MCSubtargetInfo *X = new MCSubtargetInfo();
48 InitAlphaMCSubtargetInfo(X, TT, CPU, FS);
52 static MCCodeGenInfo *createAlphaMCCodeGenInfo(StringRef TT, Reloc::Model RM,
53 CodeModel::Model CM) {
54 MCCodeGenInfo *X = new MCCodeGenInfo();
55 X->InitMCCodeGenInfo(Reloc::PIC_, CM);
59 // Force static initialization.
60 extern "C" void LLVMInitializeAlphaTargetMC() {
61 // Register the MC asm info.
62 RegisterMCAsmInfo<AlphaMCAsmInfo> X(TheAlphaTarget);
64 // Register the MC codegen info.
65 TargetRegistry::RegisterMCCodeGenInfo(TheAlphaTarget,
66 createAlphaMCCodeGenInfo);
68 // Register the MC instruction info.
69 TargetRegistry::RegisterMCInstrInfo(TheAlphaTarget, createAlphaMCInstrInfo);
71 // Register the MC register info.
72 TargetRegistry::RegisterMCRegInfo(TheAlphaTarget, createAlphaMCRegisterInfo);
74 // Register the MC subtarget info.
75 TargetRegistry::RegisterMCSubtargetInfo(TheAlphaTarget,
76 createAlphaMCSubtargetInfo);