brintos

brintos / llvm-project-archived public Read only

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