blob: 416e61d7989ddd4b11489581adcf3c408265c49c [file] [log] [blame]
Dan Gohman10e730a2015-06-29 23:51:55 +00001//===-- WebAssemblyTargetInfo.cpp - WebAssembly Target Implementation -----===//
2//
Chandler Carruth2946cd72019-01-19 08:50:56 +00003// 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
Dan Gohman10e730a2015-06-29 23:51:55 +00006//
7//===----------------------------------------------------------------------===//
8///
9/// \file
Adrian Prantl5f8f34e42018-05-01 15:54:18 +000010/// This file registers the WebAssembly target.
Dan Gohman10e730a2015-06-29 23:51:55 +000011///
12//===----------------------------------------------------------------------===//
13
14#include "MCTargetDesc/WebAssemblyMCTargetDesc.h"
15#include "llvm/ADT/Triple.h"
16#include "llvm/Support/TargetRegistry.h"
17using namespace llvm;
18
19#define DEBUG_TYPE "wasm-target-info"
20
Daniel Jasper0dea2462016-10-10 06:49:55 +000021Target &llvm::getTheWebAssemblyTarget32() {
22 static Target TheWebAssemblyTarget32;
23 return TheWebAssemblyTarget32;
24}
25Target &llvm::getTheWebAssemblyTarget64() {
26 static Target TheWebAssemblyTarget64;
27 return TheWebAssemblyTarget64;
28}
Dan Gohman10e730a2015-06-29 23:51:55 +000029
30extern "C" void LLVMInitializeWebAssemblyTargetInfo() {
Mehdi Aminif42454b2016-10-09 23:00:34 +000031 RegisterTarget<Triple::wasm32> X(getTheWebAssemblyTarget32(), "wasm32",
Reid Kleckner8d8a8bb2017-11-16 00:32:19 +000032 "WebAssembly 32-bit", "WebAssembly");
Mehdi Aminif42454b2016-10-09 23:00:34 +000033 RegisterTarget<Triple::wasm64> Y(getTheWebAssemblyTarget64(), "wasm64",
Reid Kleckner8d8a8bb2017-11-16 00:32:19 +000034 "WebAssembly 64-bit", "WebAssembly");
Dan Gohman10e730a2015-06-29 23:51:55 +000035}