181ad6265SDimitry Andric //===-- SPIRVTargetInfo.cpp - SPIR-V Target Implementation ----*- C++ -*---===// 281ad6265SDimitry Andric // 381ad6265SDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 481ad6265SDimitry Andric // See https://llvm.org/LICENSE.txt for license information. 581ad6265SDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 681ad6265SDimitry Andric // 781ad6265SDimitry Andric //===----------------------------------------------------------------------===// 881ad6265SDimitry Andric 981ad6265SDimitry Andric #include "TargetInfo/SPIRVTargetInfo.h" 1081ad6265SDimitry Andric #include "llvm/MC/TargetRegistry.h" 1181ad6265SDimitry Andric 1281ad6265SDimitry Andric using namespace llvm; 1381ad6265SDimitry Andric 1481ad6265SDimitry Andric Target &llvm::getTheSPIRV32Target() { 1581ad6265SDimitry Andric static Target TheSPIRV32Target; 1681ad6265SDimitry Andric return TheSPIRV32Target; 1781ad6265SDimitry Andric } 1881ad6265SDimitry Andric Target &llvm::getTheSPIRV64Target() { 1981ad6265SDimitry Andric static Target TheSPIRV64Target; 2081ad6265SDimitry Andric return TheSPIRV64Target; 2181ad6265SDimitry Andric } 22*5f757f3fSDimitry Andric Target &llvm::getTheSPIRVLogicalTarget() { 23*5f757f3fSDimitry Andric static Target TheSPIRVLogicalTarget; 24*5f757f3fSDimitry Andric return TheSPIRVLogicalTarget; 25*5f757f3fSDimitry Andric } 2681ad6265SDimitry Andric 2781ad6265SDimitry Andric extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeSPIRVTargetInfo() { 2881ad6265SDimitry Andric RegisterTarget<Triple::spirv32> X(getTheSPIRV32Target(), "spirv32", 2981ad6265SDimitry Andric "SPIR-V 32-bit", "SPIRV"); 3081ad6265SDimitry Andric RegisterTarget<Triple::spirv64> Y(getTheSPIRV64Target(), "spirv64", 3181ad6265SDimitry Andric "SPIR-V 64-bit", "SPIRV"); 32*5f757f3fSDimitry Andric RegisterTarget<Triple::spirv> Z(getTheSPIRVLogicalTarget(), "spirv", 33*5f757f3fSDimitry Andric "SPIR-V Logical", "SPIRV"); 3481ad6265SDimitry Andric } 35