1 //===-- WebAssemblyTargetInfo.cpp - WebAssembly Target Implementation -----===//
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-exception
7 //===----------------------------------------------------------------------===//
10 /// This file registers the WebAssembly target.
12 //===----------------------------------------------------------------------===//
14 #include "MCTargetDesc/WebAssemblyMCTargetDesc.h"
15 #include "llvm/ADT/Triple.h"
16 #include "llvm/Support/TargetRegistry.h"
19 #define DEBUG_TYPE "wasm-target-info"
21 Target
&llvm::getTheWebAssemblyTarget32() {
22 static Target TheWebAssemblyTarget32
;
23 return TheWebAssemblyTarget32
;
25 Target
&llvm::getTheWebAssemblyTarget64() {
26 static Target TheWebAssemblyTarget64
;
27 return TheWebAssemblyTarget64
;
30 extern "C" void LLVMInitializeWebAssemblyTargetInfo() {
31 RegisterTarget
<Triple::wasm32
> X(getTheWebAssemblyTarget32(), "wasm32",
32 "WebAssembly 32-bit", "WebAssembly");
33 RegisterTarget
<Triple::wasm64
> Y(getTheWebAssemblyTarget64(), "wasm64",
34 "WebAssembly 64-bit", "WebAssembly");