clang 10.0.0git

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(sparc::getSparcAsmModeForCPU(CPU, getToolChain().getTriple()));
103 AddAssemblerKPIC(getToolChain(), Args, CmdArgs);
104 break;
105 }
106 }
107
108 for (const Arg *A : Args.filtered(options::OPT_ffile_prefix_map_EQ,
109 options::OPT_fdebug_prefix_map_EQ)) {
110 StringRef Map = A->getValue();
111 if (Map.find('=') == StringRef::npos)
112 D.Diag(diag::err_drv_invalid_argument_to_option)
113 << Map << A->getOption().getName();
114 else {
115 CmdArgs.push_back(Args.MakeArgString("--debug-prefix-map"));
116 CmdArgs.push_back(Args.MakeArgString(Map));
117 }
118 A->claim();
119 }
120
121 Args.AddAllArgValues(CmdArgs, options::OPT_Wa_COMMA, options::OPT_Xassembler);
122
123 CmdArgs.push_back("-o");
124 CmdArgs.push_back(Output.getFilename());
125
126 for (const auto &II : Inputs)
127 CmdArgs.push_back(II.getFilename());
128
129 const char *Exec = Args.MakeArgString(getToolChain().GetProgramPath("as"));
130 C.addCommand(std::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
131 }
132
133 void freebsd::Linker::ConstructJob(Compilation &C, const JobAction &JA,
134 const InputInfo &Output,
135 const InputInfoList &Inputs,
136 const ArgList &Args,
137 const char *LinkingOutput) const {
138 const toolchains::FreeBSD &ToolChain =
139 static_cast<const toolchains::FreeBSD &>(getToolChain());
140 const Driver &D = ToolChain.getDriver();
141 const llvm::Triple::ArchType Arch = ToolChain.getArch();
142 const bool IsPIE =
143 !Args.hasArg(options::OPT_shared) &&
144 (Args.hasArg(options::OPT_pie) || ToolChain.isPIEDefault());
145 ArgStringList CmdArgs;
146
147 // Silence warning for "clang -g foo.o -o foo"
148 Args.ClaimAllArgs(options::OPT_g_Group);
149 // and "clang -emit-llvm foo.o -o foo"
150 Args.ClaimAllArgs(options::OPT_emit_llvm);
151 // and for "clang -w foo.o -o foo". Other warning options are already
152 // handled somewhere else.
153 Args.ClaimAllArgs(options::OPT_w);
154
155 if (!D.SysRoot.empty())
156 CmdArgs.push_back(Args.MakeArgString("--sysroot=" + D.SysRoot));
157
158 if (IsPIE)
159 CmdArgs.push_back("-pie");
160
161 CmdArgs.push_back("--eh-frame-hdr");
162 if (Args.hasArg(options::OPT_static)) {
163 CmdArgs.push_back("-Bstatic");
164 } else {
165 if (Args.hasArg(options::OPT_rdynamic))
166 CmdArgs.push_back("-export-dynamic");
167 if (Args.hasArg(options::OPT_shared)) {
168 CmdArgs.push_back("-Bshareable");
169 } else {
170 CmdArgs.push_back("-dynamic-linker");
171 CmdArgs.push_back("/libexec/ld-elf.so.1");
172 }
173 const llvm::Triple &T = ToolChain.getTriple();
174 if (T.getOSMajorVersion() >= 9) {
175 if (Arch == llvm::Triple::arm || Arch == llvm::Triple::sparc || T.isX86())
176 CmdArgs.push_back("--hash-style=both");
177 }
178 CmdArgs.push_back("--enable-new-dtags");
179 }
180
181 // Explicitly set the linker emulation for platforms that might not
182 // be the default emulation for the linker.
183 switch (Arch) {
184 case llvm::Triple::x86:
185 CmdArgs.push_back("-m");
186 CmdArgs.push_back("elf_i386_fbsd");
187 break;
188 case llvm::Triple::ppc:
189 CmdArgs.push_back("-m");
190 CmdArgs.push_back("elf32ppc_fbsd");
191 break;
192 case llvm::Triple::mips:
193 CmdArgs.push_back("-m");
194 CmdArgs.push_back("elf32btsmip_fbsd");
195 break;
196 case llvm::Triple::mipsel:
197 CmdArgs.push_back("-m");
198 CmdArgs.push_back("elf32ltsmip_fbsd");
199 break;
200 case llvm::Triple::mips64:
201 CmdArgs.push_back("-m");
202 if (tools::mips::hasMipsAbiArg(Args, "n32"))
203 CmdArgs.push_back("elf32btsmipn32_fbsd");
204 else
205 CmdArgs.push_back("elf64btsmip_fbsd");
206 break;
207 case llvm::Triple::mips64el:
208 CmdArgs.push_back("-m");
209 if (tools::mips::hasMipsAbiArg(Args, "n32"))
210 CmdArgs.push_back("elf32ltsmipn32_fbsd");
211 else
212 CmdArgs.push_back("elf64ltsmip_fbsd");
213 break;
214 case llvm::Triple::riscv32:
215 CmdArgs.push_back("-m");
216 CmdArgs.push_back("elf32lriscv");
217 break;
218 case llvm::Triple::riscv64:
219 CmdArgs.push_back("-m");
220 CmdArgs.push_back("elf64lriscv");
221 break;
222 default:
223 break;
224 }
225
226 if (Arg *A = Args.getLastArg(options::OPT_G)) {
227 if (ToolChain.getTriple().isMIPS()) {
228 StringRef v = A->getValue();
229 CmdArgs.push_back(Args.MakeArgString("-G" + v));
230 A->claim();
231 }
232 }
233
234 if (Output.isFilename()) {
235 CmdArgs.push_back("-o");
236 CmdArgs.push_back(Output.getFilename());
237 } else {
238 assert(Output.isNothing() && "Invalid output.");
239 }
240
241 if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nostartfiles)) {
242 const char *crt1 = nullptr;
243 if (!Args.hasArg(options::OPT_shared)) {
244 if (Args.hasArg(options::OPT_pg))
245 crt1 = "gcrt1.o";
246 else if (IsPIE)
247 crt1 = "Scrt1.o";
248 else
249 crt1 = "crt1.o";
250 }
251 if (crt1)
252 CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath(crt1)));
253
254 CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath("crti.o")));
255
256 const char *crtbegin = nullptr;
257 if (Args.hasArg(options::OPT_static))
258 crtbegin = "crtbeginT.o";
259 else if (Args.hasArg(options::OPT_shared) || IsPIE)
260 crtbegin = "crtbeginS.o";
261 else
262 crtbegin = "crtbegin.o";
263
264 CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath(crtbegin)));
265 }
266
267 Args.AddAllArgs(CmdArgs, options::OPT_L);
268 ToolChain.AddFilePathLibArgs(Args, CmdArgs);
269 Args.AddAllArgs(CmdArgs, options::OPT_T_Group);
270 Args.AddAllArgs(CmdArgs, options::OPT_e);
271 Args.AddAllArgs(CmdArgs, options::OPT_s);
272 Args.AddAllArgs(CmdArgs, options::OPT_t);
273 Args.AddAllArgs(CmdArgs, options::OPT_Z_Flag);
274 Args.AddAllArgs(CmdArgs, options::OPT_r);
275
276 if (D.isUsingLTO()) {
277 assert(!Inputs.empty() && "Must have at least one input.");
278 AddGoldPlugin(ToolChain, Args, CmdArgs, Output, Inputs[0],
279 D.getLTOMode() == LTOK_Thin);
280 }
281
282 bool NeedsSanitizerDeps = addSanitizerRuntimes(ToolChain, Args, CmdArgs);
283 bool NeedsXRayDeps = addXRayRuntime(ToolChain, Args, CmdArgs);
284 AddLinkerInputs(ToolChain, Inputs, Args, CmdArgs, JA);
285
286 if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nodefaultlibs)) {
287 // Use the static OpenMP runtime with -static-openmp
288 bool StaticOpenMP = Args.hasArg(options::OPT_static_openmp) &&
289 !Args.hasArg(options::OPT_static);
290 addOpenMPRuntime(CmdArgs, ToolChain, Args, StaticOpenMP);
291
292 if (D.CCCIsCXX()) {
293 if (ToolChain.ShouldLinkCXXStdlib(Args))
294 ToolChain.AddCXXStdlibLibArgs(Args, CmdArgs);
295 if (Args.hasArg(options::OPT_pg))
296 CmdArgs.push_back("-lm_p");
297 else
298 CmdArgs.push_back("-lm");
299 }
300 if (NeedsSanitizerDeps)
301 linkSanitizerRuntimeDeps(ToolChain, CmdArgs);
302 if (NeedsXRayDeps)
303 linkXRayRuntimeDeps(ToolChain, CmdArgs);
304 // FIXME: For some reason GCC passes -lgcc and -lgcc_s before adding
305 // the default system libraries. Just mimic this for now.
306 if (Args.hasArg(options::OPT_pg))
307 CmdArgs.push_back("-lgcc_p");
308 else
309 CmdArgs.push_back("-lgcc");
310 if (Args.hasArg(options::OPT_static)) {
311 CmdArgs.push_back("-lgcc_eh");
312 } else if (Args.hasArg(options::OPT_pg)) {
313 CmdArgs.push_back("-lgcc_eh_p");
314 } else {
315 CmdArgs.push_back("--as-needed");
316 CmdArgs.push_back("-lgcc_s");
317 CmdArgs.push_back("--no-as-needed");
318 }
319
320 if (Args.hasArg(options::OPT_pthread)) {
321 if (Args.hasArg(options::OPT_pg))
322 CmdArgs.push_back("-lpthread_p");
323 else
324 CmdArgs.push_back("-lpthread");
325 }
326
327 if (Args.hasArg(options::OPT_pg)) {
328 if (Args.hasArg(options::OPT_shared))
329 CmdArgs.push_back("-lc");
330 else
331 CmdArgs.push_back("-lc_p");
332 CmdArgs.push_back("-lgcc_p");
333 } else {
334 CmdArgs.push_back("-lc");
335 CmdArgs.push_back("-lgcc");
336 }
337
338 if (Args.hasArg(options::OPT_static)) {
339 CmdArgs.push_back("-lgcc_eh");
340 } else if (Args.hasArg(options::OPT_pg)) {
341 CmdArgs.push_back("-lgcc_eh_p");
342 } else {
343 CmdArgs.push_back("--as-needed");
344 CmdArgs.push_back("-lgcc_s");
345 CmdArgs.push_back("--no-as-needed");
346 }
347 }
348
349 if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nostartfiles)) {
350 if (Args.hasArg(options::OPT_shared) || IsPIE)
351 CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath("crtendS.o")));
352 else
353 CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath("crtend.o")));
354 CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath("crtn.o")));
355 }
356
357 ToolChain.addProfileRTLibs(Args, CmdArgs);
358
359 const char *Exec = Args.MakeArgString(getToolChain().GetLinkerPath());
360 C.addCommand(std::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
361 }
362
363 /// FreeBSD - FreeBSD tool chain which can call as(1) and ld(1) directly.
364
365 FreeBSD::FreeBSD(const Driver &D, const llvm::Triple &Triple,
366 const ArgList &Args)
367 : Generic_ELF(D, Triple, Args) {
368
369 // When targeting 32-bit platforms, look for '/usr/lib32/crt1.o' and fall
370 // back to '/usr/lib' if it doesn't exist.
371 if ((Triple.getArch() == llvm::Triple::x86 || Triple.isMIPS32() ||
372 Triple.getArch() == llvm::Triple::ppc) &&
373 D.getVFS().exists(getDriver().SysRoot + "/usr/lib32/crt1.o"))
374 getFilePaths().push_back(getDriver().SysRoot + "/usr/lib32");
375 else
376 getFilePaths().push_back(getDriver().SysRoot + "/usr/lib");
377 }
378
379 ToolChain::CXXStdlibType FreeBSD::GetDefaultCXXStdlibType() const {
380 if (getTriple().getOSMajorVersion() >= 10)
381 return ToolChain::CST_Libcxx;
382 return ToolChain::CST_Libstdcxx;
383 }
384
385 unsigned FreeBSD::GetDefaultDwarfVersion() const {
386 if (getTriple().getOSMajorVersion() < 12)
387 return 2;
388 return 4;
389 }
390
391 void FreeBSD::addLibStdCxxIncludePaths(
392 const llvm::opt::ArgList &DriverArgs,
393 llvm::opt::ArgStringList &CC1Args) const {
394 addLibStdCXXIncludePaths(getDriver().SysRoot, "/usr/include/c++/4.2", "", "",
395 "", "", DriverArgs, CC1Args);
396 }
397
398 void FreeBSD::AddCXXStdlibLibArgs(const ArgList &Args,
399 ArgStringList &CmdArgs) const {
400 CXXStdlibType Type = GetCXXStdlibType(Args);
401 bool Profiling = Args.hasArg(options::OPT_pg);
402
403 switch (Type) {
404 case ToolChain::CST_Libcxx:
405 CmdArgs.push_back(Profiling ? "-lc++_p" : "-lc++");
406 break;
407
408 case ToolChain::CST_Libstdcxx:
409 CmdArgs.push_back(Profiling ? "-lstdc++_p" : "-lstdc++");
410 break;
411 }
412 }
413
414 void FreeBSD::AddCudaIncludeArgs(const ArgList &DriverArgs,
415 ArgStringList &CC1Args) const {
416 CudaInstallation.AddCudaIncludeArgs(DriverArgs, CC1Args);
417 }
418
419 Tool *FreeBSD::buildAssembler() const {
420 return new tools::freebsd::Assembler(*this);
421 }
422
423 Tool *FreeBSD::buildLinker() const { return new tools::freebsd::Linker(*this); }
424
425 llvm::ExceptionHandling FreeBSD::GetExceptionModel(const ArgList &Args) const {
426 // FreeBSD uses SjLj exceptions on ARM oabi.
427 switch (getTriple().getEnvironment()) {
428 case llvm::Triple::GNUEABIHF:
429 case llvm::Triple::GNUEABI:
430 case llvm::Triple::EABI:
431 return llvm::ExceptionHandling::None;
432 default:
433 if (getTriple().getArch() == llvm::Triple::arm ||
434 getTriple().getArch() == llvm::Triple::thumb)
435 return llvm::ExceptionHandling::SjLj;
436 return llvm::ExceptionHandling::None;
437 }
438 }
439
440 bool FreeBSD::HasNativeLLVMSupport() const { return true; }
441
442 bool FreeBSD::IsUnwindTablesDefault(const ArgList &Args) const { return true; }
443
444 bool FreeBSD::isPIEDefault() const { return getSanitizerArgs().requiresPIE(); }
445
446 SanitizerMask FreeBSD::getSupportedSanitizers() const {
447 const bool IsX86 = getTriple().getArch() == llvm::Triple::x86;
448 const bool IsX86_64 = getTriple().getArch() == llvm::Triple::x86_64;
449 const bool IsMIPS64 = getTriple().isMIPS64();
450 SanitizerMask Res = ToolChain::getSupportedSanitizers();
451 Res |= SanitizerKind::Address;
452 Res |= SanitizerKind::PointerCompare;
453 Res |= SanitizerKind::PointerSubtract;
454 Res |= SanitizerKind::Vptr;
455 if (IsX86_64 || IsMIPS64) {
456 Res |= SanitizerKind::Leak;
457 Res |= SanitizerKind::Thread;
458 }
459 if (IsX86 || IsX86_64) {
460 Res |= SanitizerKind::Function;
461 Res |= SanitizerKind::SafeStack;
462 Res |= SanitizerKind::Fuzzer;
463 Res |= SanitizerKind::FuzzerNoLink;
464 }
465 if (IsX86_64)
466 Res |= SanitizerKind::Memory;
467 return Res;
468 }
469
470 void FreeBSD::addClangTargetOptions(const ArgList &DriverArgs,
471 ArgStringList &CC1Args,
472 Action::OffloadKind) const {
473 if (!DriverArgs.hasFlag(options::OPT_fuse_init_array,
474 options::OPT_fno_use_init_array,
475 getTriple().getOSMajorVersion() >= 12))
476 CC1Args.push_back("-fno-use-init-array");
477 }
clang::driver::toolchains::FreeBSD::HasNativeLLVMSupport
bool HasNativeLLVMSupport() const override
HasNativeLTOLinker - Check whether the linker and related tools have native LLVM support.
Definition: FreeBSD.cpp:440
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:379
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:442
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:470
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:423
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:419
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:220
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:398
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:414
clang::SanitizerMask
Definition: Sanitizers.h:29
llvm::SmallVector
Definition: LLVM.h:35
Options.h
clang::driver::toolchains::FreeBSD::isPIEDefault
bool isPIEDefault() const override
Test whether this toolchain defaults to PIE.
Definition: FreeBSD.cpp:444
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::SanitizerArgs::requiresPIE
bool requiresPIE() const
Definition: SanitizerArgs.cpp:229
clang::driver::toolchains::FreeBSD::GetDefaultDwarfVersion
unsigned GetDefaultDwarfVersion() const override
Definition: FreeBSD.cpp:385
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:425
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:391
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:446
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:133