Dan Gohman | 10e730a | 2015-06-29 23:51:55 +0000 | [diff] [blame] | 1 | //===-- WebAssemblyTargetInfo.cpp - WebAssembly Target Implementation -----===// |
| 2 | // |
Chandler Carruth | 2946cd7 | 2019-01-19 08:50:56 +0000 | [diff] [blame^] | 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 |
Dan Gohman | 10e730a | 2015-06-29 23:51:55 +0000 | [diff] [blame] | 6 | // |
| 7 | //===----------------------------------------------------------------------===// |
| 8 | /// |
| 9 | /// \file |
Adrian Prantl | 5f8f34e4 | 2018-05-01 15:54:18 +0000 | [diff] [blame] | 10 | /// This file registers the WebAssembly target. |
Dan Gohman | 10e730a | 2015-06-29 23:51:55 +0000 | [diff] [blame] | 11 | /// |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
| 14 | #include "MCTargetDesc/WebAssemblyMCTargetDesc.h" |
| 15 | #include "llvm/ADT/Triple.h" |
| 16 | #include "llvm/Support/TargetRegistry.h" |
| 17 | using namespace llvm; |
| 18 | |
| 19 | #define DEBUG_TYPE "wasm-target-info" |
| 20 | |
Daniel Jasper | 0dea246 | 2016-10-10 06:49:55 +0000 | [diff] [blame] | 21 | Target &llvm::getTheWebAssemblyTarget32() { |
| 22 | static Target TheWebAssemblyTarget32; |
| 23 | return TheWebAssemblyTarget32; |
| 24 | } |
| 25 | Target &llvm::getTheWebAssemblyTarget64() { |
| 26 | static Target TheWebAssemblyTarget64; |
| 27 | return TheWebAssemblyTarget64; |
| 28 | } |
Dan Gohman | 10e730a | 2015-06-29 23:51:55 +0000 | [diff] [blame] | 29 | |
| 30 | extern "C" void LLVMInitializeWebAssemblyTargetInfo() { |
Mehdi Amini | f42454b | 2016-10-09 23:00:34 +0000 | [diff] [blame] | 31 | RegisterTarget<Triple::wasm32> X(getTheWebAssemblyTarget32(), "wasm32", |
Reid Kleckner | 8d8a8bb | 2017-11-16 00:32:19 +0000 | [diff] [blame] | 32 | "WebAssembly 32-bit", "WebAssembly"); |
Mehdi Amini | f42454b | 2016-10-09 23:00:34 +0000 | [diff] [blame] | 33 | RegisterTarget<Triple::wasm64> Y(getTheWebAssemblyTarget64(), "wasm64", |
Reid Kleckner | 8d8a8bb | 2017-11-16 00:32:19 +0000 | [diff] [blame] | 34 | "WebAssembly 64-bit", "WebAssembly"); |
Dan Gohman | 10e730a | 2015-06-29 23:51:55 +0000 | [diff] [blame] | 35 | } |