blob: e4afe2bb28301c817fa5c2d5ecd8b9e29a088d94 [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
Richard Trieuc6c42132019-05-15 01:03:00 +000014#include "TargetInfo/WebAssemblyTargetInfo.h"
Dan Gohman10e730a2015-06-29 23:51:55 +000015#include "llvm/Support/TargetRegistry.h"
16using namespace llvm;
17
18#define DEBUG_TYPE "wasm-target-info"
19
Daniel Jasper0dea2462016-10-10 06:49:55 +000020Target &llvm::getTheWebAssemblyTarget32() {
21 static Target TheWebAssemblyTarget32;
22 return TheWebAssemblyTarget32;
23}
24Target &llvm::getTheWebAssemblyTarget64() {
25 static Target TheWebAssemblyTarget64;
26 return TheWebAssemblyTarget64;
27}
Dan Gohman10e730a2015-06-29 23:51:55 +000028
Tom Stellard4b0b2612019-06-11 03:21:13 +000029extern "C" void LLVMInitializeWebAssemblyTargetInfo() {
Mehdi Aminif42454b2016-10-09 23:00:34 +000030 RegisterTarget<Triple::wasm32> X(getTheWebAssemblyTarget32(), "wasm32",
Reid Kleckner8d8a8bb2017-11-16 00:32:19 +000031 "WebAssembly 32-bit", "WebAssembly");
Mehdi Aminif42454b2016-10-09 23:00:34 +000032 RegisterTarget<Triple::wasm64> Y(getTheWebAssemblyTarget64(), "wasm64",
Reid Kleckner8d8a8bb2017-11-16 00:32:19 +000033 "WebAssembly 64-bit", "WebAssembly");
Dan Gohman10e730a2015-06-29 23:51:55 +000034}