brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.3 KiB · c4d086d Raw
37 lines · cpp
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-exception6//7//===----------------------------------------------------------------------===//8 9#include "TargetInfo/SPIRVTargetInfo.h"10#include "llvm/MC/TargetRegistry.h"11#include "llvm/Support/Compiler.h"12 13using namespace llvm;14 15Target &llvm::getTheSPIRV32Target() {16  static Target TheSPIRV32Target;17  return TheSPIRV32Target;18}19Target &llvm::getTheSPIRV64Target() {20  static Target TheSPIRV64Target;21  return TheSPIRV64Target;22}23Target &llvm::getTheSPIRVLogicalTarget() {24  static Target TheSPIRVLogicalTarget;25  return TheSPIRVLogicalTarget;26}27 28extern "C" LLVM_ABI LLVM_EXTERNAL_VISIBILITY void29LLVMInitializeSPIRVTargetInfo() {30  RegisterTarget<Triple::spirv32> X(getTheSPIRV32Target(), "spirv32",31                                    "SPIR-V 32-bit", "SPIRV");32  RegisterTarget<Triple::spirv64> Y(getTheSPIRV64Target(), "spirv64",33                                    "SPIR-V 64-bit", "SPIRV");34  RegisterTarget<Triple::spirv> Z(getTheSPIRVLogicalTarget(), "spirv",35                                  "SPIR-V Logical", "SPIRV");36}37