clang 10.0.0

FreeBSD.cpp
Go to the documentation of this file.
1 //===--- FreeBSD.cpp - FreeBSD 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 "FreeBSD.h"
10 #include "Arch/ARM.h"
11 #include "Arch/Mips.h"
12 #include "Arch/Sparc.h"
13 #include "CommonArgs.h"
14 #include "clang/Driver/Compilation.h"
15 #include "clang/Driver/DriverDiagnostic.h"
16 #include "clang/Driver/Options.h"
17 #include "clang/Driver/SanitizerArgs.h"
18 #include "llvm/Option/ArgList.h"
19 #include "llvm/Support/VirtualFileSystem.h"
20
21 using namespace clang::driver;
22 using namespace clang::driver::tools;
23 using namespace clang::driver::toolchains;
24 using namespace clang;
25 using namespace llvm::opt;
26
27 void freebsd::Assembler::ConstructJob(Compilation &C, const JobAction &JA,
28 const InputInfo &Output,
29 const InputInfoList &Inputs,
30 const ArgList &Args,
31 const char *LinkingOutput) const {
32 claimNoWarnArgs(Args);
33 ArgStringList CmdArgs;
34 const auto &D = getToolChain().getDriver();
35
36 // When building 32-bit code on FreeBSD/amd64, we have to explicitly
37 // instruct as in the base system to assemble 32-bit code.
38 switch (getToolChain().getArch()) {
39 default:
40 break;
41 case llvm::Triple::x86:
42 CmdArgs.push_back("--32");
43 break;
44 case llvm::Triple::ppc:
45 CmdArgs.push_back("-a32");
46 break;
47 case llvm::Triple::mips:
48 case llvm::Triple::mipsel:
49 case llvm::Triple::mips64:
50 case llvm::Triple::mips64el: {
51 StringRef CPUName;
52 StringRef ABIName;
53 mips::getMipsCPUAndABI(Args, getToolChain().getTriple(), CPUName, ABIName);
54
55 CmdArgs.push_back("-march");
56 CmdArgs.push_back(CPUName.data());
57
58 CmdArgs.push_back("-mabi");
59 CmdArgs.push_back(mips::getGnuCompatibleMipsABIName(ABIName).data());
60
61 if (getToolChain().getTriple().isLittleEndian())
62 CmdArgs.push_back("-EL");
63 else
64 CmdArgs.push_back("-EB");
65
66 if (Arg *A = Args.getLastArg(options::OPT_G)) {
67 StringRef v = A->getValue();
68 CmdArgs.push_back(Args.MakeArgString("-G" + v));
69 A->claim();
70 }
71
72 AddAssemblerKPIC(getToolChain(), Args, CmdArgs);
73 break;
74 }
75 case llvm::Triple::arm:
76 case llvm::Triple::armeb:
77 case llvm::Triple::thumb:
78 case llvm::Triple::thumbeb: {
79 arm::FloatABI ABI = arm::getARMFloatABI(getToolChain(), Args);
80
81 if (ABI == arm::FloatABI::Hard)
82 CmdArgs.push_back("-mfpu=vfp");
83 else
84 CmdArgs.push_back("-mfpu=softvfp");
85
86 switch (getToolChain().getTriple().getEnvironment()) {
87 case llvm::Triple::GNUEABIHF:
88 case llvm::Triple::GNUEABI:
89 case llvm::Triple::EABI:
90 CmdArgs.push_back("-meabi=5");
91 break;
92
93 default:
94 CmdArgs.push_back("-matpcs");
95 }
96 break;
97 }
98 case llvm::Triple::sparc:
99 case llvm::Triple::sparcel:
100 case llvm::Triple::sparcv9: {
101 std::string CPU = getCPUName(Args, getToolChain().getTriple());
102 CmdArgs.push_back(
103 sparc::getSparcAsmModeForCPU(CPU, getToolChain().getTriple()));
104 AddAssemblerKPIC(getToolChain(), Args, CmdArgs);
105 break;
106 }
107 }
108
109 for (const Arg *A : Args.filtered(options::OPT_ffile_prefix_map_EQ,
110 options::OPT_fdebug_prefix_map_EQ)) {
111 StringRef Map = A->getValue();
112 if (Map.find('=') == StringRef::npos)
113 D.Diag(diag::err_drv_invalid_argument_to_option)
114 << Map << A->getOption().getName();
115 else {
116 CmdArgs.push_back(Args.MakeArgString("--debug-prefix-map"));
117 CmdArgs.push_back(Args.MakeArgString(Map));
118 }
119 A->claim();
120 }
121
122 Args.AddAllArgValues(CmdArgs, options::OPT_Wa_COMMA, options::OPT_Xassembler);
123
124 CmdArgs.push_back("-o");
125 CmdArgs.push_back(Output.getFilename());
126
127 for (const auto &II : Inputs)
128 CmdArgs.push_back(II.getFilename());
129
130 const char *Exec = Args.MakeArgString(getToolChain().GetProgramPath("as"));
131 C.addCommand(std::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
132 }
133
134 void freebsd::Linker::ConstructJob(Compilation &C, const JobAction &JA,
135 const InputInfo &Output,
136 const InputInfoList &Inputs,
137 const ArgList &Args,
138 const char *LinkingOutput) const {
139 const toolchains::FreeBSD &ToolChain =
140 static_cast<const toolchains::FreeBSD &>(getToolChain());
141 const Driver &D = ToolChain.getDriver();
142 const llvm::Triple::ArchType Arch = ToolChain.getArch();
143 const bool IsPIE =
144 !Args.hasArg(options::OPT_shared) &&
145 (Args.hasArg(options::OPT_pie) || ToolChain.isPIEDefault());
146 ArgStringList CmdArgs;
147
148 // Silence warning for "clang -g foo.o -o foo"
149 Args.ClaimAllArgs(options::OPT_g_Group);
150 // and "clang -emit-llvm foo.o -o foo"
151 Args.ClaimAllArgs(options::OPT_emit_llvm);
152 // and for "clang -w foo.o -o foo". Other warning options are already
153 // handled somewhere else.
154 Args.ClaimAllArgs(options::OPT_w);
155
156 if (!D.SysRoot.empty())
157 CmdArgs.push_back(Args.MakeArgString("--sysroot=" + D.SysRoot));
158
159 if (IsPIE)
160 CmdArgs.push_back("-pie");
161
162 CmdArgs.push_back("--eh-frame-hdr");
163 if (Args.hasArg(options::OPT_static)) {
164 CmdArgs.push_back("-Bstatic");
165 } else {
166 if (Args.hasArg(options::OPT_rdynamic))
167 CmdArgs.push_back("-export-dynamic");
168 if (Args.hasArg(options::OPT_shared)) {
169 CmdArgs.push_back("-Bshareable");
170 } else {
171 CmdArgs.push_back("-dynamic-linker");
172 CmdArgs.push_back("/libexec/ld-elf.so.1");
173 }
174 const llvm::Triple &T = ToolChain.getTriple();
175 if (T.getOSMajorVersion() >= 9) {
176 if (Arch == llvm::Triple::arm || Arch == llvm::Triple::sparc || T.isX86())
177 CmdArgs.push_back("--hash-style=both");
178 }
179 CmdArgs.push_back("--enable-new-dtags");
180 }
181
182 // Explicitly set the linker emulation for platforms that might not
183 // be the default emulation for the linker.
184 switch (Arch) {
185 case llvm::Triple::x86:
186 CmdArgs.push_back("-m");
187 CmdArgs.push_back("elf_i386_fbsd");
188 break;
189 case llvm::Triple::ppc:
190 CmdArgs.push_back("-m");
191 CmdArgs.push_back("elf32ppc_fbsd");
192 break;
193 case llvm::Triple::mips:
194 CmdArgs.push_back("-m");
195 CmdArgs.push_back("elf32btsmip_fbsd");
196 break;
197 case llvm::Triple::mipsel:
198 CmdArgs.push_back("-m");
199 CmdArgs.push_back("elf32ltsmip_fbsd");
200 break;
201 case llvm::Triple::mips64:
202 CmdArgs.push_back("-m");
203 if (tools::mips::hasMipsAbiArg(Args, "n32"))
204 CmdArgs.push_back("elf32btsmipn32_fbsd");
205 else
206 CmdArgs.push_back("elf64btsmip_fbsd");
207 break;
208 case llvm::Triple::mips64el:
209 CmdArgs.push_back("-m");
210 if (tools::mips::hasMipsAbiArg(Args, "n32"))
211 CmdArgs.push_back("elf32ltsmipn32_fbsd");
212 else
213 CmdArgs.push_back("elf64ltsmip_fbsd");
214 break;
215 case llvm::Triple::riscv32:
216 CmdArgs.push_back("-m");
217 CmdArgs.push_back("elf32lriscv");
218 break;
219 case llvm::Triple::riscv64:
220 CmdArgs.push_back("-m");
221 CmdArgs.push_back("elf64lriscv");
222 break;
223 default:
224 break;
225 }
226
227 if (Arg *A = Args.getLastArg(options::OPT_G)) {
228 if (ToolChain.getTriple().isMIPS()) {
229 StringRef v = A->getValue();
230 CmdArgs.push_back(Args.MakeArgString("-G" + v));
231 A->claim();
232 }
233 }
234
235 if (Output.isFilename()) {
236 CmdArgs.push_back("-o");
237 CmdArgs.push_back(Output.getFilename());
238 } else {
239 assert(Output.isNothing() && "Invalid output.");
240 }
241
242 if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nostartfiles)) {
243 const char *crt1 = nullptr;
244 if (!Args.hasArg(options::OPT_shared)) {
245 if (Args.hasArg(options::OPT_pg))
246 crt1 = "gcrt1.o";
247 else if (IsPIE)
248 crt1 = "Scrt1.o";
249 else
250 crt1 = "crt1.o";
251 }
252 if (crt1)
253 CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath(crt1)));
254
255 CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath("crti.o")));
256
257 const char *crtbegin = nullptr;
258 if (Args.hasArg(options::OPT_static))
259 crtbegin = "crtbeginT.o";
260 else if (Args.hasArg(options::OPT_shared) || IsPIE)
261 crtbegin = "crtbeginS.o";
262 else
263 crtbegin = "crtbegin.o";
264
265 CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath(crtbegin)));
266 }
267
268 Args.AddAllArgs(CmdArgs, options::OPT_L);
269 ToolChain.AddFilePathLibArgs(Args, CmdArgs);
270 Args.AddAllArgs(CmdArgs, options::OPT_T_Group);
271 Args.AddAllArgs(CmdArgs, options::OPT_e);
272 Args.AddAllArgs(CmdArgs, options::OPT_s);
273 Args.AddAllArgs(CmdArgs, options::OPT_t);
274 Args.AddAllArgs(CmdArgs, options::OPT_Z_Flag);
275 Args.AddAllArgs(CmdArgs, options::OPT_r);
276
277 if (D.isUsingLTO()) {
278 assert(!Inputs.empty() && "Must have at least one input.");
279 AddGoldPlugin(ToolChain, Args, CmdArgs, Output, Inputs[0],
280 D.getLTOMode() == LTOK_Thin);
281 }
282
283 bool NeedsSanitizerDeps = addSanitizerRuntimes(ToolChain, Args, CmdArgs);
284 bool NeedsXRayDeps = addXRayRuntime(ToolChain, Args, CmdArgs);
285 AddLinkerInputs(ToolChain, Inputs, Args, CmdArgs, JA);
286
287 if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nodefaultlibs)) {
288 // Use the static OpenMP runtime with -static-openmp
289 bool StaticOpenMP = Args.hasArg(options::OPT_static_openmp) &&
290 !Args.hasArg(options::OPT_static);
291 addOpenMPRuntime(CmdArgs, ToolChain, Args, StaticOpenMP);
292
293 if (D.CCCIsCXX()) {
294 if (ToolChain.ShouldLinkCXXStdlib(Args))
295 ToolChain.AddCXXStdlibLibArgs(Args, CmdArgs);
296 if (Args.hasArg(options::OPT_pg))
297 CmdArgs.push_back("-lm_p");
298 else
299 CmdArgs.push_back("-lm");
300 }
301 if (NeedsSanitizerDeps)
302 linkSanitizerRuntimeDeps(ToolChain, CmdArgs);
303 if (NeedsXRayDeps)
304 linkXRayRuntimeDeps(ToolChain, CmdArgs);
305 // FIXME: For some reason GCC passes -lgcc and -lgcc_s before adding
306 // the default system libraries. Just mimic this for now.
307 if (Args.hasArg(options::OPT_pg))
308 CmdArgs.push_back("-lgcc_p");
309 else
310 CmdArgs.push_back("-lgcc");
311 if (Args.hasArg(options::OPT_static)) {
312 CmdArgs.push_back("-lgcc_eh");
313 } else if (Args.hasArg(options::OPT_pg)) {
314 CmdArgs.push_back("-lgcc_eh_p");
315 } else {
316 CmdArgs.push_back("--as-needed");
317 CmdArgs.push_back("-lgcc_s");
318 CmdArgs.push_back("--no-as-needed");
319 }
320
321 if (Args.hasArg(options::OPT_pthread)) {
322 if (Args.hasArg(options::OPT_pg))
323 CmdArgs.push_back("-lpthread_p");
324 else
325 CmdArgs.push_back("-lpthread");
326 }
327
328 if (Args.hasArg(options::OPT_pg)) {
329 if (Args.hasArg(options::OPT_shared))
330 CmdArgs.push_back("-lc");
331 else
332 CmdArgs.push_back("-lc_p");
333 CmdArgs.push_back("-lgcc_p");
334 } else {
335 CmdArgs.push_back("-lc");
336 CmdArgs.push_back("-lgcc");
337 }
338
339 if (Args.hasArg(options::OPT_static)) {
340 CmdArgs.push_back("-lgcc_eh");
341 } else if (Args.hasArg(options::OPT_pg)) {
342 CmdArgs.push_back("-lgcc_eh_p");
343 } else {
344 CmdArgs.push_back("--as-needed");
345 CmdArgs.push_back("-lgcc_s");
346 CmdArgs.push_back("--no-as-needed");
347 }
348 }
349
350 if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nostartfiles)) {
351 if (Args.hasArg(options::OPT_shared) || IsPIE)
352 CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath("crtendS.o")));
353 else
354 CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath("crtend.o")));
355 CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath("crtn.o")));
356 }
357
358 ToolChain.addProfileRTLibs(Args, CmdArgs);
359
360 const char *Exec = Args.MakeArgString(getToolChain().GetLinkerPath());
361 C.addCommand(std::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
362 }
363
364 /// FreeBSD - FreeBSD tool chain which can call as(1) and ld(1) directly.
365
366 FreeBSD::FreeBSD(const Driver &D, const llvm::Triple &Triple,
367 const ArgList &Args)
368 : Generic_ELF(D, Triple, Args) {
369
370 // When targeting 32-bit platforms, look for '/usr/lib32/crt1.o' and fall
371 // back to '/usr/lib' if it doesn't exist.
372 if ((Triple.getArch() == llvm::Triple::x86 || Triple.isMIPS32() ||
373 Triple.getArch() == llvm::Triple::ppc) &&
374 D.getVFS().exists(getDriver().SysRoot + "/usr/lib32/crt1.o"))
375 getFilePaths().push_back(getDriver().SysRoot + "/usr/lib32");
376 else
377 getFilePaths().push_back(getDriver().SysRoot + "/usr/lib");
378 }
379
380 ToolChain::CXXStdlibType FreeBSD::GetDefaultCXXStdlibType() const {
381 if (getTriple().getOSMajorVersion() >= 10)
382 return ToolChain::CST_Libcxx;
383 return ToolChain::CST_Libstdcxx;
384 }
385
386 unsigned FreeBSD::GetDefaultDwarfVersion() const {
387 if (getTriple().getOSMajorVersion() < 12)
388 return 2;
389 return 4;
390 }
391
392 void FreeBSD::addLibCxxIncludePaths(const llvm::opt::ArgList &DriverArgs,
393 llvm::opt::ArgStringList &CC1Args) const {
394 addSystemInclude(DriverArgs, CC1Args,
395 getDriver().SysRoot + "/usr/include/c++/v1");
396 }
397
398 void FreeBSD::addLibStdCxxIncludePaths(
399 const llvm::opt::ArgList &DriverArgs,
400 llvm::opt::ArgStringList &CC1Args) const {
401 addLibStdCXXIncludePaths(getDriver().SysRoot, "/usr/include/c++/4.2", "", "",
402 "", "", DriverArgs, CC1Args);
403 }
404
405 void FreeBSD::AddCXXStdlibLibArgs(const ArgList &Args,
406 ArgStringList &CmdArgs) const {
407 CXXStdlibType Type = GetCXXStdlibType(Args);
408 bool Profiling = Args.hasArg(options::OPT_pg);
409
410 switch (Type) {
411 case ToolChain::CST_Libcxx:
412 CmdArgs.push_back(Profiling ? "-lc++_p" : "-lc++");
413 break;
414
415 case ToolChain::CST_Libstdcxx:
416 CmdArgs.push_back(Profiling ? "-lstdc++_p" : "-lstdc++");
417 break;
418 }
419 }
420
421 void FreeBSD::AddCudaIncludeArgs(const ArgList &DriverArgs,
422 ArgStringList &CC1Args) const {
423 CudaInstallation.AddCudaIncludeArgs(DriverArgs, CC1Args);
424 }
425
426 Tool *FreeBSD::buildAssembler() const {
427 return new tools::freebsd::Assembler(*this);
428 }
429
430 Tool *FreeBSD::buildLinker() const { return new tools::freebsd::Linker(*this); }
431
432 llvm::ExceptionHandling FreeBSD::GetExceptionModel(const ArgList &Args) const {
433 // FreeBSD uses SjLj exceptions on ARM oabi.
434 switch (getTriple().getEnvironment()) {
435 case llvm::Triple::GNUEABIHF:
436 case llvm::Triple::GNUEABI:
437 case llvm::Triple::EABI:
438 return llvm::ExceptionHandling::None;
439 default:
440 if (getTriple().getArch() == llvm::Triple::arm ||
441 getTriple().getArch() == llvm::Triple::thumb)
442 return llvm::ExceptionHandling::SjLj;
443 return llvm::ExceptionHandling::None;
444 }
445 }
446
447 bool FreeBSD::HasNativeLLVMSupport() const { return true; }
448
449 bool FreeBSD::IsUnwindTablesDefault(const ArgList &Args) const { return true; }
450
451 bool FreeBSD::isPIEDefault() const { return getSanitizerArgs().requiresPIE(); }
452
453 SanitizerMask FreeBSD::getSupportedSanitizers() const {
454 const bool IsX86 = getTriple().getArch() == llvm::Triple::x86;
455 const bool IsX86_64 = getTriple().getArch() == llvm::Triple::x86_64;
456 const bool IsMIPS64 = getTriple().isMIPS64();
457 SanitizerMask Res = ToolChain::getSupportedSanitizers();
458 Res |= SanitizerKind::Address;
459 Res |= SanitizerKind::PointerCompare;
460 Res |= SanitizerKind::PointerSubtract;
461 Res |= SanitizerKind::Vptr;
462 if (IsX86_64 || IsMIPS64) {
463 Res |= SanitizerKind::Leak;
464 Res |= SanitizerKind::Thread;
465 }
466 if (IsX86 || IsX86_64) {
467 Res |= SanitizerKind::Function;
468 Res |= SanitizerKind::SafeStack;
469 Res |= SanitizerKind::Fuzzer;
470 Res |= SanitizerKind::FuzzerNoLink;
471 }
472 if (IsX86_64)
473 Res |= SanitizerKind::Memory;
474 return Res;
475 }
476
477 void FreeBSD::addClangTargetOptions(const ArgList &DriverArgs,
478 ArgStringList &CC1Args,
479 Action::OffloadKind) const {
480 if (!DriverArgs.hasFlag(options::OPT_fuse_init_array,
481 options::OPT_fno_use_init_array,
482 getTriple().getOSMajorVersion() >= 12))
483 CC1Args.push_back("-fno-use-init-array");
484 }
clang::driver::toolchains::FreeBSD::HasNativeLLVMSupport
bool HasNativeLLVMSupport() const override
HasNativeLTOLinker - Check whether the linker and related tools have native LLVM support.
Definition: FreeBSD.cpp:447
clang::driver::tools::addXRayRuntime
bool addXRayRuntime(const ToolChain &TC, const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs)
clang::driver::tools::sparc::getSparcAsmModeForCPU
const char * getSparcAsmModeForCPU(llvm::StringRef Name, const llvm::Triple &Triple)
clang::driver::toolchains::FreeBSD::GetDefaultCXXStdlibType
CXXStdlibType GetDefaultCXXStdlibType() const override
Definition: FreeBSD.cpp:380
FreeBSD.h
clang::driver::Driver::isUsingLTO
bool isUsingLTO() const
Returns true if we are performing any kind of LTO.
Definition: Driver.h:554
clang::Type
The base class of the type hierarchy.
Definition: Type.h:1450
clang::XRayInstrKind::Function
constexpr XRayInstrMask Function
Definition: XRayInstr.h:38
clang::driver::Driver::getLTOMode
LTOKind getLTOMode() const
Get the specific kind of LTO being performed.
Definition: Driver.h:557
clang::driver::tools::freebsd::Assembler
Definition: FreeBSD.h:22
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:748
clang::driver::toolchains::FreeBSD::IsUnwindTablesDefault
bool IsUnwindTablesDefault(const llvm::opt::ArgList &Args) const override
IsUnwindTablesDefault - Does this tool chain use -funwind-tables by default.
Definition: FreeBSD.cpp:449
clang::driver::tools::arm::getARMFloatABI
FloatABI getARMFloatABI(const ToolChain &TC, const llvm::opt::ArgList &Args)
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::ToolChain::CXXStdlibType
CXXStdlibType
Definition: ToolChain.h:92
clang::driver::tools::getCPUName
std::string getCPUName(const llvm::opt::ArgList &Args, const llvm::Triple &T, bool FromAs=false)
clang::driver::tools::freebsd::Linker
Definition: FreeBSD.h:35
clang::driver::InputInfo::getFilename
const char * getFilename() const
Definition: InputInfo.h:83
SanitizerArgs.h
CommonArgs.h
clang::driver::tools::linkSanitizerRuntimeDeps
void linkSanitizerRuntimeDeps(const ToolChain &TC, llvm::opt::ArgStringList &CmdArgs)
clang::driver::JobAction
Definition: Action.h:375
clang::driver::tools::AddGoldPlugin
void AddGoldPlugin(const ToolChain &ToolChain, const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs, const InputInfo &Output, const InputInfo &Input, bool IsThinLTO)
clang::driver::ToolChain::CST_Libcxx
Definition: ToolChain.h:93
clang::driver::tools::addSanitizerRuntimes
bool addSanitizerRuntimes(const ToolChain &TC, const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs)
clang::driver::tools
Definition: AIX.h:17
Sparc.h
clang::driver::InputInfo
InputInfo - Wrapper for information about an input source.
Definition: InputInfo.h:22
clang::driver::ToolChain::GetFilePath
std::string GetFilePath(const char *Name) const
Definition: ToolChain.cpp:512
clang::driver::ToolChain::getFilePaths
path_list & getFilePaths()
Definition: ToolChain.h:237
clang::driver::Driver
Driver - Encapsulate logic for constructing compilation processes from a set of gcc-driver-like comma...
Definition: Driver.h:59
clang::driver::toolchains::FreeBSD::addClangTargetOptions
void addClangTargetOptions(const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args, Action::OffloadKind DeviceOffloadKind) const override
Add options that need to be passed to cc1 for this target.
Definition: FreeBSD.cpp:477
clang::driver::tools::mips::hasMipsAbiArg
bool hasMipsAbiArg(const llvm::opt::ArgList &Args, const char *Value)
ARM.h
clang::driver::toolchains::FreeBSD
Definition: FreeBSD.h:52
clang::driver::toolchains::FreeBSD::buildLinker
Tool * buildLinker() const override
Definition: FreeBSD.cpp:430
clang::driver::tools::arm::FloatABI
FloatABI
Definition: ARM.h:43
Compilation.h
clang::driver::Driver::getVFS
llvm::vfs::FileSystem & getVFS() const
Definition: Driver.h:319
clang::driver::tools::linkXRayRuntimeDeps
void linkXRayRuntimeDeps(const ToolChain &TC, llvm::opt::ArgStringList &CmdArgs)
clang::driver::toolchains::Generic_GCC::CudaInstallation
CudaInstallationDetector CudaInstallation
Definition: Gnu.h:280
clang::driver::toolchains::Generic_ELF
Definition: Gnu.h:348
clang::driver::tools::arm::FloatABI::Hard
llvm::opt
Definition: Action.h:23
clang::driver::toolchains::FreeBSD::buildAssembler
Tool * buildAssembler() const override
Definition: FreeBSD.cpp:426
clang::driver::Compilation::addCommand
void addCommand(std::unique_ptr< Command > C)
Definition: Compilation.h:205
v
do v
Definition: arm_acle.h:64
clang::driver::tools::AddAssemblerKPIC
void AddAssemblerKPIC(const ToolChain &ToolChain, const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs)
clang::driver::ToolChain::getArch
llvm::Triple::ArchType getArch() const
Definition: ToolChain.h:215
clang::driver::CudaInstallationDetector::AddCudaIncludeArgs
void AddCudaIncludeArgs(const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args) const
Definition: Cuda.cpp:224
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:906
clang::driver::toolchains::FreeBSD::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: FreeBSD.cpp:405
clang::driver::ToolChain::getDriver
const Driver & getDriver() const
Definition: ToolChain.h:199
clang::driver::Driver::CCCIsCXX
bool CCCIsCXX() const
Whether the driver should follow g++ like behavior.
Definition: Driver.h:173
clang::driver::toolchains::FreeBSD::AddCudaIncludeArgs
void AddCudaIncludeArgs(const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args) const override
Add arguments to use system-specific CUDA includes.
Definition: FreeBSD.cpp:421
clang::SanitizerMask
Definition: Sanitizers.h:29
llvm::SmallVector
Definition: LLVM.h:35
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:820
Options.h
clang::driver::toolchains::FreeBSD::isPIEDefault
bool isPIEDefault() const override
Test whether this toolchain defaults to PIE.
Definition: FreeBSD.cpp:451
clang::XRayInstrKind::None
constexpr XRayInstrMask None
Definition: XRayInstr.h:37
clang::driver::Action::OffloadKind
OffloadKind
Definition: Action.h:84
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:883
clang
Dataflow Directional Tag Classes.
Definition: CFGReachabilityAnalysis.h:21
Mips.h
clang::driver::LTOK_Thin
Definition: Driver.h:53
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::Driver::SysRoot
std::string SysRoot
sysroot, if present
Definition: Driver.h:148
clang::driver::Tool
Tool - Information on a specific compilation tool.
Definition: Tool.h:33
clang::driver::toolchains::FreeBSD::addLibCxxIncludePaths
void addLibCxxIncludePaths(const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args) const override
Definition: FreeBSD.cpp:392
clang::driver::SanitizerArgs::requiresPIE
bool requiresPIE() const
Definition: SanitizerArgs.cpp:229
clang::driver::toolchains::FreeBSD::GetDefaultDwarfVersion
unsigned GetDefaultDwarfVersion() const override
Definition: FreeBSD.cpp:386
clang::driver::ToolChain::getSanitizerArgs
const SanitizerArgs & getSanitizerArgs() const
Definition: ToolChain.cpp:117
clang::driver::tools::claimNoWarnArgs
void claimNoWarnArgs(const llvm::opt::ArgList &Args)
clang::driver::Compilation
Compilation - A set of tasks to perform for a single driver invocation.
Definition: Compilation.h:45
clang::driver::ToolChain::getTriple
const llvm::Triple & getTriple() const
Definition: ToolChain.h:201
clang::driver::toolchains::FreeBSD::GetExceptionModel
llvm::ExceptionHandling GetExceptionModel(const llvm::opt::ArgList &Args) const override
GetExceptionModel - Return the tool chain exception model.
Definition: FreeBSD.cpp:432
clang::driver
Definition: Action.h:31
clang::driver::ToolChain::getSupportedSanitizers
virtual SanitizerMask getSupportedSanitizers() const
Return sanitizers which are available in this toolchain.
Definition: ToolChain.cpp:942
DriverDiagnostic.h
clang::driver::tools::mips::getGnuCompatibleMipsABIName
StringRef getGnuCompatibleMipsABIName(StringRef ABI)
Definition: Mips.cpp:143
clang::driver::toolchains::FreeBSD::addLibStdCxxIncludePaths
void addLibStdCxxIncludePaths(const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args) const override
Definition: FreeBSD.cpp:398
clang::driver::toolchains
Definition: AIX.h:55
clang::driver::InputInfo::isNothing
bool isNothing() const
Definition: InputInfo.h:74
clang::driver::InputInfo::isFilename
bool isFilename() const
Definition: InputInfo.h:75
clang::driver::ToolChain::GetCXXStdlibType
virtual CXXStdlibType GetCXXStdlibType(const llvm::opt::ArgList &Args) const
Definition: ToolChain.cpp:801
clang::driver::toolchains::FreeBSD::getSupportedSanitizers
SanitizerMask getSupportedSanitizers() const override
Return sanitizers which are available in this toolchain.
Definition: FreeBSD.cpp:453
clang::driver::toolchains::Generic_GCC::addLibStdCXXIncludePaths
bool addLibStdCXXIncludePaths(Twine Base, Twine Suffix, StringRef GCCTriple, StringRef GCCMultiarchTriple, StringRef TargetMultiarchTriple, Twine IncludeSuffix, const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args) const
Helper to add the variant paths of a libstdc++ installation.
Definition: Gnu.cpp:2732
clang::driver::tools::mips::getMipsCPUAndABI
void getMipsCPUAndABI(const llvm::opt::ArgList &Args, const llvm::Triple &Triple, StringRef &CPUName, StringRef &ABIName)
clang::driver::ToolChain::CST_Libstdcxx
Definition: ToolChain.h:94
clang::driver::tools::freebsd::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: FreeBSD.cpp:27
clang::driver::ToolChain
ToolChain - Access to tools for a single platform.
Definition: ToolChain.h:88
clang::driver::tools::freebsd::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: FreeBSD.cpp:134