LLVM  3.7.0
WebAssemblyMCTargetDesc.cpp
Go to the documentation of this file.
1 //===-- WebAssemblyMCTargetDesc.cpp - WebAssembly 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 /// \file
11 /// \brief This file provides WebAssembly-specific target descriptions.
12 ///
13 //===----------------------------------------------------------------------===//
14 
17 #include "WebAssemblyMCAsmInfo.h"
18 #include "llvm/MC/MCCodeGenInfo.h"
19 #include "llvm/MC/MCInstrInfo.h"
20 #include "llvm/MC/MCRegisterInfo.h"
21 #include "llvm/MC/MCStreamer.h"
25 using namespace llvm;
26 
27 #define DEBUG_TYPE "wasm-mc-target-desc"
28 
29 #define GET_SUBTARGETINFO_MC_DESC
30 #include "WebAssemblyGenSubtargetInfo.inc"
31 
32 #define GET_REGINFO_MC_DESC
33 #include "WebAssemblyGenRegisterInfo.inc"
34 
36  const Triple &TT) {
37  MCAsmInfo *MAI = new WebAssemblyMCAsmInfo(TT);
38  return MAI;
39 }
40 
41 static MCInstPrinter *
42 createWebAssemblyMCInstPrinter(const Triple &T, unsigned SyntaxVariant,
43  const MCAsmInfo &MAI, const MCInstrInfo &MII,
44  const MCRegisterInfo &MRI) {
45  if (SyntaxVariant == 0 || SyntaxVariant == 1)
46  return new WebAssemblyInstPrinter(MAI, MII, MRI);
47  return nullptr;
48 }
49 
50 // Force static initialization.
53  // Register the MC asm info.
55 
56  // Register the MCInstPrinter.
58  }
59 }
Target TheWebAssemblyTarget64
This class prints an WebAssembly MCInst to wasm file syntax.
static void RegisterMCInstPrinter(Target &T, Target::MCInstPrinterCtorTy Fn)
RegisterMCInstPrinter - Register a MCInstPrinter implementation for the given target.
Target TheWebAssemblyTarget32
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
This file provides WebAssembly-specific target descriptions.
Interface to description of machine instruction set.
Definition: MCInstrInfo.h:24
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang","erlang-compatible garbage collector")
static MCInstPrinter * createWebAssemblyMCInstPrinter(const Triple &T, unsigned SyntaxVariant, const MCAsmInfo &MAI, const MCInstrInfo &MII, const MCRegisterInfo &MRI)
Triple - Helper class for working with autoconf configuration names.
Definition: Triple.h:44
Target - Wrapper for Target specific information.
This file contains the declaration of the WebAssemblyMCAsmInfo class.
RegisterMCAsmInfoFn - Helper template for registering a target assembly info implementation.
static MCAsmInfo * createWebAssemblyMCAsmInfo(const MCRegisterInfo &MRI, const Triple &TT)
This is an instance of a target assembly language printer that converts an MCInst to valid target ass...
Definition: MCInstPrinter.h:38
void LLVMInitializeWebAssemblyTargetMC()