xref: /src/contrib/llvm-project/llvm/lib/Target/WebAssembly/TargetInfo/WebAssemblyTargetInfo.cpp (revision 753f127f3ace09432b2baeffd71a308760641a62)
11a82d4c0SDimitry Andric //===-- WebAssemblyTargetInfo.cpp - WebAssembly Target Implementation -----===//
21a82d4c0SDimitry Andric //
3e6d15924SDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4e6d15924SDimitry Andric // See https://llvm.org/LICENSE.txt for license information.
5e6d15924SDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
61a82d4c0SDimitry Andric //
71a82d4c0SDimitry Andric //===----------------------------------------------------------------------===//
81a82d4c0SDimitry Andric ///
91a82d4c0SDimitry Andric /// \file
10eb11fae6SDimitry Andric /// This file registers the WebAssembly target.
111a82d4c0SDimitry Andric ///
121a82d4c0SDimitry Andric //===----------------------------------------------------------------------===//
131a82d4c0SDimitry Andric 
14e6d15924SDimitry Andric #include "TargetInfo/WebAssemblyTargetInfo.h"
15c0981da4SDimitry Andric #include "llvm/MC/TargetRegistry.h"
161a82d4c0SDimitry Andric using namespace llvm;
171a82d4c0SDimitry Andric 
181a82d4c0SDimitry Andric #define DEBUG_TYPE "wasm-target-info"
191a82d4c0SDimitry Andric 
getTheWebAssemblyTarget32()20b915e9e0SDimitry Andric Target &llvm::getTheWebAssemblyTarget32() {
21b915e9e0SDimitry Andric   static Target TheWebAssemblyTarget32;
22b915e9e0SDimitry Andric   return TheWebAssemblyTarget32;
23b915e9e0SDimitry Andric }
getTheWebAssemblyTarget64()24b915e9e0SDimitry Andric Target &llvm::getTheWebAssemblyTarget64() {
25b915e9e0SDimitry Andric   static Target TheWebAssemblyTarget64;
26b915e9e0SDimitry Andric   return TheWebAssemblyTarget64;
27b915e9e0SDimitry Andric }
281a82d4c0SDimitry Andric 
LLVMInitializeWebAssemblyTargetInfo()29706b4fc4SDimitry Andric extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeWebAssemblyTargetInfo() {
30b915e9e0SDimitry Andric   RegisterTarget<Triple::wasm32> X(getTheWebAssemblyTarget32(), "wasm32",
31044eb2f6SDimitry Andric                                    "WebAssembly 32-bit", "WebAssembly");
32b915e9e0SDimitry Andric   RegisterTarget<Triple::wasm64> Y(getTheWebAssemblyTarget64(), "wasm64",
33044eb2f6SDimitry Andric                                    "WebAssembly 64-bit", "WebAssembly");
341a82d4c0SDimitry Andric }
35cfca06d7SDimitry Andric 
36cfca06d7SDimitry Andric // Defines llvm::WebAssembly::getWasm64Opcode llvm::WebAssembly::getStackOpcode
37cfca06d7SDimitry Andric // which have to be in a shared location between CodeGen and MC.
38cfca06d7SDimitry Andric #define GET_INSTRMAP_INFO 1
39cfca06d7SDimitry Andric #define GET_INSTRINFO_ENUM 1
401f917f69SDimitry Andric #define GET_INSTRINFO_MC_HELPER_DECLS
41cfca06d7SDimitry Andric #include "WebAssemblyGenInstrInfo.inc"
42