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/MCCodeGenInfo.h"
17 #include "llvm/MC/MCInstrInfo.h"
18 #include "llvm/MC/MCRegisterInfo.h"
19 #include "llvm/MC/MCSubtargetInfo.h"
20 #include "llvm/Target/TargetRegistry.h"
22 #define GET_INSTRINFO_MC_DESC
23 #include "AlphaGenInstrInfo.inc"
25 #define GET_SUBTARGETINFO_MC_DESC
26 #include "AlphaGenSubtargetInfo.inc"
28 #define GET_REGINFO_MC_DESC
29 #include "AlphaGenRegisterInfo.inc"
34 static MCInstrInfo *createAlphaMCInstrInfo() {
35 MCInstrInfo *X = new MCInstrInfo();
36 InitAlphaMCInstrInfo(X);
40 static MCRegisterInfo *createAlphaMCRegisterInfo(StringRef TT) {
41 MCRegisterInfo *X = new MCRegisterInfo();
42 InitAlphaMCRegisterInfo(X, Alpha::R26);
46 static MCSubtargetInfo *createAlphaMCSubtargetInfo(StringRef TT, StringRef CPU,
48 MCSubtargetInfo *X = new MCSubtargetInfo();
49 InitAlphaMCSubtargetInfo(X, TT, CPU, FS);
53 static MCCodeGenInfo *createAlphaMCCodeGenInfo(StringRef TT, Reloc::Model RM,
54 CodeModel::Model CM) {
55 MCCodeGenInfo *X = new MCCodeGenInfo();
56 X->InitMCCodeGenInfo(Reloc::PIC_, CM);
60 // Force static initialization.
61 extern "C" void LLVMInitializeAlphaTargetMC() {
62 // Register the MC asm info.
63 RegisterMCAsmInfo<AlphaMCAsmInfo> X(TheAlphaTarget);
65 // Register the MC codegen info.
66 TargetRegistry::RegisterMCCodeGenInfo(TheAlphaTarget,
67 createAlphaMCCodeGenInfo);
69 // Register the MC instruction info.
70 TargetRegistry::RegisterMCInstrInfo(TheAlphaTarget, createAlphaMCInstrInfo);
72 // Register the MC register info.
73 TargetRegistry::RegisterMCRegInfo(TheAlphaTarget, createAlphaMCRegisterInfo);
75 // Register the MC subtarget info.
76 TargetRegistry::RegisterMCSubtargetInfo(TheAlphaTarget,
77 createAlphaMCSubtargetInfo);