xref: /freebsd/contrib/llvm-project/llvm/lib/Target/WebAssembly/TargetInfo/WebAssemblyTargetInfo.cpp (revision 753f127f3ace09432b2baeffd71a308760641a62)
10b57cec5SDimitry Andric //===-- WebAssemblyTargetInfo.cpp - WebAssembly Target Implementation -----===//
20b57cec5SDimitry Andric //
30b57cec5SDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
40b57cec5SDimitry Andric // See https://llvm.org/LICENSE.txt for license information.
50b57cec5SDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
60b57cec5SDimitry Andric //
70b57cec5SDimitry Andric //===----------------------------------------------------------------------===//
80b57cec5SDimitry Andric ///
90b57cec5SDimitry Andric /// \file
100b57cec5SDimitry Andric /// This file registers the WebAssembly target.
110b57cec5SDimitry Andric ///
120b57cec5SDimitry Andric //===----------------------------------------------------------------------===//
130b57cec5SDimitry Andric 
140b57cec5SDimitry Andric #include "TargetInfo/WebAssemblyTargetInfo.h"
15349cc55cSDimitry Andric #include "llvm/MC/TargetRegistry.h"
160b57cec5SDimitry Andric using namespace llvm;
170b57cec5SDimitry Andric 
180b57cec5SDimitry Andric #define DEBUG_TYPE "wasm-target-info"
190b57cec5SDimitry Andric 
getTheWebAssemblyTarget32()200b57cec5SDimitry Andric Target &llvm::getTheWebAssemblyTarget32() {
210b57cec5SDimitry Andric   static Target TheWebAssemblyTarget32;
220b57cec5SDimitry Andric   return TheWebAssemblyTarget32;
230b57cec5SDimitry Andric }
getTheWebAssemblyTarget64()240b57cec5SDimitry Andric Target &llvm::getTheWebAssemblyTarget64() {
250b57cec5SDimitry Andric   static Target TheWebAssemblyTarget64;
260b57cec5SDimitry Andric   return TheWebAssemblyTarget64;
270b57cec5SDimitry Andric }
280b57cec5SDimitry Andric 
LLVMInitializeWebAssemblyTargetInfo()29480093f4SDimitry Andric extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeWebAssemblyTargetInfo() {
300b57cec5SDimitry Andric   RegisterTarget<Triple::wasm32> X(getTheWebAssemblyTarget32(), "wasm32",
310b57cec5SDimitry Andric                                    "WebAssembly 32-bit", "WebAssembly");
320b57cec5SDimitry Andric   RegisterTarget<Triple::wasm64> Y(getTheWebAssemblyTarget64(), "wasm64",
330b57cec5SDimitry Andric                                    "WebAssembly 64-bit", "WebAssembly");
340b57cec5SDimitry Andric }
355ffd83dbSDimitry Andric 
365ffd83dbSDimitry Andric // Defines llvm::WebAssembly::getWasm64Opcode llvm::WebAssembly::getStackOpcode
375ffd83dbSDimitry Andric // which have to be in a shared location between CodeGen and MC.
385ffd83dbSDimitry Andric #define GET_INSTRMAP_INFO 1
395ffd83dbSDimitry Andric #define GET_INSTRINFO_ENUM 1
40*753f127fSDimitry Andric #define GET_INSTRINFO_MC_HELPER_DECLS
415ffd83dbSDimitry Andric #include "WebAssemblyGenInstrInfo.inc"
42