Files
clang-p2996/llvm/lib/Target/SPIRV/TargetInfo/SPIRVTargetInfo.cpp
Ilia Diachkov 6c69427e88 [SPIR-V](3/6) Add MC layer, object file support, and InstPrinter
The patch adds SPIRV-specific MC layer implementation, SPIRV object
file support and SPIRVInstPrinter.

Differential Revision: https://reviews.llvm.org/D116462

Authors: Aleksandr Bezzubikov, Lewis Crawford, Ilia Diachkov,
Michal Paszkowski, Andrey Tretyakov, Konrad Trifunovic

Co-authored-by: Aleksandr Bezzubikov <zuban32s@gmail.com>
Co-authored-by: Ilia Diachkov <iliya.diyachkov@intel.com>
Co-authored-by: Michal Paszkowski <michal.paszkowski@outlook.com>
Co-authored-by: Andrey Tretyakov <andrey1.tretyakov@intel.com>
Co-authored-by: Konrad Trifunovic <konrad.trifunovic@intel.com>
2022-04-20 01:10:25 +02:00

29 lines
1016 B
C++

//===-- SPIRVTargetInfo.cpp - SPIR-V Target Implementation ----*- C++ -*---===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#include "TargetInfo/SPIRVTargetInfo.h"
#include "llvm/MC/TargetRegistry.h"
using namespace llvm;
Target &llvm::getTheSPIRV32Target() {
static Target TheSPIRV32Target;
return TheSPIRV32Target;
}
Target &llvm::getTheSPIRV64Target() {
static Target TheSPIRV64Target;
return TheSPIRV64Target;
}
extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeSPIRVTargetInfo() {
RegisterTarget<Triple::spirv32> X(getTheSPIRV32Target(), "spirv32",
"SPIR-V 32-bit", "SPIRV");
RegisterTarget<Triple::spirv64> Y(getTheSPIRV64Target(), "spirv64",
"SPIR-V 64-bit", "SPIRV");
}