LLVM  4.0.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/MCInstrInfo.h"
18 #include "llvm/MC/MCRegisterInfo.h"
21 
22 using namespace llvm;
23 
24 #define GET_INSTRINFO_MC_DESC
25 #include "MSP430GenInstrInfo.inc"
26 
27 #define GET_SUBTARGETINFO_MC_DESC
28 #include "MSP430GenSubtargetInfo.inc"
29 
30 #define GET_REGINFO_MC_DESC
31 #include "MSP430GenRegisterInfo.inc"
32 
34  MCInstrInfo *X = new MCInstrInfo();
35  InitMSP430MCInstrInfo(X);
36  return X;
37 }
38 
41  InitMSP430MCRegisterInfo(X, MSP430::PC);
42  return X;
43 }
44 
45 static MCSubtargetInfo *
47  return createMSP430MCSubtargetInfoImpl(TT, CPU, FS);
48 }
49 
51  unsigned SyntaxVariant,
52  const MCAsmInfo &MAI,
53  const MCInstrInfo &MII,
54  const MCRegisterInfo &MRI) {
55  if (SyntaxVariant == 0)
56  return new MSP430InstPrinter(MAI, MII, MRI);
57  return nullptr;
58 }
59 
60 extern "C" void LLVMInitializeMSP430TargetMC() {
61  // Register the MC asm info.
63 
64  // Register the MC instruction info.
67 
68  // Register the MC register info.
71 
72  // Register the MC subtarget info.
75 
76  // Register the MCInstPrinter.
79 }
Target & getTheMSP430Target()
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:57
unsigned const MachineRegisterInfo * MRI
Interface to description of machine instruction set.
Definition: MCInstrInfo.h:24
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang","erlang-compatible garbage collector")
static void RegisterMCSubtargetInfo(Target &T, Target::MCSubtargetInfoCtorFnTy Fn)
RegisterMCSubtargetInfo - Register a MCSubtargetInfo implementation for the given target...
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:41
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:47
static MCInstrInfo * createMSP430MCInstrInfo()
static MCSubtargetInfo * createMSP430MCSubtargetInfo(const Triple &TT, StringRef CPU, StringRef FS)
char * PC