1*0b57cec5SDimitry Andric //===-- WebAssemblyTargetInfo.cpp - WebAssembly Target Implementation -----===//
2*0b57cec5SDimitry Andric //
3*0b57cec5SDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4*0b57cec5SDimitry Andric // See https://llvm.org/LICENSE.txt for license information.
5*0b57cec5SDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6*0b57cec5SDimitry Andric //
7*0b57cec5SDimitry Andric //===----------------------------------------------------------------------===//
8*0b57cec5SDimitry Andric ///
9*0b57cec5SDimitry Andric /// \file
10*0b57cec5SDimitry Andric /// This file registers the WebAssembly target.
11*0b57cec5SDimitry Andric ///
12*0b57cec5SDimitry Andric //===----------------------------------------------------------------------===//
13*0b57cec5SDimitry Andric 
14*0b57cec5SDimitry Andric #include "TargetInfo/WebAssemblyTargetInfo.h"
15*0b57cec5SDimitry Andric #include "llvm/MC/TargetRegistry.h"
16*0b57cec5SDimitry Andric using namespace llvm;
17*0b57cec5SDimitry Andric 
18*0b57cec5SDimitry Andric #define DEBUG_TYPE "wasm-target-info"
19*0b57cec5SDimitry Andric 
getTheWebAssemblyTarget32()20*0b57cec5SDimitry Andric Target &llvm::getTheWebAssemblyTarget32() {
21*0b57cec5SDimitry Andric   static Target TheWebAssemblyTarget32;
22*0b57cec5SDimitry Andric   return TheWebAssemblyTarget32;
23*0b57cec5SDimitry Andric }
getTheWebAssemblyTarget64()24*0b57cec5SDimitry Andric Target &llvm::getTheWebAssemblyTarget64() {
25*0b57cec5SDimitry Andric   static Target TheWebAssemblyTarget64;
26*0b57cec5SDimitry Andric   return TheWebAssemblyTarget64;
27*0b57cec5SDimitry Andric }
28*0b57cec5SDimitry Andric 
LLVMInitializeWebAssemblyTargetInfo()29*0b57cec5SDimitry Andric extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeWebAssemblyTargetInfo() {
30*0b57cec5SDimitry Andric   RegisterTarget<Triple::wasm32> X(getTheWebAssemblyTarget32(), "wasm32",
31*0b57cec5SDimitry Andric                                    "WebAssembly 32-bit", "WebAssembly");
32*0b57cec5SDimitry Andric   RegisterTarget<Triple::wasm64> Y(getTheWebAssemblyTarget64(), "wasm64",
33*0b57cec5SDimitry Andric                                    "WebAssembly 64-bit", "WebAssembly");
34*0b57cec5SDimitry Andric }
35 
36 // Defines llvm::WebAssembly::getWasm64Opcode llvm::WebAssembly::getStackOpcode
37 // which have to be in a shared location between CodeGen and MC.
38 #define GET_INSTRMAP_INFO 1
39 #define GET_INSTRINFO_ENUM 1
40 #define GET_INSTRINFO_MC_HELPER_DECLS
41 #include "WebAssemblyGenInstrInfo.inc"
42