clang  16.0.0git
OpenBSD.cpp
Go to the documentation of this file.
1 //===--- OpenBSD.cpp - OpenBSD ToolChain 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-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #include "OpenBSD.h"
10 #include "Arch/ARM.h"
11 #include "Arch/Mips.h"
12 #include "Arch/Sparc.h"
13 #include "CommonArgs.h"
14 #include "clang/Config/config.h"
16 #include "clang/Driver/Options.h"
18 #include "llvm/Option/ArgList.h"
19 #include "llvm/Support/Path.h"
20 #include "llvm/Support/VirtualFileSystem.h"
21 
22 using namespace clang::driver;
23 using namespace clang::driver::tools;
24 using namespace clang::driver::toolchains;
25 using namespace clang;
26 using namespace llvm::opt;
27 
29  const InputInfo &Output,
30  const InputInfoList &Inputs,
31  const ArgList &Args,
32  const char *LinkingOutput) const {
34  static_cast<const toolchains::OpenBSD &>(getToolChain());
35  const Driver &D = ToolChain.getDriver();
36  const llvm::Triple &Triple = ToolChain.getTriple();
37 
38  claimNoWarnArgs(Args);
39  ArgStringList CmdArgs;
40 
41  switch (ToolChain.getArch()) {
42  case llvm::Triple::x86:
43  // When building 32-bit code on OpenBSD/amd64, we have to explicitly
44  // instruct as in the base system to assemble 32-bit code.
45  CmdArgs.push_back("--32");
46  break;
47 
48  case llvm::Triple::arm:
49  case llvm::Triple::armeb: {
50  StringRef MArch, MCPU;
51  arm::getARMArchCPUFromArgs(Args, MArch, MCPU, /*FromAs*/ true);
52  std::string Arch = arm::getARMTargetCPU(MCPU, MArch, Triple);
53  CmdArgs.push_back(Args.MakeArgString("-mcpu=" + Arch));
54  break;
55  }
56 
57  case llvm::Triple::ppc:
58  CmdArgs.push_back("-mppc");
59  CmdArgs.push_back("-many");
60  break;
61 
62  case llvm::Triple::sparcv9: {
63  CmdArgs.push_back("-64");
64  std::string CPU = getCPUName(D, Args, Triple);
65  CmdArgs.push_back(sparc::getSparcAsmModeForCPU(CPU, Triple));
66  AddAssemblerKPIC(ToolChain, Args, CmdArgs);
67  break;
68  }
69 
70  case llvm::Triple::mips64:
71  case llvm::Triple::mips64el: {
72  StringRef CPUName;
73  StringRef ABIName;
74  mips::getMipsCPUAndABI(Args, Triple, CPUName, ABIName);
75 
76  CmdArgs.push_back("-march");
77  CmdArgs.push_back(CPUName.data());
78 
79  CmdArgs.push_back("-mabi");
80  CmdArgs.push_back(mips::getGnuCompatibleMipsABIName(ABIName).data());
81 
82  if (Triple.isLittleEndian())
83  CmdArgs.push_back("-EL");
84  else
85  CmdArgs.push_back("-EB");
86 
87  AddAssemblerKPIC(ToolChain, Args, CmdArgs);
88  break;
89  }
90 
91  default:
92  break;
93  }
94 
95  Args.AddAllArgValues(CmdArgs, options::OPT_Wa_COMMA, options::OPT_Xassembler);
96 
97  CmdArgs.push_back("-o");
98  CmdArgs.push_back(Output.getFilename());
99 
100  for (const auto &II : Inputs)
101  CmdArgs.push_back(II.getFilename());
102 
103  const char *Exec = Args.MakeArgString(ToolChain.GetProgramPath("as"));
104  C.addCommand(std::make_unique<Command>(JA, *this,
106  Exec, CmdArgs, Inputs, Output));
107 }
108 
110  const InputInfo &Output,
111  const InputInfoList &Inputs,
112  const ArgList &Args,
113  const char *LinkingOutput) const {
115  static_cast<const toolchains::OpenBSD &>(getToolChain());
116  const Driver &D = ToolChain.getDriver();
117  const llvm::Triple::ArchType Arch = ToolChain.getArch();
118  ArgStringList CmdArgs;
119 
120  // Silence warning for "clang -g foo.o -o foo"
121  Args.ClaimAllArgs(options::OPT_g_Group);
122  // and "clang -emit-llvm foo.o -o foo"
123  Args.ClaimAllArgs(options::OPT_emit_llvm);
124  // and for "clang -w foo.o -o foo". Other warning options are already
125  // handled somewhere else.
126  Args.ClaimAllArgs(options::OPT_w);
127 
128  if (!D.SysRoot.empty())
129  CmdArgs.push_back(Args.MakeArgString("--sysroot=" + D.SysRoot));
130 
131  if (Arch == llvm::Triple::mips64)
132  CmdArgs.push_back("-EB");
133  else if (Arch == llvm::Triple::mips64el)
134  CmdArgs.push_back("-EL");
135 
136  if (!Args.hasArg(options::OPT_nostdlib, options::OPT_shared)) {
137  CmdArgs.push_back("-e");
138  CmdArgs.push_back("__start");
139  }
140 
141  CmdArgs.push_back("--eh-frame-hdr");
142  if (Args.hasArg(options::OPT_static)) {
143  CmdArgs.push_back("-Bstatic");
144  } else {
145  if (Args.hasArg(options::OPT_rdynamic))
146  CmdArgs.push_back("-export-dynamic");
147  CmdArgs.push_back("-Bdynamic");
148  if (Args.hasArg(options::OPT_shared)) {
149  CmdArgs.push_back("-shared");
150  } else if (!Args.hasArg(options::OPT_r)) {
151  CmdArgs.push_back("-dynamic-linker");
152  CmdArgs.push_back("/usr/libexec/ld.so");
153  }
154  }
155 
156  if (Args.hasArg(options::OPT_pie))
157  CmdArgs.push_back("-pie");
158  if (Args.hasArg(options::OPT_nopie) || Args.hasArg(options::OPT_pg))
159  CmdArgs.push_back("-nopie");
160 
161  if (Arch == llvm::Triple::riscv64)
162  CmdArgs.push_back("-X");
163 
164  if (Output.isFilename()) {
165  CmdArgs.push_back("-o");
166  CmdArgs.push_back(Output.getFilename());
167  } else {
168  assert(Output.isNothing() && "Invalid output.");
169  }
170 
171  if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nostartfiles,
172  options::OPT_r)) {
173  const char *crt0 = nullptr;
174  const char *crtbegin = nullptr;
175  if (!Args.hasArg(options::OPT_shared)) {
176  if (Args.hasArg(options::OPT_pg))
177  crt0 = "gcrt0.o";
178  else if (Args.hasArg(options::OPT_static) &&
179  !Args.hasArg(options::OPT_nopie))
180  crt0 = "rcrt0.o";
181  else
182  crt0 = "crt0.o";
183  crtbegin = "crtbegin.o";
184  } else {
185  crtbegin = "crtbeginS.o";
186  }
187 
188  if (crt0)
189  CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath(crt0)));
190  CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath(crtbegin)));
191  }
192 
193  Args.AddAllArgs(CmdArgs, options::OPT_L);
194  ToolChain.AddFilePathLibArgs(Args, CmdArgs);
195  Args.AddAllArgs(CmdArgs, {options::OPT_T_Group, options::OPT_e,
196  options::OPT_s, options::OPT_t,
197  options::OPT_Z_Flag, options::OPT_r});
198 
199  bool NeedsSanitizerDeps = addSanitizerRuntimes(ToolChain, Args, CmdArgs);
200  bool NeedsXRayDeps = addXRayRuntime(ToolChain, Args, CmdArgs);
201  AddLinkerInputs(ToolChain, Inputs, Args, CmdArgs, JA);
202 
203  if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nodefaultlibs,
204  options::OPT_r)) {
205  // Use the static OpenMP runtime with -static-openmp
206  bool StaticOpenMP = Args.hasArg(options::OPT_static_openmp) &&
207  !Args.hasArg(options::OPT_static);
208  addOpenMPRuntime(CmdArgs, ToolChain, Args, StaticOpenMP);
209 
210  if (D.CCCIsCXX()) {
211  if (ToolChain.ShouldLinkCXXStdlib(Args))
212  ToolChain.AddCXXStdlibLibArgs(Args, CmdArgs);
213  if (Args.hasArg(options::OPT_pg))
214  CmdArgs.push_back("-lm_p");
215  else
216  CmdArgs.push_back("-lm");
217  }
218  if (NeedsSanitizerDeps) {
219  CmdArgs.push_back(ToolChain.getCompilerRTArgString(Args, "builtins"));
221  }
222  if (NeedsXRayDeps) {
223  CmdArgs.push_back(ToolChain.getCompilerRTArgString(Args, "builtins"));
224  linkXRayRuntimeDeps(ToolChain, CmdArgs);
225  }
226  // FIXME: For some reason GCC passes -lgcc before adding
227  // the default system libraries. Just mimic this for now.
228  CmdArgs.push_back("-lcompiler_rt");
229 
230  if (Args.hasArg(options::OPT_pthread)) {
231  if (!Args.hasArg(options::OPT_shared) && Args.hasArg(options::OPT_pg))
232  CmdArgs.push_back("-lpthread_p");
233  else
234  CmdArgs.push_back("-lpthread");
235  }
236 
237  if (!Args.hasArg(options::OPT_shared)) {
238  if (Args.hasArg(options::OPT_pg))
239  CmdArgs.push_back("-lc_p");
240  else
241  CmdArgs.push_back("-lc");
242  }
243 
244  CmdArgs.push_back("-lcompiler_rt");
245  }
246 
247  if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nostartfiles,
248  options::OPT_r)) {
249  const char *crtend = nullptr;
250  if (!Args.hasArg(options::OPT_shared))
251  crtend = "crtend.o";
252  else
253  crtend = "crtendS.o";
254 
255  CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath(crtend)));
256  }
257 
258  ToolChain.addProfileRTLibs(Args, CmdArgs);
259 
260  const char *Exec = Args.MakeArgString(ToolChain.GetLinkerPath());
261  C.addCommand(std::make_unique<Command>(JA, *this,
263  Exec, CmdArgs, Inputs, Output));
264 }
265 
266 SanitizerMask OpenBSD::getSupportedSanitizers() const {
267  const bool IsX86 = getTriple().getArch() == llvm::Triple::x86;
268  const bool IsX86_64 = getTriple().getArch() == llvm::Triple::x86_64;
269 
270  // For future use, only UBsan at the moment
272 
273  if (IsX86 || IsX86_64) {
274  Res |= SanitizerKind::Vptr;
275  Res |= SanitizerKind::Fuzzer;
276  Res |= SanitizerKind::FuzzerNoLink;
277  }
278 
279  return Res;
280 }
281 
282 /// OpenBSD - OpenBSD tool chain which can call as(1) and ld(1) directly.
283 
284 OpenBSD::OpenBSD(const Driver &D, const llvm::Triple &Triple,
285  const ArgList &Args)
286  : Generic_ELF(D, Triple, Args) {
287  getFilePaths().push_back(concat(getDriver().SysRoot, "/usr/lib"));
288 }
289 
291  const llvm::opt::ArgList &DriverArgs,
292  llvm::opt::ArgStringList &CC1Args) const {
293  const Driver &D = getDriver();
294 
295  if (DriverArgs.hasArg(clang::driver::options::OPT_nostdinc))
296  return;
297 
298  if (!DriverArgs.hasArg(options::OPT_nobuiltininc)) {
300  llvm::sys::path::append(Dir, "include");
301  addSystemInclude(DriverArgs, CC1Args, Dir.str());
302  }
303 
304  if (DriverArgs.hasArg(options::OPT_nostdlibinc))
305  return;
306 
307  // Check for configure-time C include directories.
308  StringRef CIncludeDirs(C_INCLUDE_DIRS);
309  if (CIncludeDirs != "") {
311  CIncludeDirs.split(dirs, ":");
312  for (StringRef dir : dirs) {
313  StringRef Prefix =
314  llvm::sys::path::is_absolute(dir) ? StringRef(D.SysRoot) : "";
315  addExternCSystemInclude(DriverArgs, CC1Args, Prefix + dir);
316  }
317  return;
318  }
319 
320  addExternCSystemInclude(DriverArgs, CC1Args,
321  concat(D.SysRoot, "/usr/include"));
322 }
323 
324 void OpenBSD::addLibCxxIncludePaths(const llvm::opt::ArgList &DriverArgs,
325  llvm::opt::ArgStringList &CC1Args) const {
326  addSystemInclude(DriverArgs, CC1Args,
327  concat(getDriver().SysRoot, "/usr/include/c++/v1"));
328 }
329 
330 void OpenBSD::AddCXXStdlibLibArgs(const ArgList &Args,
331  ArgStringList &CmdArgs) const {
332  bool Profiling = Args.hasArg(options::OPT_pg);
333 
334  CmdArgs.push_back(Profiling ? "-lc++_p" : "-lc++");
335  if (Args.hasArg(options::OPT_fexperimental_library))
336  CmdArgs.push_back("-lc++experimental");
337  CmdArgs.push_back(Profiling ? "-lc++abi_p" : "-lc++abi");
338  CmdArgs.push_back(Profiling ? "-lpthread_p" : "-lpthread");
339 }
340 
341 std::string OpenBSD::getCompilerRT(const ArgList &Args, StringRef Component,
342  FileType Type) const {
343  if (Component == "builtins") {
344  SmallString<128> Path(getDriver().SysRoot);
345  llvm::sys::path::append(Path, "/usr/lib/libcompiler_rt.a");
346  return std::string(Path.str());
347  }
348  SmallString<128> P(getDriver().ResourceDir);
349  std::string CRTBasename =
350  buildCompilerRTBasename(Args, Component, Type, /*AddArch=*/false);
351  llvm::sys::path::append(P, "lib", CRTBasename);
352  // Checks if this is the base system case which uses a different location.
353  if (getVFS().exists(P))
354  return std::string(P.str());
355  return ToolChain::getCompilerRT(Args, Component, Type);
356 }
357 
359  return new tools::openbsd::Assembler(*this);
360 }
361 
362 Tool *OpenBSD::buildLinker() const { return new tools::openbsd::Linker(*this); }
363 
364 bool OpenBSD::HasNativeLLVMSupport() const { return true; }
365 
367 OpenBSD::getDefaultUnwindTableLevel(const ArgList &Args) const {
368  switch (getArch()) {
369  case llvm::Triple::arm:
370  return UnwindTableLevel::None;
371  default:
373  }
374 }
clang::driver::tools::mips::getGnuCompatibleMipsABIName
StringRef getGnuCompatibleMipsABIName(StringRef ABI)
Definition: Mips.cpp:143
clang::driver::toolchains
Definition: AIX.h:55
Mips.h
clang::driver::toolchains::OpenBSD::addLibCxxIncludePaths
void addLibCxxIncludePaths(const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args) const override
Definition: OpenBSD.cpp:324
clang::driver::tools::AddAssemblerKPIC
void AddAssemblerKPIC(const ToolChain &ToolChain, const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs)
clang::driver::ToolChain::UnwindTableLevel::Asynchronous
@ Asynchronous
clang::driver::ToolChain::getCompilerRT
virtual std::string getCompilerRT(const llvm::opt::ArgList &Args, StringRef Component, FileType Type=ToolChain::FT_Static) const
Definition: ToolChain.cpp:516
clang::driver::ToolChain::getVFS
llvm::vfs::FileSystem & getVFS() const
Definition: ToolChain.cpp:99
string
string(SUBSTRING ${CMAKE_CURRENT_BINARY_DIR} 0 ${PATH_LIB_START} PATH_HEAD) string(SUBSTRING $
Definition: CMakeLists.txt:22
clang::driver::ToolChain::buildCompilerRTBasename
virtual std::string buildCompilerRTBasename(const llvm::opt::ArgList &Args, StringRef Component, FileType Type, bool AddArch) const
Definition: ToolChain.cpp:482
llvm::SmallVector
Definition: LLVM.h:38
clang::driver::ToolChain::UnwindTableLevel
UnwindTableLevel
Definition: ToolChain.h:111
clang::driver::ToolChain::GetProgramPath
std::string GetProgramPath(const char *Name) const
Definition: ToolChain.cpp:614
clang::driver::tools
Definition: AIX.h:17
clang::driver::ToolChain::getDriver
const Driver & getDriver() const
Definition: ToolChain.h:232
clang::driver::toolchains::OpenBSD::AddClangSystemIncludeArgs
void AddClangSystemIncludeArgs(const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args) const override
Add the clang cc1 arguments for system include paths.
Definition: OpenBSD.cpp:290
Sparc.h
clang::driver::tools::getCPUName
std::string getCPUName(const Driver &D, const llvm::opt::ArgList &Args, const llvm::Triple &T, bool FromAs=false)
clang::driver::ToolChain::GetFilePath
std::string GetFilePath(const char *Name) const
Definition: ToolChain.cpp:610
clang::driver::tools::openbsd::Assembler::ConstructJob
void ConstructJob(Compilation &C, const JobAction &JA, const InputInfo &Output, const InputInfoList &Inputs, const llvm::opt::ArgList &TCArgs, const char *LinkingOutput) const override
ConstructJob - Construct jobs to perform the action JA, writing to Output and with Inputs,...
Definition: OpenBSD.cpp:28
clang::driver::InputInfo
InputInfo - Wrapper for information about an input source.
Definition: InputInfo.h:22
clang::driver::toolchains::OpenBSD::getCompilerRT
std::string getCompilerRT(const llvm::opt::ArgList &Args, StringRef Component, FileType Type=ToolChain::FT_Static) const override
Definition: OpenBSD.cpp:341
clang::Type
The base class of the type hierarchy.
Definition: Type.h:1565
clang::driver::tools::AddLinkerInputs
void AddLinkerInputs(const ToolChain &TC, const InputInfoList &Inputs, const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs, const JobAction &JA)
clang::driver::ToolChain::getFilePaths
path_list & getFilePaths()
Definition: ToolChain.h:274
clang::driver::Tool
Tool - Information on a specific compilation tool.
Definition: Tool.h:32
clang::driver::toolchains::Generic_ELF
Definition: Gnu.h:363
clang::driver::tools::claimNoWarnArgs
void claimNoWarnArgs(const llvm::opt::ArgList &Args)
Options.h
clang::driver::InputInfo::isFilename
bool isFilename() const
Definition: InputInfo.h:75
clang::driver::ToolChain::concat
static std::string concat(StringRef Path, const Twine &A, const Twine &B="", const Twine &C="", const Twine &D="")
Definition: ToolChain.cpp:958
clang::driver::toolchains::OpenBSD::getDefaultUnwindTableLevel
UnwindTableLevel getDefaultUnwindTableLevel(const llvm::opt::ArgList &Args) const override
How detailed should the unwind tables be by default.
Definition: OpenBSD.cpp:367
llvm::opt
Definition: DiagnosticOptions.h:19
clang::driver::ResponseFileSupport::AtFileCurCP
static constexpr ResponseFileSupport AtFileCurCP()
Definition: Job.h:92
clang::driver::tools::openbsd::Linker
Definition: OpenBSD.h:36
clang::driver::InputInfo::isNothing
bool isNothing() const
Definition: InputInfo.h:74
llvm::SmallString< 128 >
clang::driver::ToolChain::getTriple
const llvm::Triple & getTriple() const
Definition: ToolChain.h:234
OpenBSD.h
clang::driver::Driver::SysRoot
std::string SysRoot
sysroot, if present
Definition: Driver.h:181
clang::driver::Driver::CCCIsCXX
bool CCCIsCXX() const
Whether the driver should follow g++ like behavior.
Definition: Driver.h:211
clang::driver::tools::openbsd::Linker::ConstructJob
void ConstructJob(Compilation &C, const JobAction &JA, const InputInfo &Output, const InputInfoList &Inputs, const llvm::opt::ArgList &TCArgs, const char *LinkingOutput) const override
ConstructJob - Construct jobs to perform the action JA, writing to Output and with Inputs,...
Definition: OpenBSD.cpp:109
clang::driver::tools::addXRayRuntime
bool addXRayRuntime(const ToolChain &TC, const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs)
SanitizerArgs.h
clang::driver::Driver::ResourceDir
std::string ResourceDir
The path to the compiler resource directory.
Definition: Driver.h:165
clang::driver::ToolChain::getArch
llvm::Triple::ArchType getArch() const
Definition: ToolChain.h:248
clang::driver::ToolChain::AddFilePathLibArgs
void AddFilePathLibArgs(const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs) const
AddFilePathLibArgs - Add each thing in getFilePaths() as a "-L" option.
Definition: ToolChain.cpp:1039
clang::driver::ToolChain::ShouldLinkCXXStdlib
bool ShouldLinkCXXStdlib(const llvm::opt::ArgList &Args) const
Returns if the C++ standard library should be linked in.
Definition: ToolChain.cpp:1014
clang::driver::tools::openbsd::Assembler
Definition: OpenBSD.h:23
P
StringRef P
Definition: ASTMatchersInternal.cpp:563
clang::driver::ToolChain::getSupportedSanitizers
virtual SanitizerMask getSupportedSanitizers() const
Return sanitizers which are available in this toolchain.
Definition: ToolChain.cpp:1082
clang::driver::ToolChain::UnwindTableLevel::None
@ None
clang::driver::ToolChain::AddCXXStdlibLibArgs
virtual void AddCXXStdlibLibArgs(const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs) const
AddCXXStdlibLibArgs - Add the system specific linker arguments to use for the given C++ standard libr...
Definition: ToolChain.cpp:1020
Compilation.h
clang::driver::ToolChain::addProfileRTLibs
virtual void addProfileRTLibs(const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs) const
addProfileRTLibs - When -fprofile-instr-profile is specified, try to pass a suitable profile runtime ...
Definition: ToolChain.cpp:823
clang::driver::ToolChain::getCompilerRTArgString
const char * getCompilerRTArgString(const llvm::opt::ArgList &Args, StringRef Component, FileType Type=ToolChain::FT_Static) const
Definition: ToolChain.cpp:537
clang::driver::ToolChain
ToolChain - Access to tools for a single platform.
Definition: ToolChain.h:91
clang::driver::ToolChain::GetLinkerPath
std::string GetLinkerPath(bool *LinkerIsLLD=nullptr) const
Returns the linker path, respecting the -fuse-ld= argument to determine the linker suffix or name.
Definition: ToolChain.cpp:618
clang::driver::tools::arm::getARMTargetCPU
std::string getARMTargetCPU(StringRef CPU, llvm::StringRef Arch, const llvm::Triple &Triple)
clang::driver::toolchains::OpenBSD::AddCXXStdlibLibArgs
void AddCXXStdlibLibArgs(const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs) const override
AddCXXStdlibLibArgs - Add the system specific linker arguments to use for the given C++ standard libr...
Definition: OpenBSD.cpp:330
clang::driver::Compilation
Compilation - A set of tasks to perform for a single driver invocation.
Definition: Compilation.h:45
clang::driver::tools::arm::getARMArchCPUFromArgs
void getARMArchCPUFromArgs(const llvm::opt::ArgList &Args, llvm::StringRef &Arch, llvm::StringRef &CPU, bool FromAs=false)
clang::driver::ToolChain::FileType
FileType
Definition: ToolChain.h:129
clang::driver::tools::addOpenMPRuntime
bool addOpenMPRuntime(llvm::opt::ArgStringList &CmdArgs, const ToolChain &TC, const llvm::opt::ArgList &Args, bool ForceStaticHostRuntime=false, bool IsOffloadingHost=false, bool GompNeedsRT=false)
Returns true, if an OpenMP runtime has been added.
clang::driver::InputInfo::getFilename
const char * getFilename() const
Definition: InputInfo.h:83
clang::driver::tools::mips::getMipsCPUAndABI
void getMipsCPUAndABI(const llvm::opt::ArgList &Args, const llvm::Triple &Triple, StringRef &CPUName, StringRef &ABIName)
clang::driver::tools::linkSanitizerRuntimeDeps
void linkSanitizerRuntimeDeps(const ToolChain &TC, llvm::opt::ArgStringList &CmdArgs)
CommonArgs.h
clang
Definition: CalledOnceCheck.h:17
clang::driver::Driver
Driver - Encapsulate logic for constructing compilation processes from a set of gcc-driver-like comma...
Definition: Driver.h:75
clang::driver::tools::addSanitizerRuntimes
bool addSanitizerRuntimes(const ToolChain &TC, const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs)
clang::driver::toolchains::OpenBSD::HasNativeLLVMSupport
bool HasNativeLLVMSupport() const override
HasNativeLTOLinker - Check whether the linker and related tools have native LLVM support.
Definition: OpenBSD.cpp:364
clang::driver::tools::linkXRayRuntimeDeps
void linkXRayRuntimeDeps(const ToolChain &TC, llvm::opt::ArgStringList &CmdArgs)
clang::driver::toolchains::OpenBSD::buildLinker
Tool * buildLinker() const override
Definition: OpenBSD.cpp:362
clang::driver::ToolChain::addExternCSystemInclude
static void addExternCSystemInclude(const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args, const Twine &Path)
Utility function to add a system include directory with extern "C" semantics to CC1 arguments.
Definition: ToolChain.cpp:934
ARM.h
clang::driver::toolchains::OpenBSD::buildAssembler
Tool * buildAssembler() const override
Definition: OpenBSD.cpp:358
clang::driver
Definition: Action.h:31
clang::driver::ToolChain::addSystemInclude
static void addSystemInclude(const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args, const Twine &Path)
Utility function to add a system include directory to CC1 arguments.
Definition: ToolChain.cpp:919
clang::driver::toolchains::OpenBSD
Definition: OpenBSD.h:53
clang::driver::JobAction
Definition: Action.h:398
clang::driver::tools::sparc::getSparcAsmModeForCPU
const char * getSparcAsmModeForCPU(llvm::StringRef Name, const llvm::Triple &Triple)
clang::SanitizerMask
Definition: Sanitizers.h:30