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 | |
Richard Trieu | c6c4213 | 2019-05-15 01:03:00 +0000 | [diff] [blame] | 14 | #include "TargetInfo/WebAssemblyTargetInfo.h" |
Dan Gohman | 10e730a | 2015-06-29 23:51:55 +0000 | [diff] [blame] | 15 | #include "llvm/Support/TargetRegistry.h" |
| 16 | using namespace llvm; |
| 17 | |
| 18 | #define DEBUG_TYPE "wasm-target-info" |
| 19 | |
Daniel Jasper | 0dea246 | 2016-10-10 06:49:55 +0000 | [diff] [blame] | 20 | Target &llvm::getTheWebAssemblyTarget32() { |
| 21 | static Target TheWebAssemblyTarget32; |
| 22 | return TheWebAssemblyTarget32; |
| 23 | } |
| 24 | Target &llvm::getTheWebAssemblyTarget64() { |
| 25 | static Target TheWebAssemblyTarget64; |
| 26 | return TheWebAssemblyTarget64; |
| 27 | } |
Dan Gohman | 10e730a | 2015-06-29 23:51:55 +0000 | [diff] [blame] | 28 | |
Tom Stellard | 4b0b261 | 2019-06-11 03:21:13 +0000 | [diff] [blame] | 29 | extern "C" void LLVMInitializeWebAssemblyTargetInfo() { |
Mehdi Amini | f42454b | 2016-10-09 23:00:34 +0000 | [diff] [blame] | 30 | RegisterTarget<Triple::wasm32> X(getTheWebAssemblyTarget32(), "wasm32", |
Reid Kleckner | 8d8a8bb | 2017-11-16 00:32:19 +0000 | [diff] [blame] | 31 | "WebAssembly 32-bit", "WebAssembly"); |
Mehdi Amini | f42454b | 2016-10-09 23:00:34 +0000 | [diff] [blame] | 32 | RegisterTarget<Triple::wasm64> Y(getTheWebAssemblyTarget64(), "wasm64", |
Reid Kleckner | 8d8a8bb | 2017-11-16 00:32:19 +0000 | [diff] [blame] | 33 | "WebAssembly 64-bit", "WebAssembly"); |
Dan Gohman | 10e730a | 2015-06-29 23:51:55 +0000 | [diff] [blame] | 34 | } |