LLVM  3.7.0
MSP430MCTargetDesc.cpp
Go to the documentation of this file.
1 //===-- MSP430MCTargetDesc.cpp - MSP430 Target Descriptions ---------------===//
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"
16 #include "MSP430MCAsmInfo.h"
17 #include "llvm/MC/MCCodeGenInfo.h"
18 #include "llvm/MC/MCInstrInfo.h"
19 #include "llvm/MC/MCRegisterInfo.h"
22 
23 using namespace llvm;
24 
25 #define GET_INSTRINFO_MC_DESC
26 #include "MSP430GenInstrInfo.inc"
27 
28 #define GET_SUBTARGETINFO_MC_DESC
29 #include "MSP430GenSubtargetInfo.inc"
30 
31 #define GET_REGINFO_MC_DESC
32 #include "MSP430GenRegisterInfo.inc"
33 
35  MCInstrInfo *X = new MCInstrInfo();
36  InitMSP430MCInstrInfo(X);
37  return X;
38 }
39 
42  InitMSP430MCRegisterInfo(X, MSP430::PC);
43  return X;
44 }
45 
46 static MCSubtargetInfo *
48  return createMSP430MCSubtargetInfoImpl(TT, CPU, FS);
49 }
50 
54  CodeGenOpt::Level OL) {
55  MCCodeGenInfo *X = new MCCodeGenInfo();
56  X->initMCCodeGenInfo(RM, CM, OL);
57  return X;
58 }
59 
61  unsigned SyntaxVariant,
62  const MCAsmInfo &MAI,
63  const MCInstrInfo &MII,
64  const MCRegisterInfo &MRI) {
65  if (SyntaxVariant == 0)
66  return new MSP430InstPrinter(MAI, MII, MRI);
67  return nullptr;
68 }
69 
70 extern "C" void LLVMInitializeMSP430TargetMC() {
71  // Register the MC asm info.
73 
74  // Register the MC codegen info.
77 
78  // Register the MC instruction info.
80 
81  // Register the MC register info.
84 
85  // Register the MC subtarget info.
88 
89  // Register the MCInstPrinter.
92 }
static void RegisterMCInstPrinter(Target &T, Target::MCInstPrinterCtorTy Fn)
RegisterMCInstPrinter - Register a MCInstPrinter implementation for the given target.
static MCRegisterInfo * createMSP430MCRegisterInfo(const Triple &TT)
MCRegisterInfo base class - We assume that the target defines a static array of MCRegisterDesc object...
This class is intended to be used as a base class for asm properties and features specific to the tar...
Definition: MCAsmInfo.h:58
Interface to description of machine instruction set.
Definition: MCInstrInfo.h:24
Target TheMSP430Target
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang","erlang-compatible garbage collector")
static void RegisterMCCodeGenInfo(Target &T, Target::MCCodeGenInfoCtorFnTy Fn)
RegisterMCCodeGenInfo - Register a MCCodeGenInfo implementation for the given target.
static void RegisterMCSubtargetInfo(Target &T, Target::MCSubtargetInfoCtorFnTy Fn)
RegisterMCSubtargetInfo - Register a MCSubtargetInfo implementation for the given target...
static MCCodeGenInfo * createMSP430MCCodeGenInfo(const Triple &TT, Reloc::Model RM, CodeModel::Model CM, CodeGenOpt::Level OL)
Triple - Helper class for working with autoconf configuration names.
Definition: Triple.h:44
RegisterMCAsmInfo - Helper template for registering a target assembly info implementation.
static void RegisterMCRegInfo(Target &T, Target::MCRegInfoCtorFnTy Fn)
RegisterMCRegInfo - Register a MCRegisterInfo implementation for the given target.
This is an instance of a target assembly language printer that converts an MCInst to valid target ass...
Definition: MCInstPrinter.h:38
void initMCCodeGenInfo(Reloc::Model RM=Reloc::Default, CodeModel::Model CM=CodeModel::Default, CodeGenOpt::Level OL=CodeGenOpt::Default)
static void RegisterMCInstrInfo(Target &T, Target::MCInstrInfoCtorFnTy Fn)
RegisterMCInstrInfo - Register a MCInstrInfo implementation for the given target. ...
MCSubtargetInfo - Generic base class for all target subtargets.
void LLVMInitializeMSP430TargetMC()
static MCInstPrinter * createMSP430MCInstPrinter(const Triple &T, unsigned SyntaxVariant, const MCAsmInfo &MAI, const MCInstrInfo &MII, const MCRegisterInfo &MRI)
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:40
static MCInstrInfo * createMSP430MCInstrInfo()
static MCSubtargetInfo * createMSP430MCSubtargetInfo(const Triple &TT, StringRef CPU, StringRef FS)