Path: blob/main/contrib/llvm-project/llvm/lib/Target/WebAssembly/TargetInfo/WebAssemblyTargetInfo.cpp
35293 views
//===-- WebAssemblyTargetInfo.cpp - WebAssembly Target Implementation -----===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//7///8/// \file9/// This file registers the WebAssembly target.10///11//===----------------------------------------------------------------------===//1213#include "TargetInfo/WebAssemblyTargetInfo.h"14#include "llvm/MC/TargetRegistry.h"15using namespace llvm;1617#define DEBUG_TYPE "wasm-target-info"1819Target &llvm::getTheWebAssemblyTarget32() {20static Target TheWebAssemblyTarget32;21return TheWebAssemblyTarget32;22}23Target &llvm::getTheWebAssemblyTarget64() {24static Target TheWebAssemblyTarget64;25return TheWebAssemblyTarget64;26}2728extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeWebAssemblyTargetInfo() {29RegisterTarget<Triple::wasm32> X(getTheWebAssemblyTarget32(), "wasm32",30"WebAssembly 32-bit", "WebAssembly");31RegisterTarget<Triple::wasm64> Y(getTheWebAssemblyTarget64(), "wasm64",32"WebAssembly 64-bit", "WebAssembly");33}3435// Defines llvm::WebAssembly::getWasm64Opcode llvm::WebAssembly::getStackOpcode36// which have to be in a shared location between CodeGen and MC.37#define GET_INSTRMAP_INFO 138#define GET_INSTRINFO_ENUM 139#define GET_INSTRINFO_MC_HELPER_DECLS40#include "WebAssemblyGenInstrInfo.inc"414243