Dan Gohman | 10e730a | 2015-06-29 23:51:55 +0000 | [diff] [blame] | 1 | //===-- WebAssemblyTargetInfo.cpp - WebAssembly Target Implementation -----===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | /// |
| 10 | /// \file |
| 11 | /// \brief This file registers the WebAssembly target. |
| 12 | /// |
| 13 | //===----------------------------------------------------------------------===// |
| 14 | |
| 15 | #include "MCTargetDesc/WebAssemblyMCTargetDesc.h" |
| 16 | #include "llvm/ADT/Triple.h" |
| 17 | #include "llvm/Support/TargetRegistry.h" |
| 18 | using namespace llvm; |
| 19 | |
| 20 | #define DEBUG_TYPE "wasm-target-info" |
| 21 | |
Daniel Jasper | 0dea246 | 2016-10-10 06:49:55 +0000 | [diff] [blame^] | 22 | Target &llvm::getTheWebAssemblyTarget32() { |
| 23 | static Target TheWebAssemblyTarget32; |
| 24 | return TheWebAssemblyTarget32; |
| 25 | } |
| 26 | Target &llvm::getTheWebAssemblyTarget64() { |
| 27 | static Target TheWebAssemblyTarget64; |
| 28 | return TheWebAssemblyTarget64; |
| 29 | } |
Dan Gohman | 10e730a | 2015-06-29 23:51:55 +0000 | [diff] [blame] | 30 | |
| 31 | extern "C" void LLVMInitializeWebAssemblyTargetInfo() { |
Mehdi Amini | f42454b | 2016-10-09 23:00:34 +0000 | [diff] [blame] | 32 | RegisterTarget<Triple::wasm32> X(getTheWebAssemblyTarget32(), "wasm32", |
Dan Gohman | 10e730a | 2015-06-29 23:51:55 +0000 | [diff] [blame] | 33 | "WebAssembly 32-bit"); |
Mehdi Amini | f42454b | 2016-10-09 23:00:34 +0000 | [diff] [blame] | 34 | RegisterTarget<Triple::wasm64> Y(getTheWebAssemblyTarget64(), "wasm64", |
Dan Gohman | 10e730a | 2015-06-29 23:51:55 +0000 | [diff] [blame] | 35 | "WebAssembly 64-bit"); |
| 36 | } |