20#include "llvm/ADT/STLExtras.h"
21#include "llvm/Support/FileSystem.h"
22#include "llvm/Support/FormatAdapters.h"
23#include "llvm/Support/FormatVariadic.h"
24#include "llvm/Support/Path.h"
33 const llvm::Triple &Triple,
43 const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args,
48 "Only OpenMP offloading kinds are supported.");
50 if (DriverArgs.hasArg(options::OPT_nogpulib))
54 CC1Args.push_back(BCFile.ShouldInternalize ?
"-mlink-builtin-bitcode"
55 :
"-mlink-bitcode-file");
56 CC1Args.push_back(DriverArgs.MakeArgString(BCFile.Path));
65 const llvm::opt::DerivedArgList &Args, StringRef BoundArch,
70 DAL =
new DerivedArgList(Args.getBaseArgs());
76 if (!llvm::is_contained(*DAL, A))
79 if (!DAL->hasArg(options::OPT_march_EQ)) {
80 StringRef Arch = BoundArch;
85 llvm::formatv(
"{0}", llvm::fmt_consume(ArchsOrErr.takeError()));
87 << llvm::Triple::getArchTypeName(
getArch()) << ErrMsg <<
"-march";
90 Arch = Args.MakeArgString(ArchsOrErr->front());
93 DAL->AddJoinedArg(
nullptr, Opts.getOption(options::OPT_march_EQ), Arch);
103 if (!BoundArch.empty()) {
104 DAL->eraseArg(options::OPT_march_EQ);
105 DAL->AddJoinedArg(
nullptr, Opts.getOption(options::OPT_march_EQ),
113 ArgStringList &CC1Args)
const {
124 const ArgList &DriverArgs, ArgStringList &CC1Args)
const {
129 ArgStringList &CC1Args)
const {
148 const ArgList &Args)
const {
154 if (Args.hasArg(options::OPT_nogpulib))
163 getTriple(), Args.getLastArgValue(options::OPT_march_EQ));
168 BCLibs.emplace_back(BCLib);
Driver - Encapsulate logic for constructing compilation processes from a set of gcc-driver-like comma...
DiagnosticBuilder Diag(unsigned DiagID) const
const llvm::opt::OptTable & getOpts() const
The JSON file list parser is used to communicate input to InstallAPI.
llvm::StringRef getProcessorFromTargetID(const llvm::Triple &T, llvm::StringRef OffloadArch)
Get processor name from target ID.
const char * OffloadArchToString(OffloadArch A)