
Summary: We support `nogpulib` to disable implicit libraries. In the future we will want to change the default linking of these libraries based on the user language. This patch just introduces a positive variant so now we can do `-nogpulib -gpulib` to disable it. Later patch will make the default a variable in the ROCmToolChain depending on the target languages.
36 lines
1.4 KiB
C++
36 lines
1.4 KiB
C++
//==- SPIRVOpenMP.cpp - SPIR-V OpenMP Tool Implementations --------*- 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 "SPIRVOpenMP.h"
|
|
#include "CommonArgs.h"
|
|
|
|
using namespace clang::driver;
|
|
using namespace clang::driver::toolchains;
|
|
using namespace clang::driver::tools;
|
|
using namespace llvm::opt;
|
|
|
|
namespace clang::driver::toolchains {
|
|
SPIRVOpenMPToolChain::SPIRVOpenMPToolChain(const Driver &D,
|
|
const llvm::Triple &Triple,
|
|
const ToolChain &HostToolchain,
|
|
const ArgList &Args)
|
|
: SPIRVToolChain(D, Triple, Args), HostTC(HostToolchain) {}
|
|
|
|
void SPIRVOpenMPToolChain::addClangTargetOptions(
|
|
const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args,
|
|
Action::OffloadKind DeviceOffloadingKind) const {
|
|
|
|
if (DeviceOffloadingKind != Action::OFK_OpenMP)
|
|
return;
|
|
|
|
if (!DriverArgs.hasFlag(options::OPT_offloadlib, options::OPT_no_offloadlib,
|
|
true))
|
|
return;
|
|
addOpenMPDeviceRTL(getDriver(), DriverArgs, CC1Args, "", getTriple(), HostTC);
|
|
}
|
|
} // namespace clang::driver::toolchains
|