clang 20.0.0git
Flang.cpp
Go to the documentation of this file.
1//===-- Flang.cpp - Flang+LLVM 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 "Flang.h"
10#include "Arch/RISCV.h"
11#include "CommonArgs.h"
12
15#include "llvm/Frontend/Debug/Options.h"
16#include "llvm/Support/FileSystem.h"
17#include "llvm/Support/Path.h"
18#include "llvm/TargetParser/Host.h"
19#include "llvm/TargetParser/RISCVISAInfo.h"
20#include "llvm/TargetParser/RISCVTargetParser.h"
21
22#include <cassert>
23
24using namespace clang::driver;
25using namespace clang::driver::tools;
26using namespace clang;
27using namespace llvm::opt;
28
29/// Add -x lang to \p CmdArgs for \p Input.
30static void addDashXForInput(const ArgList &Args, const InputInfo &Input,
31 ArgStringList &CmdArgs) {
32 CmdArgs.push_back("-x");
33 // Map the driver type to the frontend type.
34 CmdArgs.push_back(types::getTypeName(Input.getType()));
35}
36
37void Flang::addFortranDialectOptions(const ArgList &Args,
38 ArgStringList &CmdArgs) const {
39 Args.addAllArgs(CmdArgs, {options::OPT_ffixed_form,
40 options::OPT_ffree_form,
41 options::OPT_ffixed_line_length_EQ,
42 options::OPT_fopenacc,
43 options::OPT_finput_charset_EQ,
44 options::OPT_fimplicit_none,
45 options::OPT_fno_implicit_none,
46 options::OPT_fbackslash,
47 options::OPT_fno_backslash,
48 options::OPT_flogical_abbreviations,
49 options::OPT_fno_logical_abbreviations,
50 options::OPT_fxor_operator,
51 options::OPT_fno_xor_operator,
52 options::OPT_falternative_parameter_statement,
53 options::OPT_fdefault_real_8,
54 options::OPT_fdefault_integer_8,
55 options::OPT_fdefault_double_8,
56 options::OPT_flarge_sizes,
57 options::OPT_fno_automatic,
58 options::OPT_fhermetic_module_files,
59 options::OPT_frealloc_lhs,
60 options::OPT_fno_realloc_lhs,
61 options::OPT_fsave_main_program});
62}
63
64void Flang::addPreprocessingOptions(const ArgList &Args,
65 ArgStringList &CmdArgs) const {
66 Args.addAllArgs(CmdArgs,
67 {options::OPT_P, options::OPT_D, options::OPT_U,
68 options::OPT_I, options::OPT_cpp, options::OPT_nocpp});
69}
70
71/// @C shouldLoopVersion
72///
73/// Check if Loop Versioning should be enabled.
74/// We look for the last of one of the following:
75/// -Ofast, -O4, -O<number> and -f[no-]version-loops-for-stride.
76/// Loop versioning is disabled if the last option is
77/// -fno-version-loops-for-stride.
78/// Loop versioning is enabled if the last option is one of:
79/// -floop-versioning
80/// -Ofast
81/// -O4
82/// -O3
83/// For all other cases, loop versioning is is disabled.
84///
85/// The gfortran compiler automatically enables the option for -O3 or -Ofast.
86///
87/// @return true if loop-versioning should be enabled, otherwise false.
88static bool shouldLoopVersion(const ArgList &Args) {
89 const Arg *LoopVersioningArg = Args.getLastArg(
90 options::OPT_Ofast, options::OPT_O, options::OPT_O4,
91 options::OPT_floop_versioning, options::OPT_fno_loop_versioning);
92 if (!LoopVersioningArg)
93 return false;
94
95 if (LoopVersioningArg->getOption().matches(options::OPT_fno_loop_versioning))
96 return false;
97
98 if (LoopVersioningArg->getOption().matches(options::OPT_floop_versioning))
99 return true;
100
101 if (LoopVersioningArg->getOption().matches(options::OPT_Ofast) ||
102 LoopVersioningArg->getOption().matches(options::OPT_O4))
103 return true;
104
105 if (LoopVersioningArg->getOption().matches(options::OPT_O)) {
106 StringRef S(LoopVersioningArg->getValue());
107 unsigned OptLevel = 0;
108 // Note -Os or Oz woould "fail" here, so return false. Which is the
109 // desiered behavior.
110 if (S.getAsInteger(10, OptLevel))
111 return false;
112
113 return OptLevel > 2;
114 }
115
116 llvm_unreachable("We should not end up here");
117 return false;
118}
119
120void Flang::addOtherOptions(const ArgList &Args, ArgStringList &CmdArgs) const {
121 Args.addAllArgs(CmdArgs,
122 {options::OPT_module_dir, options::OPT_fdebug_module_writer,
123 options::OPT_fintrinsic_modules_path, options::OPT_pedantic,
124 options::OPT_std_EQ, options::OPT_W_Joined,
125 options::OPT_fconvert_EQ, options::OPT_fpass_plugin_EQ,
126 options::OPT_funderscoring, options::OPT_fno_underscoring,
127 options::OPT_funsigned, options::OPT_fno_unsigned});
128
129 llvm::codegenoptions::DebugInfoKind DebugInfoKind;
130 if (Args.hasArg(options::OPT_gN_Group)) {
131 Arg *gNArg = Args.getLastArg(options::OPT_gN_Group);
132 DebugInfoKind = debugLevelToInfoKind(*gNArg);
133 } else if (Args.hasArg(options::OPT_g_Flag)) {
134 DebugInfoKind = llvm::codegenoptions::FullDebugInfo;
135 } else {
136 DebugInfoKind = llvm::codegenoptions::NoDebugInfo;
137 }
138 addDebugInfoKind(CmdArgs, DebugInfoKind);
139}
140
141void Flang::addCodegenOptions(const ArgList &Args,
142 ArgStringList &CmdArgs) const {
143 Arg *stackArrays =
144 Args.getLastArg(options::OPT_Ofast, options::OPT_fstack_arrays,
145 options::OPT_fno_stack_arrays);
146 if (stackArrays &&
147 !stackArrays->getOption().matches(options::OPT_fno_stack_arrays))
148 CmdArgs.push_back("-fstack-arrays");
149
150 if (shouldLoopVersion(Args))
151 CmdArgs.push_back("-fversion-loops-for-stride");
152
153 Args.addAllArgs(CmdArgs,
154 {options::OPT_flang_experimental_hlfir,
155 options::OPT_flang_deprecated_no_hlfir,
156 options::OPT_fno_ppc_native_vec_elem_order,
157 options::OPT_fppc_native_vec_elem_order,
158 options::OPT_ftime_report, options::OPT_ftime_report_EQ});
159}
160
161void Flang::addPicOptions(const ArgList &Args, ArgStringList &CmdArgs) const {
162 // ParsePICArgs parses -fPIC/-fPIE and their variants and returns a tuple of
163 // (RelocationModel, PICLevel, IsPIE).
164 llvm::Reloc::Model RelocationModel;
165 unsigned PICLevel;
166 bool IsPIE;
167 std::tie(RelocationModel, PICLevel, IsPIE) =
168 ParsePICArgs(getToolChain(), Args);
169
170 if (auto *RMName = RelocationModelName(RelocationModel)) {
171 CmdArgs.push_back("-mrelocation-model");
172 CmdArgs.push_back(RMName);
173 }
174 if (PICLevel > 0) {
175 CmdArgs.push_back("-pic-level");
176 CmdArgs.push_back(PICLevel == 1 ? "1" : "2");
177 if (IsPIE)
178 CmdArgs.push_back("-pic-is-pie");
179 }
180}
181
182void Flang::AddAArch64TargetArgs(const ArgList &Args,
183 ArgStringList &CmdArgs) const {
184 // Handle -msve_vector_bits=<bits>
185 if (Arg *A = Args.getLastArg(options::OPT_msve_vector_bits_EQ)) {
186 StringRef Val = A->getValue();
187 const Driver &D = getToolChain().getDriver();
188 if (Val == "128" || Val == "256" || Val == "512" || Val == "1024" ||
189 Val == "2048" || Val == "128+" || Val == "256+" || Val == "512+" ||
190 Val == "1024+" || Val == "2048+") {
191 unsigned Bits = 0;
192 if (!Val.consume_back("+")) {
193 [[maybe_unused]] bool Invalid = Val.getAsInteger(10, Bits);
194 assert(!Invalid && "Failed to parse value");
195 CmdArgs.push_back(
196 Args.MakeArgString("-mvscale-max=" + llvm::Twine(Bits / 128)));
197 }
198
199 [[maybe_unused]] bool Invalid = Val.getAsInteger(10, Bits);
200 assert(!Invalid && "Failed to parse value");
201 CmdArgs.push_back(
202 Args.MakeArgString("-mvscale-min=" + llvm::Twine(Bits / 128)));
203 // Silently drop requests for vector-length agnostic code as it's implied.
204 } else if (Val != "scalable")
205 // Handle the unsupported values passed to msve-vector-bits.
206 D.Diag(diag::err_drv_unsupported_option_argument)
207 << A->getSpelling() << Val;
208 }
209}
210
211void Flang::AddLoongArch64TargetArgs(const ArgList &Args,
212 ArgStringList &CmdArgs) const {
213 const Driver &D = getToolChain().getDriver();
214 // Currently, flang only support `-mabi=lp64d` in LoongArch64.
215 if (const Arg *A = Args.getLastArg(options::OPT_mabi_EQ)) {
216 StringRef V = A->getValue();
217 if (V != "lp64d") {
218 D.Diag(diag::err_drv_argument_not_allowed_with) << "-mabi" << V;
219 }
220 }
221
222 if (const Arg *A = Args.getLastArg(options::OPT_mannotate_tablejump,
223 options::OPT_mno_annotate_tablejump)) {
224 if (A->getOption().matches(options::OPT_mannotate_tablejump)) {
225 CmdArgs.push_back("-mllvm");
226 CmdArgs.push_back("-loongarch-annotate-tablejump");
227 }
228 }
229}
230
231void Flang::AddPPCTargetArgs(const ArgList &Args,
232 ArgStringList &CmdArgs) const {
233 const Driver &D = getToolChain().getDriver();
234 bool VecExtabi = false;
235
236 if (const Arg *A = Args.getLastArg(options::OPT_mabi_EQ)) {
237 StringRef V = A->getValue();
238 if (V == "vec-extabi")
239 VecExtabi = true;
240 else if (V == "vec-default")
241 VecExtabi = false;
242 else
243 D.Diag(diag::err_drv_unsupported_option_argument)
244 << A->getSpelling() << V;
245 }
246
247 const llvm::Triple &T = getToolChain().getTriple();
248 if (VecExtabi) {
249 if (!T.isOSAIX()) {
250 D.Diag(diag::err_drv_unsupported_opt_for_target)
251 << "-mabi=vec-extabi" << T.str();
252 }
253 CmdArgs.push_back("-mabi=vec-extabi");
254 }
255}
256
257void Flang::AddRISCVTargetArgs(const ArgList &Args,
258 ArgStringList &CmdArgs) const {
259 const llvm::Triple &Triple = getToolChain().getTriple();
260 // Handle -mrvv-vector-bits=<bits>
261 if (Arg *A = Args.getLastArg(options::OPT_mrvv_vector_bits_EQ)) {
262 StringRef Val = A->getValue();
263 const Driver &D = getToolChain().getDriver();
264
265 // Get minimum VLen from march.
266 unsigned MinVLen = 0;
267 std::string Arch = riscv::getRISCVArch(Args, Triple);
268 auto ISAInfo = llvm::RISCVISAInfo::parseArchString(
269 Arch, /*EnableExperimentalExtensions*/ true);
270 // Ignore parsing error.
271 if (!errorToBool(ISAInfo.takeError()))
272 MinVLen = (*ISAInfo)->getMinVLen();
273
274 // If the value is "zvl", use MinVLen from march. Otherwise, try to parse
275 // as integer as long as we have a MinVLen.
276 unsigned Bits = 0;
277 if (Val == "zvl" && MinVLen >= llvm::RISCV::RVVBitsPerBlock) {
278 Bits = MinVLen;
279 } else if (!Val.getAsInteger(10, Bits)) {
280 // Only accept power of 2 values beteen RVVBitsPerBlock and 65536 that
281 // at least MinVLen.
282 if (Bits < MinVLen || Bits < llvm::RISCV::RVVBitsPerBlock ||
283 Bits > 65536 || !llvm::isPowerOf2_32(Bits))
284 Bits = 0;
285 }
286
287 // If we got a valid value try to use it.
288 if (Bits != 0) {
289 unsigned VScaleMin = Bits / llvm::RISCV::RVVBitsPerBlock;
290 CmdArgs.push_back(
291 Args.MakeArgString("-mvscale-max=" + llvm::Twine(VScaleMin)));
292 CmdArgs.push_back(
293 Args.MakeArgString("-mvscale-min=" + llvm::Twine(VScaleMin)));
294 } else if (Val != "scalable") {
295 // Handle the unsupported values passed to mrvv-vector-bits.
296 D.Diag(diag::err_drv_unsupported_option_argument)
297 << A->getSpelling() << Val;
298 }
299 }
300}
301
302void Flang::AddX86_64TargetArgs(const ArgList &Args,
303 ArgStringList &CmdArgs) const {
304 if (Arg *A = Args.getLastArg(options::OPT_masm_EQ)) {
305 StringRef Value = A->getValue();
306 if (Value == "intel" || Value == "att") {
307 CmdArgs.push_back(Args.MakeArgString("-mllvm"));
308 CmdArgs.push_back(Args.MakeArgString("-x86-asm-syntax=" + Value));
309 } else {
310 getToolChain().getDriver().Diag(diag::err_drv_unsupported_option_argument)
311 << A->getSpelling() << Value;
312 }
313 }
314}
315
316static void addVSDefines(const ToolChain &TC, const ArgList &Args,
317 ArgStringList &CmdArgs) {
318
319 unsigned ver = 0;
320 const VersionTuple vt = TC.computeMSVCVersion(nullptr, Args);
321 ver = vt.getMajor() * 10000000 + vt.getMinor().value_or(0) * 100000 +
322 vt.getSubminor().value_or(0);
323 CmdArgs.push_back(Args.MakeArgString("-D_MSC_VER=" + Twine(ver / 100000)));
324 CmdArgs.push_back(Args.MakeArgString("-D_MSC_FULL_VER=" + Twine(ver)));
325 CmdArgs.push_back(Args.MakeArgString("-D_WIN32"));
326
327 const llvm::Triple &triple = TC.getTriple();
328 if (triple.isAArch64()) {
329 CmdArgs.push_back("-D_M_ARM64=1");
330 } else if (triple.isX86() && triple.isArch32Bit()) {
331 CmdArgs.push_back("-D_M_IX86=600");
332 } else if (triple.isX86() && triple.isArch64Bit()) {
333 CmdArgs.push_back("-D_M_X64=100");
334 } else {
335 llvm_unreachable(
336 "Flang on Windows only supports X86_32, X86_64 and AArch64");
337 }
338}
339
340static void processVSRuntimeLibrary(const ToolChain &TC, const ArgList &Args,
341 ArgStringList &CmdArgs) {
342 assert(TC.getTriple().isKnownWindowsMSVCEnvironment() &&
343 "can only add VS runtime library on Windows!");
344 // if -fno-fortran-main has been passed, skip linking Fortran_main.a
345 if (TC.getTriple().isKnownWindowsMSVCEnvironment()) {
346 CmdArgs.push_back(Args.MakeArgString(
347 "--dependent-lib=" + TC.getCompilerRTBasename(Args, "builtins")));
348 }
349 unsigned RTOptionID = options::OPT__SLASH_MT;
350 if (auto *rtl = Args.getLastArg(options::OPT_fms_runtime_lib_EQ)) {
351 RTOptionID = llvm::StringSwitch<unsigned>(rtl->getValue())
352 .Case("static", options::OPT__SLASH_MT)
353 .Case("static_dbg", options::OPT__SLASH_MTd)
354 .Case("dll", options::OPT__SLASH_MD)
355 .Case("dll_dbg", options::OPT__SLASH_MDd)
356 .Default(options::OPT__SLASH_MT);
357 }
358 switch (RTOptionID) {
359 case options::OPT__SLASH_MT:
360 CmdArgs.push_back("-D_MT");
361 CmdArgs.push_back("--dependent-lib=libcmt");
362 CmdArgs.push_back("--dependent-lib=FortranRuntime.static.lib");
363 CmdArgs.push_back("--dependent-lib=FortranDecimal.static.lib");
364 break;
365 case options::OPT__SLASH_MTd:
366 CmdArgs.push_back("-D_MT");
367 CmdArgs.push_back("-D_DEBUG");
368 CmdArgs.push_back("--dependent-lib=libcmtd");
369 CmdArgs.push_back("--dependent-lib=FortranRuntime.static_dbg.lib");
370 CmdArgs.push_back("--dependent-lib=FortranDecimal.static_dbg.lib");
371 break;
372 case options::OPT__SLASH_MD:
373 CmdArgs.push_back("-D_MT");
374 CmdArgs.push_back("-D_DLL");
375 CmdArgs.push_back("--dependent-lib=msvcrt");
376 CmdArgs.push_back("--dependent-lib=FortranRuntime.dynamic.lib");
377 CmdArgs.push_back("--dependent-lib=FortranDecimal.dynamic.lib");
378 break;
379 case options::OPT__SLASH_MDd:
380 CmdArgs.push_back("-D_MT");
381 CmdArgs.push_back("-D_DEBUG");
382 CmdArgs.push_back("-D_DLL");
383 CmdArgs.push_back("--dependent-lib=msvcrtd");
384 CmdArgs.push_back("--dependent-lib=FortranRuntime.dynamic_dbg.lib");
385 CmdArgs.push_back("--dependent-lib=FortranDecimal.dynamic_dbg.lib");
386 break;
387 }
388}
389
390void Flang::AddAMDGPUTargetArgs(const ArgList &Args,
391 ArgStringList &CmdArgs) const {
392 if (Arg *A = Args.getLastArg(options::OPT_mcode_object_version_EQ)) {
393 StringRef Val = A->getValue();
394 CmdArgs.push_back(Args.MakeArgString("-mcode-object-version=" + Val));
395 }
396
397 const ToolChain &TC = getToolChain();
399}
400
401void Flang::addTargetOptions(const ArgList &Args,
402 ArgStringList &CmdArgs) const {
403 const ToolChain &TC = getToolChain();
404 const llvm::Triple &Triple = TC.getEffectiveTriple();
405 const Driver &D = TC.getDriver();
406
407 std::string CPU = getCPUName(D, Args, Triple);
408 if (!CPU.empty()) {
409 CmdArgs.push_back("-target-cpu");
410 CmdArgs.push_back(Args.MakeArgString(CPU));
411 }
412
413 addOutlineAtomicsArgs(D, getToolChain(), Args, CmdArgs, Triple);
414
415 // Add the target features.
416 switch (TC.getArch()) {
417 default:
418 break;
419 case llvm::Triple::aarch64:
420 getTargetFeatures(D, Triple, Args, CmdArgs, /*ForAs*/ false);
421 AddAArch64TargetArgs(Args, CmdArgs);
422 break;
423
424 case llvm::Triple::r600:
425 case llvm::Triple::amdgcn:
426 getTargetFeatures(D, Triple, Args, CmdArgs, /*ForAs*/ false);
427 AddAMDGPUTargetArgs(Args, CmdArgs);
428 break;
429 case llvm::Triple::riscv64:
430 getTargetFeatures(D, Triple, Args, CmdArgs, /*ForAs*/ false);
431 AddRISCVTargetArgs(Args, CmdArgs);
432 break;
433 case llvm::Triple::x86_64:
434 getTargetFeatures(D, Triple, Args, CmdArgs, /*ForAs*/ false);
435 AddX86_64TargetArgs(Args, CmdArgs);
436 break;
437 case llvm::Triple::ppc:
438 case llvm::Triple::ppc64:
439 case llvm::Triple::ppc64le:
440 AddPPCTargetArgs(Args, CmdArgs);
441 break;
442 case llvm::Triple::loongarch64:
443 getTargetFeatures(D, Triple, Args, CmdArgs, /*ForAs*/ false);
444 AddLoongArch64TargetArgs(Args, CmdArgs);
445 break;
446 }
447
448 if (Arg *A = Args.getLastArg(options::OPT_fveclib)) {
449 StringRef Name = A->getValue();
450 if (Name == "SVML") {
451 if (Triple.getArch() != llvm::Triple::x86 &&
452 Triple.getArch() != llvm::Triple::x86_64)
453 D.Diag(diag::err_drv_unsupported_opt_for_target)
454 << Name << Triple.getArchName();
455 } else if (Name == "LIBMVEC-X86") {
456 if (Triple.getArch() != llvm::Triple::x86 &&
457 Triple.getArch() != llvm::Triple::x86_64)
458 D.Diag(diag::err_drv_unsupported_opt_for_target)
459 << Name << Triple.getArchName();
460 } else if (Name == "SLEEF" || Name == "ArmPL") {
461 if (Triple.getArch() != llvm::Triple::aarch64 &&
462 Triple.getArch() != llvm::Triple::aarch64_be)
463 D.Diag(diag::err_drv_unsupported_opt_for_target)
464 << Name << Triple.getArchName();
465 }
466
467 if (Triple.isOSDarwin()) {
468 // flang doesn't currently suport nostdlib, nodefaultlibs. Adding these
469 // here incase they are added someday
470 if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nodefaultlibs)) {
471 if (A->getValue() == StringRef{"Accelerate"}) {
472 CmdArgs.push_back("-framework");
473 CmdArgs.push_back("Accelerate");
474 }
475 }
476 }
477 A->render(Args, CmdArgs);
478 }
479
480 if (Triple.isKnownWindowsMSVCEnvironment()) {
481 processVSRuntimeLibrary(TC, Args, CmdArgs);
482 addVSDefines(TC, Args, CmdArgs);
483 }
484
485 // TODO: Add target specific flags, ABI, mtune option etc.
486 if (const Arg *A = Args.getLastArg(options::OPT_mtune_EQ)) {
487 CmdArgs.push_back("-tune-cpu");
488 if (A->getValue() == StringRef{"native"})
489 CmdArgs.push_back(Args.MakeArgString(llvm::sys::getHostCPUName()));
490 else
491 CmdArgs.push_back(A->getValue());
492 }
493}
494
495void Flang::addOffloadOptions(Compilation &C, const InputInfoList &Inputs,
496 const JobAction &JA, const ArgList &Args,
497 ArgStringList &CmdArgs) const {
498 bool IsOpenMPDevice = JA.isDeviceOffloading(Action::OFK_OpenMP);
499 bool IsHostOffloadingAction = JA.isHostOffloading(Action::OFK_OpenMP) ||
500 JA.isHostOffloading(C.getActiveOffloadKinds());
501
502 // Skips the primary input file, which is the input file that the compilation
503 // proccess will be executed upon (e.g. the host bitcode file) and
504 // adds other secondary input (e.g. device bitcode files for embedding to the
505 // -fembed-offload-object argument or the host IR file for proccessing
506 // during device compilation to the fopenmp-host-ir-file-path argument via
507 // OpenMPDeviceInput). This is condensed logic from the ConstructJob
508 // function inside of the Clang driver for pushing on further input arguments
509 // needed for offloading during various phases of compilation.
510 for (size_t i = 1; i < Inputs.size(); ++i) {
511 if (Inputs[i].getType() == types::TY_Nothing) {
512 // contains nothing, so it's skippable
513 } else if (IsHostOffloadingAction) {
514 CmdArgs.push_back(
515 Args.MakeArgString("-fembed-offload-object=" +
516 getToolChain().getInputFilename(Inputs[i])));
517 } else if (IsOpenMPDevice) {
518 if (Inputs[i].getFilename()) {
519 CmdArgs.push_back("-fopenmp-host-ir-file-path");
520 CmdArgs.push_back(Args.MakeArgString(Inputs[i].getFilename()));
521 } else {
522 llvm_unreachable("missing openmp host-ir file for device offloading");
523 }
524 } else {
525 llvm_unreachable(
526 "unexpectedly given multiple inputs or given unknown input");
527 }
528 }
529
530 if (IsOpenMPDevice) {
531 // -fopenmp-is-target-device is passed along to tell the frontend that it is
532 // generating code for a device, so that only the relevant code is emitted.
533 CmdArgs.push_back("-fopenmp-is-target-device");
534
535 // When in OpenMP offloading mode, enable debugging on the device.
536 Args.AddAllArgs(CmdArgs, options::OPT_fopenmp_target_debug_EQ);
537 if (Args.hasFlag(options::OPT_fopenmp_target_debug,
538 options::OPT_fno_openmp_target_debug, /*Default=*/false))
539 CmdArgs.push_back("-fopenmp-target-debug");
540
541 // When in OpenMP offloading mode, forward assumptions information about
542 // thread and team counts in the device.
543 if (Args.hasFlag(options::OPT_fopenmp_assume_teams_oversubscription,
544 options::OPT_fno_openmp_assume_teams_oversubscription,
545 /*Default=*/false))
546 CmdArgs.push_back("-fopenmp-assume-teams-oversubscription");
547 if (Args.hasFlag(options::OPT_fopenmp_assume_threads_oversubscription,
548 options::OPT_fno_openmp_assume_threads_oversubscription,
549 /*Default=*/false))
550 CmdArgs.push_back("-fopenmp-assume-threads-oversubscription");
551 if (Args.hasArg(options::OPT_fopenmp_assume_no_thread_state))
552 CmdArgs.push_back("-fopenmp-assume-no-thread-state");
553 if (Args.hasArg(options::OPT_fopenmp_assume_no_nested_parallelism))
554 CmdArgs.push_back("-fopenmp-assume-no-nested-parallelism");
555 if (Args.hasArg(options::OPT_nogpulib))
556 CmdArgs.push_back("-nogpulib");
557 }
558
559 addOpenMPHostOffloadingArgs(C, JA, Args, CmdArgs);
560}
561
562static void addFloatingPointOptions(const Driver &D, const ArgList &Args,
563 ArgStringList &CmdArgs) {
564 StringRef FPContract;
565 bool HonorINFs = true;
566 bool HonorNaNs = true;
567 bool ApproxFunc = false;
568 bool SignedZeros = true;
569 bool AssociativeMath = false;
570 bool ReciprocalMath = false;
571
572 if (const Arg *A = Args.getLastArg(options::OPT_ffp_contract)) {
573 const StringRef Val = A->getValue();
574 if (Val == "fast" || Val == "off") {
575 FPContract = Val;
576 } else if (Val == "on") {
577 // Warn instead of error because users might have makefiles written for
578 // gfortran (which accepts -ffp-contract=on)
579 D.Diag(diag::warn_drv_unsupported_option_for_flang)
580 << Val << A->getOption().getName() << "off";
581 FPContract = "off";
582 } else
583 // Clang's "fast-honor-pragmas" option is not supported because it is
584 // non-standard
585 D.Diag(diag::err_drv_unsupported_option_argument)
586 << A->getSpelling() << Val;
587 }
588
589 for (const Arg *A : Args) {
590 auto optId = A->getOption().getID();
591 switch (optId) {
592 // if this isn't an FP option, skip the claim below
593 default:
594 continue;
595
596 case options::OPT_fhonor_infinities:
597 HonorINFs = true;
598 break;
599 case options::OPT_fno_honor_infinities:
600 HonorINFs = false;
601 break;
602 case options::OPT_fhonor_nans:
603 HonorNaNs = true;
604 break;
605 case options::OPT_fno_honor_nans:
606 HonorNaNs = false;
607 break;
608 case options::OPT_fapprox_func:
609 ApproxFunc = true;
610 break;
611 case options::OPT_fno_approx_func:
612 ApproxFunc = false;
613 break;
614 case options::OPT_fsigned_zeros:
615 SignedZeros = true;
616 break;
617 case options::OPT_fno_signed_zeros:
618 SignedZeros = false;
619 break;
620 case options::OPT_fassociative_math:
621 AssociativeMath = true;
622 break;
623 case options::OPT_fno_associative_math:
624 AssociativeMath = false;
625 break;
626 case options::OPT_freciprocal_math:
627 ReciprocalMath = true;
628 break;
629 case options::OPT_fno_reciprocal_math:
630 ReciprocalMath = false;
631 break;
632 case options::OPT_Ofast:
633 [[fallthrough]];
634 case options::OPT_ffast_math:
635 HonorINFs = false;
636 HonorNaNs = false;
637 AssociativeMath = true;
638 ReciprocalMath = true;
639 ApproxFunc = true;
640 SignedZeros = false;
641 FPContract = "fast";
642 break;
643 case options::OPT_fno_fast_math:
644 HonorINFs = true;
645 HonorNaNs = true;
646 AssociativeMath = false;
647 ReciprocalMath = false;
648 ApproxFunc = false;
649 SignedZeros = true;
650 // -fno-fast-math should undo -ffast-math so I return FPContract to the
651 // default. It is important to check it is "fast" (the default) so that
652 // --ffp-contract=off -fno-fast-math --> -ffp-contract=off
653 if (FPContract == "fast")
654 FPContract = "";
655 break;
656 }
657
658 // If we handled this option claim it
659 A->claim();
660 }
661
662 if (!HonorINFs && !HonorNaNs && AssociativeMath && ReciprocalMath &&
663 ApproxFunc && !SignedZeros &&
664 (FPContract == "fast" || FPContract.empty())) {
665 CmdArgs.push_back("-ffast-math");
666 return;
667 }
668
669 if (!FPContract.empty())
670 CmdArgs.push_back(Args.MakeArgString("-ffp-contract=" + FPContract));
671
672 if (!HonorINFs)
673 CmdArgs.push_back("-menable-no-infs");
674
675 if (!HonorNaNs)
676 CmdArgs.push_back("-menable-no-nans");
677
678 if (ApproxFunc)
679 CmdArgs.push_back("-fapprox-func");
680
681 if (!SignedZeros)
682 CmdArgs.push_back("-fno-signed-zeros");
683
684 if (AssociativeMath && !SignedZeros)
685 CmdArgs.push_back("-mreassociate");
686
687 if (ReciprocalMath)
688 CmdArgs.push_back("-freciprocal-math");
689}
690
691static void renderRemarksOptions(const ArgList &Args, ArgStringList &CmdArgs,
692 const InputInfo &Input) {
693 StringRef Format = "yaml";
694 if (const Arg *A = Args.getLastArg(options::OPT_fsave_optimization_record_EQ))
695 Format = A->getValue();
696
697 CmdArgs.push_back("-opt-record-file");
698
699 const Arg *A = Args.getLastArg(options::OPT_foptimization_record_file_EQ);
700 if (A) {
701 CmdArgs.push_back(A->getValue());
702 } else {
704
705 if (Args.hasArg(options::OPT_c) || Args.hasArg(options::OPT_S)) {
706 if (Arg *FinalOutput = Args.getLastArg(options::OPT_o))
707 F = FinalOutput->getValue();
708 }
709
710 if (F.empty()) {
711 // Use the input filename.
712 F = llvm::sys::path::stem(Input.getBaseInput());
713 }
714
715 SmallString<32> Extension;
716 Extension += "opt.";
717 Extension += Format;
718
719 llvm::sys::path::replace_extension(F, Extension);
720 CmdArgs.push_back(Args.MakeArgString(F));
721 }
722
723 if (const Arg *A =
724 Args.getLastArg(options::OPT_foptimization_record_passes_EQ)) {
725 CmdArgs.push_back("-opt-record-passes");
726 CmdArgs.push_back(A->getValue());
727 }
728
729 if (!Format.empty()) {
730 CmdArgs.push_back("-opt-record-format");
731 CmdArgs.push_back(Format.data());
732 }
733}
734
736 const InputInfo &Output, const InputInfoList &Inputs,
737 const ArgList &Args, const char *LinkingOutput) const {
738 const auto &TC = getToolChain();
739 const llvm::Triple &Triple = TC.getEffectiveTriple();
740 const std::string &TripleStr = Triple.getTriple();
741
742 const Driver &D = TC.getDriver();
743 ArgStringList CmdArgs;
744 DiagnosticsEngine &Diags = D.getDiags();
745
746 // Invoke ourselves in -fc1 mode.
747 CmdArgs.push_back("-fc1");
748
749 // Add the "effective" target triple.
750 CmdArgs.push_back("-triple");
751 CmdArgs.push_back(Args.MakeArgString(TripleStr));
752
753 if (isa<PreprocessJobAction>(JA)) {
754 CmdArgs.push_back("-E");
755 if (Args.getLastArg(options::OPT_dM)) {
756 CmdArgs.push_back("-dM");
757 }
758 } else if (isa<CompileJobAction>(JA) || isa<BackendJobAction>(JA)) {
759 if (JA.getType() == types::TY_Nothing) {
760 CmdArgs.push_back("-fsyntax-only");
761 } else if (JA.getType() == types::TY_AST) {
762 CmdArgs.push_back("-emit-ast");
763 } else if (JA.getType() == types::TY_LLVM_IR ||
764 JA.getType() == types::TY_LTO_IR) {
765 CmdArgs.push_back("-emit-llvm");
766 } else if (JA.getType() == types::TY_LLVM_BC ||
767 JA.getType() == types::TY_LTO_BC) {
768 CmdArgs.push_back("-emit-llvm-bc");
769 } else if (JA.getType() == types::TY_PP_Asm) {
770 CmdArgs.push_back("-S");
771 } else {
772 assert(false && "Unexpected output type!");
773 }
774 } else if (isa<AssembleJobAction>(JA)) {
775 CmdArgs.push_back("-emit-obj");
776 } else if (isa<PrecompileJobAction>(JA)) {
777 // The precompile job action is only needed for options such as -mcpu=help.
778 // Those will already have been handled by the fc1 driver.
779 } else {
780 assert(false && "Unexpected action class for Flang tool.");
781 }
782
783 const InputInfo &Input = Inputs[0];
784 types::ID InputType = Input.getType();
785
786 // Add preprocessing options like -I, -D, etc. if we are using the
787 // preprocessor (i.e. skip when dealing with e.g. binary files).
789 addPreprocessingOptions(Args, CmdArgs);
790
791 addFortranDialectOptions(Args, CmdArgs);
792
793 // 'flang -E' always produces output that is suitable for use as fixed form
794 // Fortran. However it is only valid free form source if the original is also
795 // free form.
796 if (InputType == types::TY_PP_Fortran &&
797 !Args.getLastArg(options::OPT_ffixed_form, options::OPT_ffree_form))
798 CmdArgs.push_back("-ffixed-form");
799
800 handleColorDiagnosticsArgs(D, Args, CmdArgs);
801
802 // LTO mode is parsed by the Clang driver library.
803 LTOKind LTOMode = D.getLTOMode();
804 assert(LTOMode != LTOK_Unknown && "Unknown LTO mode.");
805 if (LTOMode == LTOK_Full)
806 CmdArgs.push_back("-flto=full");
807 else if (LTOMode == LTOK_Thin) {
808 Diags.Report(
810 "the option '-flto=thin' is a work in progress"));
811 CmdArgs.push_back("-flto=thin");
812 }
813
814 // -fPIC and related options.
815 addPicOptions(Args, CmdArgs);
816
817 // Floating point related options
818 addFloatingPointOptions(D, Args, CmdArgs);
819
820 // Add target args, features, etc.
821 addTargetOptions(Args, CmdArgs);
822
823 llvm::Reloc::Model RelocationModel =
824 std::get<0>(ParsePICArgs(getToolChain(), Args));
825 // Add MCModel information
826 addMCModel(D, Args, Triple, RelocationModel, CmdArgs);
827
828 // Add Codegen options
829 addCodegenOptions(Args, CmdArgs);
830
831 // Add R Group options
832 Args.AddAllArgs(CmdArgs, options::OPT_R_Group);
833
834 // Remarks can be enabled with any of the `-f.*optimization-record.*` flags.
835 if (willEmitRemarks(Args))
836 renderRemarksOptions(Args, CmdArgs, Input);
837
838 // Add other compile options
839 addOtherOptions(Args, CmdArgs);
840
841 // Disable all warnings
842 // TODO: Handle interactions between -w, -pedantic, -Wall, -WOption
843 Args.AddLastArg(CmdArgs, options::OPT_w);
844
845 // Forward flags for OpenMP. We don't do this if the current action is an
846 // device offloading action other than OpenMP.
847 if (Args.hasFlag(options::OPT_fopenmp, options::OPT_fopenmp_EQ,
848 options::OPT_fno_openmp, false) &&
851 switch (D.getOpenMPRuntime(Args)) {
854 // Clang can generate useful OpenMP code for these two runtime libraries.
855 CmdArgs.push_back("-fopenmp");
856 Args.AddAllArgs(CmdArgs, options::OPT_fopenmp_version_EQ);
857
858 if (Args.hasArg(options::OPT_fopenmp_force_usm))
859 CmdArgs.push_back("-fopenmp-force-usm");
860 // TODO: OpenMP support isn't "done" yet, so for now we warn that it
861 // is experimental.
862 D.Diag(diag::warn_openmp_experimental);
863
864 // FIXME: Clang supports a whole bunch more flags here.
865 break;
866 default:
867 // By default, if Clang doesn't know how to generate useful OpenMP code
868 // for a specific runtime library, we just don't pass the '-fopenmp' flag
869 // down to the actual compilation.
870 // FIXME: It would be better to have a mode which *only* omits IR
871 // generation based on the OpenMP support so that we get consistent
872 // semantic analysis, etc.
873 const Arg *A = Args.getLastArg(options::OPT_fopenmp_EQ);
874 D.Diag(diag::warn_drv_unsupported_openmp_library)
875 << A->getSpelling() << A->getValue();
876 break;
877 }
878 }
879
880 // Pass the path to compiler resource files.
881 CmdArgs.push_back("-resource-dir");
882 CmdArgs.push_back(D.ResourceDir.c_str());
883
884 // Offloading related options
885 addOffloadOptions(C, Inputs, JA, Args, CmdArgs);
886
887 // Forward -Xflang arguments to -fc1
888 Args.AddAllArgValues(CmdArgs, options::OPT_Xflang);
889
891 getFramePointerKind(Args, Triple);
892
893 const char *FPKeepKindStr = nullptr;
894 switch (FPKeepKind) {
896 FPKeepKindStr = "-mframe-pointer=none";
897 break;
899 FPKeepKindStr = "-mframe-pointer=reserved";
900 break;
902 FPKeepKindStr = "-mframe-pointer=non-leaf";
903 break;
905 FPKeepKindStr = "-mframe-pointer=all";
906 break;
907 }
908 assert(FPKeepKindStr && "unknown FramePointerKind");
909 CmdArgs.push_back(FPKeepKindStr);
910
911 // Forward -mllvm options to the LLVM option parser. In practice, this means
912 // forwarding to `-fc1` as that's where the LLVM parser is run.
913 for (const Arg *A : Args.filtered(options::OPT_mllvm)) {
914 A->claim();
915 A->render(Args, CmdArgs);
916 }
917
918 for (const Arg *A : Args.filtered(options::OPT_mmlir)) {
919 A->claim();
920 A->render(Args, CmdArgs);
921 }
922
923 // Remove any unsupported gfortran diagnostic options
924 for (const Arg *A : Args.filtered(options::OPT_flang_ignored_w_Group)) {
925 A->claim();
926 D.Diag(diag::warn_drv_unsupported_diag_option_for_flang)
927 << A->getOption().getName();
928 }
929
930 // Optimization level for CodeGen.
931 if (const Arg *A = Args.getLastArg(options::OPT_O_Group)) {
932 if (A->getOption().matches(options::OPT_O4)) {
933 CmdArgs.push_back("-O3");
934 D.Diag(diag::warn_O4_is_O3);
935 } else if (A->getOption().matches(options::OPT_Ofast)) {
936 CmdArgs.push_back("-O3");
937 } else {
938 A->render(Args, CmdArgs);
939 }
940 }
941
943
944 assert((Output.isFilename() || Output.isNothing()) && "Invalid output.");
945 if (Output.isFilename()) {
946 CmdArgs.push_back("-o");
947 CmdArgs.push_back(Output.getFilename());
948 }
949
950 if (Args.getLastArg(options::OPT_save_temps_EQ))
951 Args.AddLastArg(CmdArgs, options::OPT_save_temps_EQ);
952
953 addDashXForInput(Args, Input, CmdArgs);
954
955 bool FRecordCmdLine = false;
956 bool GRecordCmdLine = false;
957 if (shouldRecordCommandLine(TC, Args, FRecordCmdLine, GRecordCmdLine)) {
958 const char *CmdLine = renderEscapedCommandLine(TC, Args);
959 if (FRecordCmdLine) {
960 CmdArgs.push_back("-record-command-line");
961 CmdArgs.push_back(CmdLine);
962 }
963 if (TC.UseDwarfDebugFlags() || GRecordCmdLine) {
964 CmdArgs.push_back("-dwarf-debug-flags");
965 CmdArgs.push_back(CmdLine);
966 }
967 }
968
969 // The input could be Ty_Nothing when "querying" options such as -mcpu=help
970 // are used.
971 ArrayRef<InputInfo> FrontendInputs = Input;
972 if (Input.isNothing())
973 FrontendInputs = {};
974
975 for (const InputInfo &Input : FrontendInputs) {
976 if (Input.isFilename())
977 CmdArgs.push_back(Input.getFilename());
978 else
979 Input.getInputArg().renderAsInput(Args, CmdArgs);
980 }
981
982 const char *Exec = Args.MakeArgString(D.GetProgramPath("flang", TC));
983 C.addCommand(std::make_unique<Command>(JA, *this,
985 Exec, CmdArgs, Inputs, Output));
986}
987
988Flang::Flang(const ToolChain &TC) : Tool("flang", "flang frontend", TC) {}
989
#define V(N, I)
Definition: ASTContext.h:3453
const Decl * D
static void addDashXForInput(const ArgList &Args, const InputInfo &Input, ArgStringList &CmdArgs)
Add -x lang to CmdArgs for Input.
Definition: Clang.cpp:548
static void renderRemarksOptions(const ArgList &Args, ArgStringList &CmdArgs, const llvm::Triple &Triple, const InputInfo &Input, const InputInfo &Output, const JobAction &JA)
Definition: Clang.cpp:1401
clang::CodeGenOptions::FramePointerKind getFramePointerKind(const llvm::opt::ArgList &Args, const llvm::Triple &Triple)
Definition: CommonArgs.cpp:216
static void processVSRuntimeLibrary(const ToolChain &TC, const ArgList &Args, ArgStringList &CmdArgs)
Definition: Flang.cpp:340
static void addVSDefines(const ToolChain &TC, const ArgList &Args, ArgStringList &CmdArgs)
Definition: Flang.cpp:316
static bool shouldLoopVersion(const ArgList &Args)
@C shouldLoopVersion
Definition: Flang.cpp:88
static void addDashXForInput(const ArgList &Args, const InputInfo &Input, ArgStringList &CmdArgs)
Add -x lang to CmdArgs for Input.
Definition: Flang.cpp:30
static void addFloatingPointOptions(const Driver &D, const ArgList &Args, ArgStringList &CmdArgs)
Definition: Flang.cpp:562
int64_t getID() const
Definition: DeclBase.cpp:1175
Concrete class used by the front-end to report problems and issues.
Definition: Diagnostic.h:231
DiagnosticBuilder Report(SourceLocation Loc, unsigned DiagID)
Issue the message to the client.
Definition: Diagnostic.h:1493
unsigned getCustomDiagID(Level L, const char(&FormatString)[N])
Return an ID for a diagnostic with the specified format string and level.
Definition: Diagnostic.h:896
types::ID getType() const
Definition: Action.h:149
bool isHostOffloading(unsigned int OKind) const
Check if this action have any offload kinds.
Definition: Action.h:219
bool isDeviceOffloading(OffloadKind OKind) const
Definition: Action.h:222
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
DiagnosticBuilder Diag(unsigned DiagID) const
Definition: Driver.h:144
@ 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
InputInfo - Wrapper for information about an input source.
Definition: InputInfo.h:22
const char * getBaseInput() const
Definition: InputInfo.h:78
const llvm::opt::Arg & getInputArg() const
Definition: InputInfo.h:87
const char * getFilename() const
Definition: InputInfo.h:83
bool isNothing() const
Definition: InputInfo.h:74
bool isFilename() const
Definition: InputInfo.h:75
types::ID getType() const
Definition: InputInfo.h:77
ToolChain - Access to tools for a single platform.
Definition: ToolChain.h:92
llvm::Triple::ArchType getArch() const
Definition: ToolChain.h:268
const Driver & getDriver() const
Definition: ToolChain.h:252
const llvm::Triple & getEffectiveTriple() const
Get the toolchain's effective clang triple.
Definition: ToolChain.h:282
const llvm::Triple & getTriple() const
Definition: ToolChain.h:254
virtual bool UseDwarfDebugFlags() const
UseDwarfDebugFlags - Embed the compile options to clang into the Dwarf compile unit information.
Definition: ToolChain.h:579
virtual VersionTuple computeMSVCVersion(const Driver *D, const llvm::opt::ArgList &Args) const
On Windows, returns the MSVC compatibility version.
Definition: ToolChain.cpp:1525
virtual void addClangTargetOptions(const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args, Action::OffloadKind DeviceOffloadKind) const
Add options that need to be passed to cc1 for this target.
Definition: ToolChain.cpp:1172
std::string getCompilerRTBasename(const llvm::opt::ArgList &Args, StringRef Component, FileType Type=ToolChain::FT_Static) const
Definition: ToolChain.cpp:725
Tool - Information on a specific compilation tool.
Definition: Tool.h:32
const ToolChain & getToolChain() const
Definition: Tool.h:52
Flang(const ToolChain &TC)
Definition: Flang.cpp:988
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: Flang.cpp:735
std::string getRISCVArch(const llvm::opt::ArgList &Args, const llvm::Triple &Triple)
Definition: RISCV.cpp:249
void addMCModel(const Driver &D, const llvm::opt::ArgList &Args, const llvm::Triple &Triple, const llvm::Reloc::Model &RelocationModel, llvm::opt::ArgStringList &CmdArgs)
void addOutlineAtomicsArgs(const Driver &D, const ToolChain &TC, const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs, const llvm::Triple &Triple)
void getTargetFeatures(const Driver &D, const llvm::Triple &Triple, const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs, bool ForAS, bool IsAux=false)
void handleColorDiagnosticsArgs(const Driver &D, const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs)
Handle the -f{no}-color-diagnostics and -f{no}-diagnostics-colors options.
std::string getCPUName(const Driver &D, const llvm::opt::ArgList &Args, const llvm::Triple &T, bool FromAs=false)
bool shouldRecordCommandLine(const ToolChain &TC, const llvm::opt::ArgList &Args, bool &FRecordCommandLine, bool &GRecordCommandLine)
Check if the command line should be recorded in the object file.
void addDebugInfoKind(llvm::opt::ArgStringList &CmdArgs, llvm::codegenoptions::DebugInfoKind DebugInfoKind)
llvm::codegenoptions::DebugInfoKind debugLevelToInfoKind(const llvm::opt::Arg &A)
const char * renderEscapedCommandLine(const ToolChain &TC, const llvm::opt::ArgList &Args)
Join the args in the given ArgList, escape spaces and backslashes and return the joined string.
void renderCommonIntegerOverflowOptions(const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs)
std::tuple< llvm::Reloc::Model, unsigned, bool > ParsePICArgs(const ToolChain &ToolChain, const llvm::opt::ArgList &Args)
const char * RelocationModelName(llvm::Reloc::Model Model)
void addOpenMPHostOffloadingArgs(const Compilation &C, const JobAction &JA, const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs)
Adds offloading options for OpenMP host compilation to CmdArgs.
ID getPreprocessedType(ID Id)
getPreprocessedType - Get the ID of the type for this input when it has been preprocessed,...
Definition: Types.cpp:53
const char * getTypeName(ID Id)
getTypeName - Return the name of the type for Id.
Definition: Types.cpp:49
LTOKind
Describes the kind of LTO mode selected via -f(no-)?lto(=.*)? options.
Definition: Driver.h:58
@ LTOK_Unknown
Definition: Driver.h:62
bool willEmitRemarks(const llvm::opt::ArgList &Args)
The JSON file list parser is used to communicate input to InstallAPI.
const FunctionProtoType * T
static constexpr ResponseFileSupport AtFileUTF8()
Definition: Job.h:85