1 //===-- SPIRVTargetInfo.cpp - SPIR-V Target Implementation ----*- C++ -*---===//
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 #include "TargetInfo/SPIRVTargetInfo.h"
10 #include "llvm/MC/TargetRegistry.h"
11 
12 using namespace llvm;
13 
14 Target &llvm::getTheSPIRV32Target() {
15   static Target TheSPIRV32Target;
16   return TheSPIRV32Target;
17 }
18 Target &llvm::getTheSPIRV64Target() {
19   static Target TheSPIRV64Target;
20   return TheSPIRV64Target;
21 }
22 
23 extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeSPIRVTargetInfo() {
24   RegisterTarget<Triple::spirv32> X(getTheSPIRV32Target(), "spirv32",
25                                     "SPIR-V 32-bit", "SPIRV");
26   RegisterTarget<Triple::spirv64> Y(getTheSPIRV64Target(), "spirv64",
27                                     "SPIR-V 64-bit", "SPIRV");
28 }
29