WebAssemblyTargetInfo.cpp 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. //===-- WebAssemblyTargetInfo.cpp - WebAssembly Target Implementation -----===//
  2. //
  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
  6. //
  7. //===----------------------------------------------------------------------===//
  8. ///
  9. /// \file
  10. /// This file registers the WebAssembly target.
  11. ///
  12. //===----------------------------------------------------------------------===//
  13. #include "TargetInfo/WebAssemblyTargetInfo.h"
  14. #include "llvm/MC/TargetRegistry.h"
  15. using namespace llvm;
  16. #define DEBUG_TYPE "wasm-target-info"
  17. Target &llvm::getTheWebAssemblyTarget32() {
  18. static Target TheWebAssemblyTarget32;
  19. return TheWebAssemblyTarget32;
  20. }
  21. Target &llvm::getTheWebAssemblyTarget64() {
  22. static Target TheWebAssemblyTarget64;
  23. return TheWebAssemblyTarget64;
  24. }
  25. extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeWebAssemblyTargetInfo() {
  26. RegisterTarget<Triple::wasm32> X(getTheWebAssemblyTarget32(), "wasm32",
  27. "WebAssembly 32-bit", "WebAssembly");
  28. RegisterTarget<Triple::wasm64> Y(getTheWebAssemblyTarget64(), "wasm64",
  29. "WebAssembly 64-bit", "WebAssembly");
  30. }
  31. // Defines llvm::WebAssembly::getWasm64Opcode llvm::WebAssembly::getStackOpcode
  32. // which have to be in a shared location between CodeGen and MC.
  33. #define GET_INSTRMAP_INFO 1
  34. #define GET_INSTRINFO_ENUM 1
  35. #define GET_INSTRINFO_MC_HELPER_DECLS
  36. #include "WebAssemblyGenInstrInfo.inc"