clang 19.0.0git
AIX.cpp
Go to the documentation of this file.
1//===--- AIX.cpp - AIX 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 "AIX.h"
10#include "Arch/PPC.h"
11#include "CommonArgs.h"
15#include "llvm/ADT/StringExtras.h"
16#include "llvm/Option/ArgList.h"
17#include "llvm/ProfileData/InstrProf.h"
18#include "llvm/Support/Path.h"
19
21using namespace clang::driver;
22using namespace clang::driver::tools;
23using namespace clang::driver::toolchains;
24
25using namespace llvm::opt;
26using namespace llvm::sys;
27
29 const InputInfo &Output,
30 const InputInfoList &Inputs,
31 const ArgList &Args,
32 const char *LinkingOutput) const {
33 const Driver &D = getToolChain().getDriver();
34 ArgStringList CmdArgs;
35
36 const bool IsArch32Bit = getToolChain().getTriple().isArch32Bit();
37 const bool IsArch64Bit = getToolChain().getTriple().isArch64Bit();
38 // Only support 32 and 64 bit.
39 if (!IsArch32Bit && !IsArch64Bit)
40 llvm_unreachable("Unsupported bit width value.");
41
42 if (Arg *A = C.getArgs().getLastArg(options::OPT_G)) {
43 D.Diag(diag::err_drv_unsupported_opt_for_target)
44 << A->getSpelling() << D.getTargetTriple();
45 }
46
47 // Specify the mode in which the as(1) command operates.
48 if (IsArch32Bit) {
49 CmdArgs.push_back("-a32");
50 } else {
51 // Must be 64-bit, otherwise asserted already.
52 CmdArgs.push_back("-a64");
53 }
54
55 // Accept any mixture of instructions.
56 // On Power for AIX and Linux, this behaviour matches that of GCC for both the
57 // user-provided assembler source case and the compiler-produced assembler
58 // source case. Yet XL with user-provided assembler source would not add this.
59 CmdArgs.push_back("-many");
60
61 Args.AddAllArgValues(CmdArgs, options::OPT_Wa_COMMA, options::OPT_Xassembler);
62
63 // Specify assembler output file.
64 assert((Output.isFilename() || Output.isNothing()) && "Invalid output.");
65 if (Output.isFilename()) {
66 CmdArgs.push_back("-o");
67 CmdArgs.push_back(Output.getFilename());
68 }
69
70 // Specify assembler input file.
71 // The system assembler on AIX takes exactly one input file. The driver is
72 // expected to invoke as(1) separately for each assembler source input file.
73 if (Inputs.size() != 1)
74 llvm_unreachable("Invalid number of input files.");
75 const InputInfo &II = Inputs[0];
76 assert((II.isFilename() || II.isNothing()) && "Invalid input.");
77 if (II.isFilename())
78 CmdArgs.push_back(II.getFilename());
79
80 const char *Exec = Args.MakeArgString(getToolChain().GetProgramPath("as"));
81 C.addCommand(std::make_unique<Command>(JA, *this, ResponseFileSupport::None(),
82 Exec, CmdArgs, Inputs, Output));
83}
84
85// Determine whether there are any linker options that supply an export list
86// (or equivalent information about what to export) being sent to the linker.
87static bool hasExportListLinkerOpts(const ArgStringList &CmdArgs) {
88 for (size_t i = 0, Size = CmdArgs.size(); i < Size; ++i) {
89 llvm::StringRef ArgString(CmdArgs[i]);
90
91 if (ArgString.starts_with("-bE:") || ArgString.starts_with("-bexport:") ||
92 ArgString == "-bexpall" || ArgString == "-bexpfull")
93 return true;
94
95 // If we split -b option, check the next opt.
96 if (ArgString == "-b" && i + 1 < Size) {
97 ++i;
98 llvm::StringRef ArgNextString(CmdArgs[i]);
99 if (ArgNextString.starts_with("E:") ||
100 ArgNextString.starts_with("export:") || ArgNextString == "expall" ||
101 ArgNextString == "expfull")
102 return true;
103 }
104 }
105 return false;
106}
107
109 const InputInfo &Output,
110 const InputInfoList &Inputs, const ArgList &Args,
111 const char *LinkingOutput) const {
112 const AIX &ToolChain = static_cast<const AIX &>(getToolChain());
113 const Driver &D = ToolChain.getDriver();
114 ArgStringList CmdArgs;
115
116 const bool IsArch32Bit = ToolChain.getTriple().isArch32Bit();
117 const bool IsArch64Bit = ToolChain.getTriple().isArch64Bit();
118 // Only support 32 and 64 bit.
119 if (!(IsArch32Bit || IsArch64Bit))
120 llvm_unreachable("Unsupported bit width value.");
121
122 if (Arg *A = C.getArgs().getLastArg(options::OPT_G)) {
123 D.Diag(diag::err_drv_unsupported_opt_for_target)
124 << A->getSpelling() << D.getTargetTriple();
125 }
126
127 // Force static linking when "-static" is present.
128 if (Args.hasArg(options::OPT_static))
129 CmdArgs.push_back("-bnso");
130
131 // Add options for shared libraries.
132 if (Args.hasArg(options::OPT_shared)) {
133 CmdArgs.push_back("-bM:SRE");
134 CmdArgs.push_back("-bnoentry");
135 }
136
137 if (Args.hasFlag(options::OPT_mxcoff_roptr, options::OPT_mno_xcoff_roptr,
138 false)) {
139 if (Args.hasArg(options::OPT_shared))
140 D.Diag(diag::err_roptr_cannot_build_shared);
141
142 // The `-mxcoff-roptr` option places constants in RO sections as much as
143 // possible. Then `-bforceimprw` changes such sections to RW if they contain
144 // imported symbols that need to be resolved.
145 CmdArgs.push_back("-bforceimprw");
146 }
147
148 // PGO instrumentation generates symbols belonging to special sections, and
149 // the linker needs to place all symbols in a particular section together in
150 // memory; the AIX linker does that under an option.
151 if (Args.hasFlag(options::OPT_fprofile_arcs, options::OPT_fno_profile_arcs,
152 false) ||
153 Args.hasFlag(options::OPT_fprofile_generate,
154 options::OPT_fno_profile_generate, false) ||
155 Args.hasFlag(options::OPT_fprofile_generate_EQ,
156 options::OPT_fno_profile_generate, false) ||
157 Args.hasFlag(options::OPT_fprofile_instr_generate,
158 options::OPT_fno_profile_instr_generate, false) ||
159 Args.hasFlag(options::OPT_fprofile_instr_generate_EQ,
160 options::OPT_fno_profile_instr_generate, false) ||
161 Args.hasFlag(options::OPT_fcs_profile_generate,
162 options::OPT_fno_profile_generate, false) ||
163 Args.hasFlag(options::OPT_fcs_profile_generate_EQ,
164 options::OPT_fno_profile_generate, false) ||
165 Args.hasArg(options::OPT_fcreate_profile) ||
166 Args.hasArg(options::OPT_coverage))
167 CmdArgs.push_back("-bdbg:namedsects:ss");
168
169 if (Arg *A =
170 Args.getLastArg(clang::driver::options::OPT_mxcoff_build_id_EQ)) {
171 StringRef BuildId = A->getValue();
172 if (BuildId[0] != '0' || BuildId[1] != 'x' ||
173 BuildId.find_if_not(llvm::isHexDigit, 2) != StringRef::npos)
174 ToolChain.getDriver().Diag(diag::err_drv_unsupported_option_argument)
175 << A->getSpelling() << BuildId;
176 else {
177 std::string LinkerFlag = "-bdbg:ldrinfo:xcoff_binary_id:0x";
178 if (BuildId.size() % 2) // Prepend a 0 if odd number of digits.
179 LinkerFlag += "0";
180 LinkerFlag += BuildId.drop_front(2).lower();
181 CmdArgs.push_back(Args.MakeArgString(LinkerFlag));
182 }
183 }
184
185 // Specify linker output file.
186 assert((Output.isFilename() || Output.isNothing()) && "Invalid output.");
187 if (Output.isFilename()) {
188 CmdArgs.push_back("-o");
189 CmdArgs.push_back(Output.getFilename());
190 }
191
192 // Set linking mode (i.e., 32/64-bit) and the address of
193 // text and data sections based on arch bit width.
194 if (IsArch32Bit) {
195 CmdArgs.push_back("-b32");
196 CmdArgs.push_back("-bpT:0x10000000");
197 CmdArgs.push_back("-bpD:0x20000000");
198 } else {
199 // Must be 64-bit, otherwise asserted already.
200 CmdArgs.push_back("-b64");
201 CmdArgs.push_back("-bpT:0x100000000");
202 CmdArgs.push_back("-bpD:0x110000000");
203 }
204
205 if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nostartfiles,
206 options::OPT_shared, options::OPT_r)) {
207 auto getCrt0Basename = [&Args, IsArch32Bit] {
208 if (Arg *A = Args.getLastArgNoClaim(options::OPT_p, options::OPT_pg)) {
209 // Enable gprofiling when "-pg" is specified.
210 if (A->getOption().matches(options::OPT_pg))
211 return IsArch32Bit ? "gcrt0.o" : "gcrt0_64.o";
212 // Enable profiling when "-p" is specified.
213 return IsArch32Bit ? "mcrt0.o" : "mcrt0_64.o";
214 }
215 return IsArch32Bit ? "crt0.o" : "crt0_64.o";
216 };
217
218 CmdArgs.push_back(
219 Args.MakeArgString(ToolChain.GetFilePath(getCrt0Basename())));
220
221 CmdArgs.push_back(Args.MakeArgString(
222 ToolChain.GetFilePath(IsArch32Bit ? "crti.o" : "crti_64.o")));
223 }
224
225 // Collect all static constructor and destructor functions in both C and CXX
226 // language link invocations. This has to come before AddLinkerInputs as the
227 // implied option needs to precede any other '-bcdtors' settings or
228 // '-bnocdtors' that '-Wl' might forward.
229 CmdArgs.push_back("-bcdtors:all:0:s");
230
231 // Specify linker input file(s).
232 AddLinkerInputs(ToolChain, Inputs, Args, CmdArgs, JA);
233
234 if (D.isUsingLTO()) {
235 assert(!Inputs.empty() && "Must have at least one input.");
236 // Find the first filename InputInfo object.
237 auto Input = llvm::find_if(
238 Inputs, [](const InputInfo &II) -> bool { return II.isFilename(); });
239 if (Input == Inputs.end())
240 // For a very rare case, all of the inputs to the linker are
241 // InputArg. If that happens, just use the first InputInfo.
242 Input = Inputs.begin();
243
244 addLTOOptions(ToolChain, Args, CmdArgs, Output, *Input,
245 D.getLTOMode() == LTOK_Thin);
246 }
247
248 if (Args.hasArg(options::OPT_shared) && !hasExportListLinkerOpts(CmdArgs)) {
249
250 const char *CreateExportListExec = Args.MakeArgString(
251 path::parent_path(ToolChain.getDriver().ClangExecutable) +
252 "/llvm-nm");
253 ArgStringList CreateExportCmdArgs;
254
255 std::string CreateExportListPath =
256 C.getDriver().GetTemporaryPath("CreateExportList", "exp");
257 const char *ExportList =
258 C.addTempFile(C.getArgs().MakeArgString(CreateExportListPath));
259
260 for (const auto &II : Inputs)
261 if (II.isFilename())
262 CreateExportCmdArgs.push_back(II.getFilename());
263
264 CreateExportCmdArgs.push_back("--export-symbols");
265 CreateExportCmdArgs.push_back("-X");
266 if (IsArch32Bit) {
267 CreateExportCmdArgs.push_back("32");
268 } else {
269 // Must be 64-bit, otherwise asserted already.
270 CreateExportCmdArgs.push_back("64");
271 }
272
273 auto ExpCommand = std::make_unique<Command>(
274 JA, *this, ResponseFileSupport::None(), CreateExportListExec,
275 CreateExportCmdArgs, Inputs, Output);
276 ExpCommand->setRedirectFiles(
277 {std::nullopt, std::string(ExportList), std::nullopt});
278 C.addCommand(std::move(ExpCommand));
279 CmdArgs.push_back(Args.MakeArgString(llvm::Twine("-bE:") + ExportList));
280 }
281
282 // Add directory to library search path.
283 Args.AddAllArgs(CmdArgs, options::OPT_L);
284 if (!Args.hasArg(options::OPT_r)) {
285 ToolChain.AddFilePathLibArgs(Args, CmdArgs);
286 ToolChain.addProfileRTLibs(Args, CmdArgs);
287
288 if (getToolChain().ShouldLinkCXXStdlib(Args))
289 getToolChain().AddCXXStdlibLibArgs(Args, CmdArgs);
290
291 if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nodefaultlibs)) {
292 AddRunTimeLibs(ToolChain, D, CmdArgs, Args);
293
294 // Add OpenMP runtime if -fopenmp is specified.
295 if (Args.hasFlag(options::OPT_fopenmp, options::OPT_fopenmp_EQ,
296 options::OPT_fno_openmp, false)) {
297 switch (ToolChain.getDriver().getOpenMPRuntime(Args)) {
299 CmdArgs.push_back("-lomp");
300 break;
302 CmdArgs.push_back("-liomp5");
303 break;
305 CmdArgs.push_back("-lgomp");
306 break;
308 // Already diagnosed.
309 break;
310 }
311 }
312
313 // Support POSIX threads if "-pthreads" or "-pthread" is present.
314 if (Args.hasArg(options::OPT_pthreads, options::OPT_pthread))
315 CmdArgs.push_back("-lpthreads");
316
317 if (D.CCCIsCXX())
318 CmdArgs.push_back("-lm");
319
320 CmdArgs.push_back("-lc");
321
322 if (Args.hasArgNoClaim(options::OPT_p, options::OPT_pg)) {
323 CmdArgs.push_back(Args.MakeArgString((llvm::Twine("-L") + D.SysRoot) +
324 "/lib/profiled"));
325 CmdArgs.push_back(Args.MakeArgString((llvm::Twine("-L") + D.SysRoot) +
326 "/usr/lib/profiled"));
327 }
328 }
329 }
330
331 if (D.IsFlangMode()) {
333 addFortranRuntimeLibs(ToolChain, Args, CmdArgs);
334 CmdArgs.push_back("-lm");
335 CmdArgs.push_back("-lpthread");
336 }
337 const char *Exec = Args.MakeArgString(ToolChain.GetLinkerPath());
338 C.addCommand(std::make_unique<Command>(JA, *this, ResponseFileSupport::None(),
339 Exec, CmdArgs, Inputs, Output));
340}
341
342/// AIX - AIX tool chain which can call as(1) and ld(1) directly.
343AIX::AIX(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
344 : ToolChain(D, Triple, Args) {
345 getProgramPaths().push_back(getDriver().getInstalledDir());
346 if (getDriver().getInstalledDir() != getDriver().Dir)
347 getProgramPaths().push_back(getDriver().Dir);
348
349 ParseInlineAsmUsingAsmParser = Args.hasFlag(
350 options::OPT_fintegrated_as, options::OPT_fno_integrated_as, true);
351 getLibraryPaths().push_back(getDriver().SysRoot + "/usr/lib");
352}
353
354// Returns the effective header sysroot path to use.
355// This comes from either -isysroot or --sysroot.
356llvm::StringRef
357AIX::GetHeaderSysroot(const llvm::opt::ArgList &DriverArgs) const {
358 if (DriverArgs.hasArg(options::OPT_isysroot))
359 return DriverArgs.getLastArgValue(options::OPT_isysroot);
360 if (!getDriver().SysRoot.empty())
361 return getDriver().SysRoot;
362 return "/";
363}
364
365void AIX::AddClangSystemIncludeArgs(const ArgList &DriverArgs,
366 ArgStringList &CC1Args) const {
367 // Return if -nostdinc is specified as a driver option.
368 if (DriverArgs.hasArg(options::OPT_nostdinc))
369 return;
370
371 llvm::StringRef Sysroot = GetHeaderSysroot(DriverArgs);
372 const Driver &D = getDriver();
373
374 if (!DriverArgs.hasArg(options::OPT_nobuiltininc)) {
376 // Add the PowerPC intrinsic headers (<resource>/include/ppc_wrappers)
377 path::append(P, "include", "ppc_wrappers");
378 addSystemInclude(DriverArgs, CC1Args, P);
379 // Add the Clang builtin headers (<resource>/include)
380 addSystemInclude(DriverArgs, CC1Args, path::parent_path(P.str()));
381 }
382
383 // Return if -nostdlibinc is specified as a driver option.
384 if (DriverArgs.hasArg(options::OPT_nostdlibinc))
385 return;
386
387 // Add <sysroot>/usr/include.
388 SmallString<128> UP(Sysroot);
389 path::append(UP, "/usr/include");
390 addSystemInclude(DriverArgs, CC1Args, UP.str());
391}
392
394 const llvm::opt::ArgList &DriverArgs,
395 llvm::opt::ArgStringList &CC1Args) const {
396
397 if (DriverArgs.hasArg(options::OPT_nostdinc) ||
398 DriverArgs.hasArg(options::OPT_nostdincxx) ||
399 DriverArgs.hasArg(options::OPT_nostdlibinc))
400 return;
401
402 switch (GetCXXStdlibType(DriverArgs)) {
404 llvm::report_fatal_error(
405 "picking up libstdc++ headers is unimplemented on AIX");
407 llvm::StringRef Sysroot = GetHeaderSysroot(DriverArgs);
408 SmallString<128> PathCPP(Sysroot);
409 llvm::sys::path::append(PathCPP, "opt/IBM/openxlCSDK", "include", "c++",
410 "v1");
411 addSystemInclude(DriverArgs, CC1Args, PathCPP.str());
412 // Required in order to suppress conflicting C++ overloads in the system
413 // libc headers that were used by XL C++.
414 CC1Args.push_back("-D__LIBC_NO_CPP_MATH_OVERLOADS__");
415 return;
416 }
417 }
418
419 llvm_unreachable("Unexpected C++ library type; only libc++ is supported.");
420}
421
422void AIX::AddCXXStdlibLibArgs(const llvm::opt::ArgList &Args,
423 llvm::opt::ArgStringList &CmdArgs) const {
424 switch (GetCXXStdlibType(Args)) {
426 llvm::report_fatal_error("linking libstdc++ unimplemented on AIX");
428 CmdArgs.push_back("-lc++");
429 if (Args.hasArg(options::OPT_fexperimental_library))
430 CmdArgs.push_back("-lc++experimental");
431 CmdArgs.push_back("-lc++abi");
432 return;
433 }
434
435 llvm_unreachable("Unexpected C++ library type; only libc++ is supported.");
436}
437
439 const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CC1Args,
440 Action::OffloadKind DeviceOffloadingKind) const {
441 Args.AddLastArg(CC1Args, options::OPT_mignore_xcoff_visibility);
442 Args.AddLastArg(CC1Args, options::OPT_mdefault_visibility_export_mapping_EQ);
443 Args.addOptInFlag(CC1Args, options::OPT_mxcoff_roptr, options::OPT_mno_xcoff_roptr);
444
445 if (Args.hasFlag(options::OPT_fxl_pragma_pack,
446 options::OPT_fno_xl_pragma_pack, true))
447 CC1Args.push_back("-fxl-pragma-pack");
448}
449
450void AIX::addProfileRTLibs(const llvm::opt::ArgList &Args,
451 llvm::opt::ArgStringList &CmdArgs) const {
452 if (needsProfileRT(Args)) {
453 // Add linker option -u__llvm_profile_runtime to cause runtime
454 // initialization to occur.
455 CmdArgs.push_back(Args.MakeArgString(
456 Twine("-u", llvm::getInstrProfRuntimeHookVarName())));
457
458 if (const auto *A =
459 Args.getLastArgNoClaim(options::OPT_fprofile_update_EQ)) {
460 StringRef Val = A->getValue();
461 if (Val == "atomic" || Val == "prefer-atomic")
462 CmdArgs.push_back("-latomic");
463 }
464 }
465
466 ToolChain::addProfileRTLibs(Args, CmdArgs);
467}
468
471}
472
475}
476
477auto AIX::buildAssembler() const -> Tool * { return new aix::Assembler(*this); }
478
479auto AIX::buildLinker() const -> Tool * { return new aix::Linker(*this); }
static bool hasExportListLinkerOpts(const ArgStringList &CmdArgs)
Definition: AIX.cpp:87
StringRef P
Compilation - A set of tasks to perform for a single driver invocation.
Definition: Compilation.h:45
Driver - Encapsulate logic for constructing compilation processes from a set of gcc-driver-like comma...
Definition: Driver.h:77
std::string SysRoot
sysroot, if present
Definition: Driver.h:183
OpenMPRuntimeKind getOpenMPRuntime(const llvm::opt::ArgList &Args) const
Compute the desired OpenMP runtime from the flags provided.
Definition: Driver.cpp:734
DiagnosticBuilder Diag(unsigned DiagID) const
Definition: Driver.h:144
std::string ClangExecutable
The original path to the clang executable.
Definition: Driver.h:158
LTOKind getLTOMode(bool IsOffload=false) const
Get the specific kind of LTO being performed.
Definition: Driver.h:723
std::string ResourceDir
The path to the compiler resource directory.
Definition: Driver.h:167
bool isUsingLTO(bool IsOffload=false) const
Returns true if we are performing any kind of LTO.
Definition: Driver.h:718
@ OMPRT_IOMP5
The legacy name for the LLVM OpenMP runtime from when it was the Intel OpenMP runtime.
Definition: Driver.h:140
@ OMPRT_OMP
The LLVM OpenMP runtime.
Definition: Driver.h:130
@ OMPRT_Unknown
An unknown OpenMP runtime.
Definition: Driver.h:126
@ OMPRT_GOMP
The GNU OpenMP runtime.
Definition: Driver.h:135
std::string getTargetTriple() const
Definition: Driver.h:423
bool IsFlangMode() const
Whether the driver should invoke flang for fortran inputs.
Definition: Driver.h:229
bool CCCIsCXX() const
Whether the driver should follow g++ like behavior.
Definition: Driver.h:216
InputInfo - Wrapper for information about an input source.
Definition: InputInfo.h:22
const char * getFilename() const
Definition: InputInfo.h:83
bool isNothing() const
Definition: InputInfo.h:74
bool isFilename() const
Definition: InputInfo.h:75
ToolChain - Access to tools for a single platform.
Definition: ToolChain.h:92
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:1154
std::string GetFilePath(const char *Name) const
Definition: ToolChain.cpp:845
static bool needsProfileRT(const llvm::opt::ArgList &Args)
needsProfileRT - returns true if instrumentation profile is on.
Definition: ToolChain.cpp:815
const Driver & getDriver() const
Definition: ToolChain.h:252
path_list & getProgramPaths()
Definition: ToolChain.h:297
const llvm::Triple & getTriple() const
Definition: ToolChain.h:254
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:1058
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:853
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:1281
virtual CXXStdlibType GetCXXStdlibType(const llvm::opt::ArgList &Args) const
Definition: ToolChain.cpp:1128
path_list & getLibraryPaths()
Definition: ToolChain.h:291
Tool - Information on a specific compilation tool.
Definition: Tool.h:32
const ToolChain & getToolChain() const
Definition: Tool.h:52
Tool * buildAssembler() const override
Definition: AIX.cpp:477
void AddClangSystemIncludeArgs(const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args) const override
Add the clang cc1 arguments for system include paths.
Definition: AIX.cpp:365
void addProfileRTLibs(const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs) const override
addProfileRTLibs - When -fprofile-instr-profile is specified, try to pass a suitable profile runtime ...
Definition: AIX.cpp:450
CXXStdlibType GetDefaultCXXStdlibType() const override
Definition: AIX.cpp:469
AIX(const Driver &D, const llvm::Triple &Triple, const llvm::opt::ArgList &Args)
AIX - AIX tool chain which can call as(1) and ld(1) directly.
Definition: AIX.cpp:343
RuntimeLibType GetDefaultRuntimeLibType() const override
GetDefaultRuntimeLibType - Get the default runtime library variant to use.
Definition: AIX.cpp:473
Tool * buildLinker() const override
Definition: AIX.cpp:479
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: AIX.cpp:422
void addClangTargetOptions(const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CC1Args, Action::OffloadKind DeviceOffloadingKind) const override
Add options that need to be passed to cc1 for this target.
Definition: AIX.cpp:438
void AddClangCXXStdlibIncludeArgs(const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args) const override
AddClangCXXStdlibIncludeArgs - Add the clang -cc1 level arguments to set the include paths to use for...
Definition: AIX.cpp:393
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: AIX.cpp:28
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: AIX.cpp:108
void AddRunTimeLibs(const ToolChain &TC, const Driver &D, llvm::opt::ArgStringList &CmdArgs, const llvm::opt::ArgList &Args)
void addFortranRuntimeLibraryPath(const ToolChain &TC, const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs)
Adds the path for the Fortran runtime libraries to CmdArgs.
void addLTOOptions(const ToolChain &ToolChain, const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs, const InputInfo &Output, const InputInfo &Input, bool IsThinLTO)
void AddLinkerInputs(const ToolChain &TC, const InputInfoList &Inputs, const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs, const JobAction &JA)
void addFortranRuntimeLibs(const ToolChain &TC, const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs)
Adds Fortran runtime libraries to CmdArgs.
static constexpr ResponseFileSupport None()
Returns a ResponseFileSupport indicating that response files are not supported.
Definition: Job.h:78