LLVM  13.0.0git
MSP430MCTargetDesc.cpp
Go to the documentation of this file.
1 //===-- MSP430MCTargetDesc.cpp - MSP430 Target Descriptions ---------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file provides MSP430 specific target descriptions.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #include "MSP430MCTargetDesc.h"
14 #include "MSP430InstPrinter.h"
15 #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, /*TuneCPU*/ 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 
62 
72 }
MSP430TargetInfo.h
llvm
Definition: AllocatorList.h:23
llvm::Target
Target - Wrapper for Target specific information.
Definition: TargetRegistry.h:124
llvm::MCAsmInfo
This class is intended to be used as a base class for asm properties and features specific to the tar...
Definition: MCAsmInfo.h:56
llvm::Triple
Triple - Helper class for working with autoconf configuration names.
Definition: Triple.h:45
T
#define T
Definition: Mips16ISelLowering.cpp:341
llvm::createMSP430MCAsmBackend
MCAsmBackend * createMSP430MCAsmBackend(const Target &T, const MCSubtargetInfo &STI, const MCRegisterInfo &MRI, const MCTargetOptions &Options)
Definition: MSP430AsmBackend.cpp:164
MSP430InstPrinter.h
llvm::TargetRegistry::RegisterMCInstPrinter
static void RegisterMCInstPrinter(Target &T, Target::MCInstPrinterCtorTy Fn)
RegisterMCInstPrinter - Register a MCInstPrinter implementation for the given target.
Definition: TargetRegistry.h:838
createMSP430MCInstPrinter
static MCInstPrinter * createMSP430MCInstPrinter(const Triple &T, unsigned SyntaxVariant, const MCAsmInfo &MAI, const MCInstrInfo &MII, const MCRegisterInfo &MRI)
Definition: MSP430MCTargetDesc.cpp:50
llvm::X86AS::FS
@ FS
Definition: X86.h:183
MCInstrInfo.h
llvm::MSP430InstPrinter
Definition: MSP430InstPrinter.h:19
MCSubtargetInfo.h
createMSP430MCInstrInfo
static MCInstrInfo * createMSP430MCInstrInfo()
Definition: MSP430MCTargetDesc.cpp:33
llvm::createMSP430ObjectTargetStreamer
MCTargetStreamer * createMSP430ObjectTargetStreamer(MCStreamer &S, const MCSubtargetInfo &STI)
Definition: MSP430ELFStreamer.cpp:73
X
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang", "erlang-compatible garbage collector")
createMSP430MCRegisterInfo
static MCRegisterInfo * createMSP430MCRegisterInfo(const Triple &TT)
Definition: MSP430MCTargetDesc.cpp:39
MSP430MCTargetDesc.h
createMSP430MCSubtargetInfo
static MCSubtargetInfo * createMSP430MCSubtargetInfo(const Triple &TT, StringRef CPU, StringRef FS)
Definition: MSP430MCTargetDesc.cpp:46
MSP430MCAsmInfo.h
llvm::TargetRegistry::RegisterMCAsmBackend
static void RegisterMCAsmBackend(Target &T, Target::MCAsmBackendCtorTy Fn)
RegisterMCAsmBackend - Register a MCAsmBackend implementation for the given target.
Definition: TargetRegistry.h:785
llvm::createMSP430MCCodeEmitter
MCCodeEmitter * createMSP430MCCodeEmitter(const MCInstrInfo &MCII, const MCRegisterInfo &MRI, MCContext &Ctx)
Creates a machine code emitter for MSP430.
Definition: MSP430MCCodeEmitter.cpp:202
llvm::MCInstPrinter
This is an instance of a target assembly language printer that converts an MCInst to valid target ass...
Definition: MCInstPrinter.h:43
LLVM_EXTERNAL_VISIBILITY
#define LLVM_EXTERNAL_VISIBILITY
Definition: Compiler.h:132
llvm::TargetRegistry::RegisterObjectTargetStreamer
static void RegisterObjectTargetStreamer(Target &T, Target::ObjectTargetStreamerCtorTy Fn)
Definition: TargetRegistry.h:882
MCRegisterInfo.h
llvm::TargetRegistry::RegisterMCSubtargetInfo
static void RegisterMCSubtargetInfo(Target &T, Target::MCSubtargetInfoCtorFnTy Fn)
RegisterMCSubtargetInfo - Register a MCSubtargetInfo implementation for the given target.
Definition: TargetRegistry.h:758
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:57
llvm::RegisterMCAsmInfo
RegisterMCAsmInfo - Helper template for registering a target assembly info implementation.
Definition: TargetRegistry.h:953
llvm::MCRegisterInfo
MCRegisterInfo base class - We assume that the target defines a static array of MCRegisterDesc object...
Definition: MCRegisterInfo.h:135
MRI
unsigned const MachineRegisterInfo * MRI
Definition: AArch64AdvSIMDScalarPass.cpp:105
llvm::TargetRegistry::RegisterMCInstrInfo
static void RegisterMCInstrInfo(Target &T, Target::MCInstrInfoCtorFnTy Fn)
RegisterMCInstrInfo - Register a MCInstrInfo implementation for the given target.
Definition: TargetRegistry.h:725
llvm::TargetRegistry::RegisterMCCodeEmitter
static void RegisterMCCodeEmitter(Target &T, Target::MCCodeEmitterCtorTy Fn)
RegisterMCCodeEmitter - Register a MCCodeEmitter implementation for the given target.
Definition: TargetRegistry.h:851
llvm::MCInstrInfo
Interface to description of machine instruction set.
Definition: MCInstrInfo.h:25
llvm::TargetRegistry::RegisterMCRegInfo
static void RegisterMCRegInfo(Target &T, Target::MCRegInfoCtorFnTy Fn)
RegisterMCRegInfo - Register a MCRegisterInfo implementation for the given target.
Definition: TargetRegistry.h:745
llvm::getTheMSP430Target
Target & getTheMSP430Target()
Definition: MSP430TargetInfo.cpp:13
LLVMInitializeMSP430TargetMC
LLVM_EXTERNAL_VISIBILITY void LLVMInitializeMSP430TargetMC()
Definition: MSP430MCTargetDesc.cpp:60
TargetRegistry.h
llvm::MCSubtargetInfo
Generic base class for all target subtargets.
Definition: MCSubtargetInfo.h:75