clang 8.0.0

NetBSD.cpp
Go to the documentation of this file.
1 //===--- NetBSD.cpp - NetBSD ToolChain Implementations ----------*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 #include "NetBSD.h"
11 #include "Arch/ARM.h"
12 #include "Arch/Mips.h"
13 #include "Arch/Sparc.h"
14 #include "CommonArgs.h"
15 #include "clang/Driver/Compilation.h"
16 #include "clang/Driver/Driver.h"
17 #include "clang/Driver/Options.h"
18 #include "clang/Driver/SanitizerArgs.h"
19 #include "llvm/Option/ArgList.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 netbsd::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
35 // GNU as needs different flags for creating the correct output format
36 // on architectures with different ABIs or optional feature sets.
37 switch (getToolChain().getArch()) {
38 case llvm::Triple::x86:
39 CmdArgs.push_back("--32");
40 break;
41 case llvm::Triple::arm:
42 case llvm::Triple::armeb:
43 case llvm::Triple::thumb:
44 case llvm::Triple::thumbeb: {
45 StringRef MArch, MCPU;
46 arm::getARMArchCPUFromArgs(Args, MArch, MCPU, /*FromAs*/ true);
47 std::string Arch =
48 arm::getARMTargetCPU(MCPU, MArch, getToolChain().getTriple());
49 CmdArgs.push_back(Args.MakeArgString("-mcpu=" + Arch));
50 break;
51 }
52
53 case llvm::Triple::mips:
54 case llvm::Triple::mipsel:
55 case llvm::Triple::mips64:
56 case llvm::Triple::mips64el: {
57 StringRef CPUName;
58 StringRef ABIName;
59 mips::getMipsCPUAndABI(Args, getToolChain().getTriple(), CPUName, ABIName);
60
61 CmdArgs.push_back("-march");
62 CmdArgs.push_back(CPUName.data());
63
64 CmdArgs.push_back("-mabi");
65 CmdArgs.push_back(mips::getGnuCompatibleMipsABIName(ABIName).data());
66
67 if (getToolChain().getTriple().isLittleEndian())
68 CmdArgs.push_back("-EL");
69 else
70 CmdArgs.push_back("-EB");
71
72 AddAssemblerKPIC(getToolChain(), Args, CmdArgs);
73 break;
74 }
75
76 case llvm::Triple::sparc:
77 case llvm::Triple::sparcel: {
78 CmdArgs.push_back("-32");
79 std::string CPU = getCPUName(Args, getToolChain().getTriple());
80 CmdArgs.push_back(sparc::getSparcAsmModeForCPU(CPU, getToolChain().getTriple()));
81 AddAssemblerKPIC(getToolChain(), Args, CmdArgs);
82 break;
83 }
84
85 case llvm::Triple::sparcv9: {
86 CmdArgs.push_back("-64");
87 std::string CPU = getCPUName(Args, getToolChain().getTriple());
88 CmdArgs.push_back(sparc::getSparcAsmModeForCPU(CPU, getToolChain().getTriple()));
89 AddAssemblerKPIC(getToolChain(), Args, CmdArgs);
90 break;
91 }
92
93 default:
94 break;
95 }
96
97 Args.AddAllArgValues(CmdArgs, options::OPT_Wa_COMMA, options::OPT_Xassembler);
98
99 CmdArgs.push_back("-o");
100 CmdArgs.push_back(Output.getFilename());
101
102 for (const auto &II : Inputs)
103 CmdArgs.push_back(II.getFilename());
104
105 const char *Exec = Args.MakeArgString((getToolChain().GetProgramPath("as")));
106 C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
107 }
108
109 void netbsd::Linker::ConstructJob(Compilation &C, const JobAction &JA,
110 const InputInfo &Output,
111 const InputInfoList &Inputs,
112 const ArgList &Args,
113 const char *LinkingOutput) const {
114 const toolchains::NetBSD &ToolChain =
115 static_cast<const toolchains::NetBSD &>(getToolChain());
116 const Driver &D = ToolChain.getDriver();
117 ArgStringList CmdArgs;
118
119 if (!D.SysRoot.empty())
120 CmdArgs.push_back(Args.MakeArgString("--sysroot=" + D.SysRoot));
121
122 CmdArgs.push_back("--eh-frame-hdr");
123 if (Args.hasArg(options::OPT_static)) {
124 CmdArgs.push_back("-Bstatic");
125 if (Args.hasArg(options::OPT_pie)) {
126 Args.AddAllArgs(CmdArgs, options::OPT_pie);
127 CmdArgs.push_back("--no-dynamic-linker");
128 }
129 } else {
130 if (Args.hasArg(options::OPT_rdynamic))
131 CmdArgs.push_back("-export-dynamic");
132 if (Args.hasArg(options::OPT_shared)) {
133 CmdArgs.push_back("-Bshareable");
134 } else {
135 Args.AddAllArgs(CmdArgs, options::OPT_pie);
136 CmdArgs.push_back("-dynamic-linker");
137 CmdArgs.push_back("/libexec/ld.elf_so");
138 }
139 }
140
141 // Many NetBSD architectures support more than one ABI.
142 // Determine the correct emulation for ld.
143 switch (ToolChain.getArch()) {
144 case llvm::Triple::x86:
145 CmdArgs.push_back("-m");
146 CmdArgs.push_back("elf_i386");
147 break;
148 case llvm::Triple::arm:
149 case llvm::Triple::thumb:
150 CmdArgs.push_back("-m");
151 switch (ToolChain.getTriple().getEnvironment()) {
152 case llvm::Triple::EABI:
153 case llvm::Triple::GNUEABI:
154 CmdArgs.push_back("armelf_nbsd_eabi");
155 break;
156 case llvm::Triple::EABIHF:
157 case llvm::Triple::GNUEABIHF:
158 CmdArgs.push_back("armelf_nbsd_eabihf");
159 break;
160 default:
161 CmdArgs.push_back("armelf_nbsd");
162 break;
163 }
164 break;
165 case llvm::Triple::armeb:
166 case llvm::Triple::thumbeb:
167 arm::appendBE8LinkFlag(Args, CmdArgs, ToolChain.getEffectiveTriple());
168 CmdArgs.push_back("-m");
169 switch (ToolChain.getTriple().getEnvironment()) {
170 case llvm::Triple::EABI:
171 case llvm::Triple::GNUEABI:
172 CmdArgs.push_back("armelfb_nbsd_eabi");
173 break;
174 case llvm::Triple::EABIHF:
175 case llvm::Triple::GNUEABIHF:
176 CmdArgs.push_back("armelfb_nbsd_eabihf");
177 break;
178 default:
179 CmdArgs.push_back("armelfb_nbsd");
180 break;
181 }
182 break;
183 case llvm::Triple::mips64:
184 case llvm::Triple::mips64el:
185 if (mips::hasMipsAbiArg(Args, "32")) {
186 CmdArgs.push_back("-m");
187 if (ToolChain.getArch() == llvm::Triple::mips64)
188 CmdArgs.push_back("elf32btsmip");
189 else
190 CmdArgs.push_back("elf32ltsmip");
191 } else if (mips::hasMipsAbiArg(Args, "64")) {
192 CmdArgs.push_back("-m");
193 if (ToolChain.getArch() == llvm::Triple::mips64)
194 CmdArgs.push_back("elf64btsmip");
195 else
196 CmdArgs.push_back("elf64ltsmip");
197 }
198 break;
199 case llvm::Triple::ppc:
200 CmdArgs.push_back("-m");
201 CmdArgs.push_back("elf32ppc_nbsd");
202 break;
203
204 case llvm::Triple::ppc64:
205 case llvm::Triple::ppc64le:
206 CmdArgs.push_back("-m");
207 CmdArgs.push_back("elf64ppc");
208 break;
209
210 case llvm::Triple::sparc:
211 CmdArgs.push_back("-m");
212 CmdArgs.push_back("elf32_sparc");
213 break;
214
215 case llvm::Triple::sparcv9:
216 CmdArgs.push_back("-m");
217 CmdArgs.push_back("elf64_sparc");
218 break;
219
220 default:
221 break;
222 }
223
224 if (Output.isFilename()) {
225 CmdArgs.push_back("-o");
226 CmdArgs.push_back(Output.getFilename());
227 } else {
228 assert(Output.isNothing() && "Invalid output.");
229 }
230
231 if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nostartfiles)) {
232 if (!Args.hasArg(options::OPT_shared)) {
233 CmdArgs.push_back(
234 Args.MakeArgString(ToolChain.GetFilePath("crt0.o")));
235 }
236 CmdArgs.push_back(
237 Args.MakeArgString(ToolChain.GetFilePath("crti.o")));
238 if (Args.hasArg(options::OPT_shared) || Args.hasArg(options::OPT_pie)) {
239 CmdArgs.push_back(
240 Args.MakeArgString(ToolChain.GetFilePath("crtbeginS.o")));
241 } else {
242 CmdArgs.push_back(
243 Args.MakeArgString(ToolChain.GetFilePath("crtbegin.o")));
244 }
245 }
246
247 Args.AddAllArgs(CmdArgs, options::OPT_L);
248 Args.AddAllArgs(CmdArgs, options::OPT_T_Group);
249 Args.AddAllArgs(CmdArgs, options::OPT_e);
250 Args.AddAllArgs(CmdArgs, options::OPT_s);
251 Args.AddAllArgs(CmdArgs, options::OPT_t);
252 Args.AddAllArgs(CmdArgs, options::OPT_Z_Flag);
253 Args.AddAllArgs(CmdArgs, options::OPT_r);
254
255 bool NeedsSanitizerDeps = addSanitizerRuntimes(getToolChain(), Args, CmdArgs);
256 bool NeedsXRayDeps = addXRayRuntime(ToolChain, Args, CmdArgs);
257 AddLinkerInputs(getToolChain(), Inputs, Args, CmdArgs, JA);
258
259 const SanitizerArgs &SanArgs = ToolChain.getSanitizerArgs();
260 if (SanArgs.needsSharedRt()) {
261 CmdArgs.push_back("-rpath");
262 CmdArgs.push_back(Args.MakeArgString(
263 ToolChain.getCompilerRTPath().c_str()));
264 }
265
266 unsigned Major, Minor, Micro;
267 ToolChain.getTriple().getOSVersion(Major, Minor, Micro);
268 bool useLibgcc = true;
269 if (Major >= 7 || Major == 0) {
270 switch (ToolChain.getArch()) {
271 case llvm::Triple::aarch64:
272 case llvm::Triple::aarch64_be:
273 case llvm::Triple::arm:
274 case llvm::Triple::armeb:
275 case llvm::Triple::thumb:
276 case llvm::Triple::thumbeb:
277 case llvm::Triple::ppc:
278 case llvm::Triple::ppc64:
279 case llvm::Triple::ppc64le:
280 case llvm::Triple::sparc:
281 case llvm::Triple::sparcv9:
282 case llvm::Triple::x86:
283 case llvm::Triple::x86_64:
284 useLibgcc = false;
285 break;
286 default:
287 break;
288 }
289 }
290
291 if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nodefaultlibs)) {
292 addOpenMPRuntime(CmdArgs, getToolChain(), Args);
293 if (D.CCCIsCXX()) {
294 if (ToolChain.ShouldLinkCXXStdlib(Args))
295 ToolChain.AddCXXStdlibLibArgs(Args, CmdArgs);
296 CmdArgs.push_back("-lm");
297 }
298 if (NeedsSanitizerDeps)
299 linkSanitizerRuntimeDeps(getToolChain(), CmdArgs);
300 if (NeedsXRayDeps)
301 linkXRayRuntimeDeps(ToolChain, CmdArgs);
302 if (Args.hasArg(options::OPT_pthread))
303 CmdArgs.push_back("-lpthread");
304 CmdArgs.push_back("-lc");
305
306 if (useLibgcc) {
307 if (Args.hasArg(options::OPT_static)) {
308 // libgcc_eh depends on libc, so resolve as much as possible,
309 // pull in any new requirements from libc and then get the rest
310 // of libgcc.
311 CmdArgs.push_back("-lgcc_eh");
312 CmdArgs.push_back("-lc");
313 CmdArgs.push_back("-lgcc");
314 } else {
315 CmdArgs.push_back("-lgcc");
316 CmdArgs.push_back("--as-needed");
317 CmdArgs.push_back("-lgcc_s");
318 CmdArgs.push_back("--no-as-needed");
319 }
320 }
321 }
322
323 if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nostartfiles)) {
324 if (Args.hasArg(options::OPT_shared) || Args.hasArg(options::OPT_pie))
325 CmdArgs.push_back(
326 Args.MakeArgString(ToolChain.GetFilePath("crtendS.o")));
327 else
328 CmdArgs.push_back(
329 Args.MakeArgString(ToolChain.GetFilePath("crtend.o")));
330 CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath("crtn.o")));
331 }
332
333 ToolChain.addProfileRTLibs(Args, CmdArgs);
334
335 const char *Exec = Args.MakeArgString(ToolChain.GetLinkerPath());
336 C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
337 }
338
339 /// NetBSD - NetBSD tool chain which can call as(1) and ld(1) directly.
340
341 NetBSD::NetBSD(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
342 : Generic_ELF(D, Triple, Args) {
343 if (!Args.hasArg(options::OPT_nostdlib)) {
344 // When targeting a 32-bit platform, try the special directory used on
345 // 64-bit hosts, and only fall back to the main library directory if that
346 // doesn't work.
347 // FIXME: It'd be nicer to test if this directory exists, but I'm not sure
348 // what all logic is needed to emulate the '=' prefix here.
349 switch (Triple.getArch()) {
350 case llvm::Triple::x86:
351 getFilePaths().push_back("=/usr/lib/i386");
352 break;
353 case llvm::Triple::arm:
354 case llvm::Triple::armeb:
355 case llvm::Triple::thumb:
356 case llvm::Triple::thumbeb:
357 switch (Triple.getEnvironment()) {
358 case llvm::Triple::EABI:
359 case llvm::Triple::GNUEABI:
360 getFilePaths().push_back("=/usr/lib/eabi");
361 break;
362 case llvm::Triple::EABIHF:
363 case llvm::Triple::GNUEABIHF:
364 getFilePaths().push_back("=/usr/lib/eabihf");
365 break;
366 default:
367 getFilePaths().push_back("=/usr/lib/oabi");
368 break;
369 }
370 break;
371 case llvm::Triple::mips64:
372 case llvm::Triple::mips64el:
373 if (tools::mips::hasMipsAbiArg(Args, "o32"))
374 getFilePaths().push_back("=/usr/lib/o32");
375 else if (tools::mips::hasMipsAbiArg(Args, "64"))
376 getFilePaths().push_back("=/usr/lib/64");
377 break;
378 case llvm::Triple::ppc:
379 getFilePaths().push_back("=/usr/lib/powerpc");
380 break;
381 case llvm::Triple::sparc:
382 getFilePaths().push_back("=/usr/lib/sparc");
383 break;
384 default:
385 break;
386 }
387
388 getFilePaths().push_back("=/usr/lib");
389 }
390 }
391
392 Tool *NetBSD::buildAssembler() const {
393 return new tools::netbsd::Assembler(*this);
394 }
395
396 Tool *NetBSD::buildLinker() const { return new tools::netbsd::Linker(*this); }
397
398 ToolChain::CXXStdlibType NetBSD::GetDefaultCXXStdlibType() const {
399 unsigned Major, Minor, Micro;
400 getTriple().getOSVersion(Major, Minor, Micro);
401 if (Major >= 7 || Major == 0) {
402 switch (getArch()) {
403 case llvm::Triple::aarch64:
404 case llvm::Triple::aarch64_be:
405 case llvm::Triple::arm:
406 case llvm::Triple::armeb:
407 case llvm::Triple::thumb:
408 case llvm::Triple::thumbeb:
409 case llvm::Triple::ppc:
410 case llvm::Triple::ppc64:
411 case llvm::Triple::ppc64le:
412 case llvm::Triple::sparc:
413 case llvm::Triple::sparcv9:
414 case llvm::Triple::x86:
415 case llvm::Triple::x86_64:
416 return ToolChain::CST_Libcxx;
417 default:
418 break;
419 }
420 }
421 return ToolChain::CST_Libstdcxx;
422 }
423
424 void NetBSD::addLibCxxIncludePaths(const llvm::opt::ArgList &DriverArgs,
425 llvm::opt::ArgStringList &CC1Args) const {
426 addSystemInclude(DriverArgs, CC1Args,
427 getDriver().SysRoot + "/usr/include/c++/");
428 }
429
430 void NetBSD::addLibStdCxxIncludePaths(const llvm::opt::ArgList &DriverArgs,
431 llvm::opt::ArgStringList &CC1Args) const {
432 addLibStdCXXIncludePaths(getDriver().SysRoot, "/usr/include/g++", "", "", "",
433 "", DriverArgs, CC1Args);
434 }
435
436 llvm::ExceptionHandling NetBSD::GetExceptionModel(const ArgList &Args) const {
437 // NetBSD uses Dwarf exceptions on ARM.
438 llvm::Triple::ArchType TArch = getTriple().getArch();
439 if (TArch == llvm::Triple::arm || TArch == llvm::Triple::armeb ||
440 TArch == llvm::Triple::thumb || TArch == llvm::Triple::thumbeb)
441 return llvm::ExceptionHandling::DwarfCFI;
442 return llvm::ExceptionHandling::None;
443 }
444
445 SanitizerMask NetBSD::getSupportedSanitizers() const {
446 const bool IsX86 = getTriple().getArch() == llvm::Triple::x86;
447 const bool IsX86_64 = getTriple().getArch() == llvm::Triple::x86_64;
448 SanitizerMask Res = ToolChain::getSupportedSanitizers();
449 if (IsX86 || IsX86_64) {
450 Res |= SanitizerKind::Address;
451 Res |= SanitizerKind::Function;
452 Res |= SanitizerKind::Leak;
453 Res |= SanitizerKind::SafeStack;
454 Res |= SanitizerKind::Scudo;
455 Res |= SanitizerKind::Vptr;
456 }
457 if (IsX86_64) {
458 Res |= SanitizerKind::DataFlow;
459 Res |= SanitizerKind::Efficiency;
460 Res |= SanitizerKind::Fuzzer;
461 Res |= SanitizerKind::FuzzerNoLink;
462 Res |= SanitizerKind::HWAddress;
463 Res |= SanitizerKind::KernelAddress;
464 Res |= SanitizerKind::KernelHWAddress;
465 Res |= SanitizerKind::KernelMemory;
466 Res |= SanitizerKind::Memory;
467 Res |= SanitizerKind::Thread;
468 }
469 return Res;
470 }
471
472 void NetBSD::addClangTargetOptions(const ArgList &,
473 ArgStringList &CC1Args,
474 Action::OffloadKind) const {
475 const SanitizerArgs &SanArgs = getSanitizerArgs();
476 if (SanArgs.hasAnySanitizer())
477 CC1Args.push_back("-D_REENTRANT");
478 }
clang::driver::tools::addXRayRuntime
bool addXRayRuntime(const ToolChain &TC, const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs)
clang::driver::toolchains::NetBSD::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: NetBSD.cpp:472
clang::driver::tools::sparc::getSparcAsmModeForCPU
const char * getSparcAsmModeForCPU(llvm::StringRef Name, const llvm::Triple &Triple)
clang::driver::toolchains::NetBSD::addLibCxxIncludePaths
void addLibCxxIncludePaths(const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args) const override
Definition: NetBSD.cpp:424
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:657
clang::driver::ToolChain::GetLinkerPath
std::string GetLinkerPath() const
Returns the linker path, respecting the -fuse-ld= argument to determine the linker suffix or name...
Definition: ToolChain.cpp:439
clang::driver::ToolChain::CXXStdlibType
CXXStdlibType
Definition: ToolChain.h:93
clang::driver::tools::getCPUName
std::string getCPUName(const llvm::opt::ArgList &Args, const llvm::Triple &T, bool FromAs=false)
clang::driver::InputInfo::getFilename
const char * getFilename() const
Definition: InputInfo.h:84
SanitizerArgs.h
CommonArgs.h
clang::driver::tools::linkSanitizerRuntimeDeps
void linkSanitizerRuntimeDeps(const ToolChain &TC, llvm::opt::ArgStringList &CmdArgs)
clang::driver::JobAction
Definition: Action.h:374
clang::driver::ToolChain::CST_Libcxx
Definition: ToolChain.h:94
clang::driver::toolchains::NetBSD::buildAssembler
Tool * buildAssembler() const override
Definition: NetBSD.cpp:392
clang::driver::tools::netbsd::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: NetBSD.cpp:27
clang::driver::tools::addSanitizerRuntimes
bool addSanitizerRuntimes(const ToolChain &TC, const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs)
clang::driver::SanitizerArgs
Definition: SanitizerArgs.h:24
clang::driver::tools
Definition: AMDGPU.h:21
Sparc.h
clang::driver::InputInfo
InputInfo - Wrapper for information about an input source.
Definition: InputInfo.h:23
clang::driver::ToolChain::GetFilePath
std::string GetFilePath(const char *Name) const
Definition: ToolChain.cpp:431
clang::driver::SanitizerArgs::hasAnySanitizer
bool hasAnySanitizer() const
Definition: SanitizerArgs.h:87
clang::driver::ToolChain::getFilePaths
path_list & getFilePaths()
Definition: ToolChain.h:224
clang::driver::Driver
Driver - Encapsulate logic for constructing compilation processes from a set of gcc-driver-like comma...
Definition: Driver.h:58
clang::driver::tools::mips::hasMipsAbiArg
bool hasMipsAbiArg(const llvm::opt::ArgList &Args, const char *Value)
ARM.h
clang::driver::toolchains::NetBSD::GetDefaultCXXStdlibType
CXXStdlibType GetDefaultCXXStdlibType() const override
Definition: NetBSD.cpp:398
Driver.h
NetBSD.h
clang::driver::tools::addOpenMPRuntime
bool addOpenMPRuntime(llvm::opt::ArgStringList &CmdArgs, const ToolChain &TC, const llvm::opt::ArgList &Args, bool IsOffloadingHost=false, bool GompNeedsRT=false)
Returns true, if an OpenMP runtime has been added.
clang::driver::tools::netbsd::Assembler
Definition: NetBSD.h:23
clang::driver::toolchains::NetBSD::buildLinker
Tool * buildLinker() const override
Definition: NetBSD.cpp:396
Compilation.h
clang::driver::tools::linkXRayRuntimeDeps
void linkXRayRuntimeDeps(const ToolChain &TC, llvm::opt::ArgStringList &CmdArgs)
clang::driver::toolchains::NetBSD::getSupportedSanitizers
SanitizerMask getSupportedSanitizers() const override
Return sanitizers which are available in this toolchain.
Definition: NetBSD.cpp:445
clang::driver::tools::netbsd::Linker
Definition: NetBSD.h:36
clang::driver::toolchains::Generic_ELF
Definition: Gnu.h:340
llvm::opt
Definition: Action.h:24
clang::driver::tools::netbsd::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: NetBSD.cpp:109
clang::driver::ToolChain::getEffectiveTriple
const llvm::Triple & getEffectiveTriple() const
Get the toolchain&#39;s effective clang triple.
Definition: ToolChain.h:216
clang::driver::Compilation::addCommand
void addCommand(std::unique_ptr< Command > C)
Definition: Compilation.h:206
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:202
clang::driver::ToolChain::getDriver
const Driver & getDriver() const
Definition: ToolChain.h:186
clang::driver::Driver::CCCIsCXX
bool CCCIsCXX() const
Whether the driver should follow g++ like behavior.
Definition: Driver.h:173
clang::driver::toolchains::NetBSD::addLibStdCxxIncludePaths
void addLibStdCxxIncludePaths(const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args) const override
Definition: NetBSD.cpp:430
llvm::SmallVector
Definition: LLVM.h:36
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:702
Options.h
clang::XRayInstrKind::None
constexpr XRayInstrMask None
Definition: XRayInstr.h:38
clang::driver::toolchains::NetBSD::GetExceptionModel
llvm::ExceptionHandling GetExceptionModel(const llvm::opt::ArgList &Args) const override
GetExceptionModel - Return the tool chain exception model.
Definition: NetBSD.cpp:436
clang::driver::tools::arm::getARMTargetCPU
std::string getARMTargetCPU(StringRef CPU, llvm::StringRef Arch, const llvm::Triple &Triple)
clang::driver::Action::OffloadKind
OffloadKind
Definition: Action.h:83
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:755
clang
Dataflow Directional Tag Classes.
Definition: CFGReachabilityAnalysis.h:22
Mips.h
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:34
clang::driver::ToolChain::getSanitizerArgs
const SanitizerArgs & getSanitizerArgs() const
Definition: ToolChain.cpp:116
clang::driver::tools::arm::getARMArchCPUFromArgs
void getARMArchCPUFromArgs(const llvm::opt::ArgList &Args, llvm::StringRef &Arch, llvm::StringRef &CPU, bool FromAs=false)
clang::driver::tools::claimNoWarnArgs
void claimNoWarnArgs(const llvm::opt::ArgList &Args)
clang::SanitizerMask
uint64_t SanitizerMask
Definition: Sanitizers.h:26
clang::driver::Compilation
Compilation - A set of tasks to perform for a single driver invocation.
Definition: Compilation.h:46
clang::driver::ToolChain::getTriple
const llvm::Triple & getTriple() const
Definition: ToolChain.h:188
clang::driver
Definition: Action.h:32
clang::driver::ToolChain::getSupportedSanitizers
virtual SanitizerMask getSupportedSanitizers() const
Return sanitizers which are available in this toolchain.
Definition: ToolChain.cpp:818
clang::driver::tools::arm::appendBE8LinkFlag
void appendBE8LinkFlag(const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs, const llvm::Triple &Triple)
clang::driver::ToolChain::getCompilerRTPath
virtual std::string getCompilerRTPath() const
Definition: ToolChain.cpp:355
clang::driver::tools::mips::getGnuCompatibleMipsABIName
StringRef getGnuCompatibleMipsABIName(StringRef ABI)
Definition: Mips.cpp:144
clang::driver::toolchains
Definition: AMDGPU.h:41
clang::driver::InputInfo::isNothing
bool isNothing() const
Definition: InputInfo.h:75
clang::driver::InputInfo::isFilename
bool isFilename() const
Definition: InputInfo.h:76
clang::driver::SanitizerArgs::needsSharedRt
bool needsSharedRt() const
Definition: SanitizerArgs.h:58
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:2556
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:95
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:761
clang::driver::toolchains::NetBSD
Definition: NetBSD.h:53
clang::driver::ToolChain
ToolChain - Access to tools for a single platform.
Definition: ToolChain.h:89