brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.4 KiB · 4e09d5e Raw
36 lines · cpp
1//==- SPIRVOpenMP.cpp - SPIR-V OpenMP Tool Implementations --------*- 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#include "SPIRVOpenMP.h"9#include "clang/Driver/CommonArgs.h"10 11using namespace clang::driver;12using namespace clang::driver::toolchains;13using namespace clang::driver::tools;14using namespace llvm::opt;15 16namespace clang::driver::toolchains {17SPIRVOpenMPToolChain::SPIRVOpenMPToolChain(const Driver &D,18                                           const llvm::Triple &Triple,19                                           const ToolChain &HostToolchain,20                                           const ArgList &Args)21    : SPIRVToolChain(D, Triple, Args), HostTC(HostToolchain) {}22 23void SPIRVOpenMPToolChain::addClangTargetOptions(24    const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args,25    Action::OffloadKind DeviceOffloadingKind) const {26 27  if (DeviceOffloadingKind != Action::OFK_OpenMP)28    return;29 30  if (!DriverArgs.hasFlag(options::OPT_offloadlib, options::OPT_no_offloadlib,31                          true))32    return;33  addOpenMPDeviceRTL(getDriver(), DriverArgs, CC1Args, "", getTriple(), HostTC);34}35} // namespace clang::driver::toolchains36