clang 23.0.0git
CommonArgs.h
Go to the documentation of this file.
1//===--- CommonArgs.h - Args handling for multiple toolchains ---*- 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#ifndef LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_COMMONARGS_H
10#define LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_COMMONARGS_H
11
13#include "clang/Driver/Driver.h"
16#include "clang/Driver/Tool.h"
18#include "llvm/ADT/StringRef.h"
19#include "llvm/Option/Arg.h"
20#include "llvm/Option/ArgList.h"
21#include "llvm/Support/CodeGen.h"
22
23namespace clang {
24namespace driver {
25namespace tools {
26
27void addPathIfExists(const Driver &D, const Twine &Path,
29
30void AddLinkerInputs(const ToolChain &TC, const InputInfoList &Inputs,
31 const llvm::opt::ArgList &Args,
32 llvm::opt::ArgStringList &CmdArgs, const JobAction &JA);
33
34const char *getLDMOption(const llvm::Triple &T, const llvm::opt::ArgList &Args);
35
37 const llvm::opt::ArgList &Args,
38 llvm::opt::ArgStringList &CmdArgs);
39
40void claimNoWarnArgs(const llvm::opt::ArgList &Args);
41
42bool addSanitizerRuntimes(const ToolChain &TC, const llvm::opt::ArgList &Args,
43 llvm::opt::ArgStringList &CmdArgs);
44
46 const llvm::opt::ArgList &Args,
47 llvm::opt::ArgStringList &CmdArgs);
48
49bool addXRayRuntime(const ToolChain &TC, const llvm::opt::ArgList &Args,
50 llvm::opt::ArgStringList &CmdArgs);
51
52void linkXRayRuntimeDeps(const ToolChain &TC, const llvm::opt::ArgList &Args,
53 llvm::opt::ArgStringList &CmdArgs);
54
55void AddRunTimeLibs(const ToolChain &TC, const Driver &D,
56 llvm::opt::ArgStringList &CmdArgs,
57 const llvm::opt::ArgList &Args);
58
60 const JobAction &JA,
61 const InputInfoList &Inputs,
62 const llvm::opt::ArgList &DriverArgs,
63 llvm::opt::ArgStringList &CmdArgs,
64 StringRef Arch, StringRef Target,
65 bool isBitCodeSDL);
66void AddStaticDeviceLibs(Compilation *C, const Tool *T, const JobAction *JA,
67 const InputInfoList *Inputs, const Driver &D,
68 const llvm::opt::ArgList &DriverArgs,
69 llvm::opt::ArgStringList &CmdArgs, StringRef Arch,
70 StringRef Target, bool isBitCodeSDL);
71
72const char *SplitDebugName(const JobAction &JA, const llvm::opt::ArgList &Args,
73 const InputInfo &Input, const InputInfo &Output);
74
75void SplitDebugInfo(const ToolChain &TC, Compilation &C, const Tool &T,
76 const JobAction &JA, const llvm::opt::ArgList &Args,
77 const InputInfo &Output, const char *OutFile);
78
79void addDTLTOOptions(const ToolChain &ToolChain, const llvm::opt::ArgList &Args,
80 llvm::opt::ArgStringList &CmdArgs);
81
82void addLTOOptions(const ToolChain &ToolChain, const llvm::opt::ArgList &Args,
83 llvm::opt::ArgStringList &CmdArgs, const InputInfo &Output,
84 const InputInfoList &Inputs, bool IsThinLTO);
85
86const char *RelocationModelName(llvm::Reloc::Model Model);
87
88std::tuple<llvm::Reloc::Model, unsigned, bool>
89ParsePICArgs(const ToolChain &ToolChain, const llvm::opt::ArgList &Args);
90
91bool getStaticPIE(const llvm::opt::ArgList &Args, const ToolChain &TC);
92
94 const llvm::opt::ArgList &Args);
95
96void addDebugInfoKind(llvm::opt::ArgStringList &CmdArgs,
97 llvm::codegenoptions::DebugInfoKind DebugInfoKind);
98
99llvm::codegenoptions::DebugInfoKind
100debugLevelToInfoKind(const llvm::opt::Arg &A);
101
102// Extract the integer N from a string spelled "-dwarf-N", returning 0
103// on mismatch. The StringRef input (rather than an Arg) allows
104// for use by the "-Xassembler" option parser.
105unsigned DwarfVersionNum(StringRef ArgValue);
106// Find a DWARF format version option.
107// This function is a complementary for DwarfVersionNum().
108const llvm::opt::Arg *getDwarfNArg(const llvm::opt::ArgList &Args);
109unsigned getDwarfVersion(const ToolChain &TC, const llvm::opt::ArgList &Args);
110
112
114 const llvm::opt::ArgList &Args,
115 llvm::opt::Arg *&Arg);
116
117bool checkDebugInfoOption(const llvm::opt::Arg *A,
118 const llvm::opt::ArgList &Args, const Driver &D,
119 const ToolChain &TC);
120
122 const llvm::opt::ArgList &Args,
123 llvm::opt::ArgStringList &CmdArgs);
124
126 const llvm::opt::ArgList &Args,
127 llvm::opt::ArgStringList &CmdArgs);
128
129void addArchSpecificRPath(const ToolChain &TC, const llvm::opt::ArgList &Args,
130 llvm::opt::ArgStringList &CmdArgs);
132 const llvm::opt::ArgList &Args,
133 llvm::opt::ArgStringList &CmdArgs);
134/// Returns true, if an OpenMP runtime has been added.
135bool addOpenMPRuntime(const Compilation &C, llvm::opt::ArgStringList &CmdArgs,
136 const ToolChain &TC, const llvm::opt::ArgList &Args,
137 bool ForceStaticHostRuntime = false,
138 bool IsOffloadingHost = false, bool GompNeedsRT = false);
139
140/// Adds offloading options for OpenMP host compilation to \p CmdArgs.
142 const llvm::opt::ArgList &Args,
143 llvm::opt::ArgStringList &CmdArgs);
144
146 const llvm::opt::ArgList &Args,
147 llvm::opt::ArgStringList &CmdArgs);
148
149void addAsNeededOption(const ToolChain &TC, const llvm::opt::ArgList &Args,
150 llvm::opt::ArgStringList &CmdArgs, bool as_needed);
151
152llvm::opt::Arg *getLastCSProfileGenerateArg(const llvm::opt::ArgList &Args);
153llvm::opt::Arg *getLastProfileUseArg(const llvm::opt::ArgList &Args);
154llvm::opt::Arg *getLastProfileSampleUseArg(const llvm::opt::ArgList &Args);
155
156bool isObjCAutoRefCount(const llvm::opt::ArgList &Args);
157
158llvm::StringRef getLTOParallelism(const llvm::opt::ArgList &Args,
159 const Driver &D);
160
161bool areOptimizationsEnabled(const llvm::opt::ArgList &Args);
162
163bool isUseSeparateSections(const llvm::Triple &Triple);
164/// Append -ffunction-sections / -fdata-sections to \p CmdArgs when the
165/// corresponding flags are enabled (explicitly or by target default).
166void addSeparateSectionFlags(const llvm::Triple &Triple,
167 const llvm::opt::ArgList &Args,
168 llvm::opt::ArgStringList &CmdArgs);
169// Parse -mtls-dialect=. Return true if the target supports both general-dynamic
170// and TLSDESC, and TLSDESC is requested.
171bool isTLSDESCEnabled(const ToolChain &TC, const llvm::opt::ArgList &Args);
172
173/// \p EnvVar is split by system delimiter for environment variables.
174/// If \p ArgName is "-I", "-L", or an empty string, each entry from \p EnvVar
175/// is prefixed by \p ArgName then added to \p Args. Otherwise, for each
176/// entry of \p EnvVar, \p ArgName is added to \p Args first, then the entry
177/// itself is added.
178void addDirectoryList(const llvm::opt::ArgList &Args,
179 llvm::opt::ArgStringList &CmdArgs, const char *ArgName,
180 const char *EnvVar);
181
182void AddTargetFeature(const llvm::opt::ArgList &Args,
183 std::vector<StringRef> &Features,
184 llvm::opt::OptSpecifier OnOpt,
185 llvm::opt::OptSpecifier OffOpt, StringRef FeatureName);
186
187std::string getCPUName(const Driver &D, const llvm::opt::ArgList &Args,
188 const llvm::Triple &T, bool FromAs = false);
189
190void getTargetFeatures(const Driver &D, const llvm::Triple &Triple,
191 const llvm::opt::ArgList &Args,
192 llvm::opt::ArgStringList &CmdArgs, bool ForAS,
193 bool IsAux = false);
194
195/// Iterate \p Args and convert -mxxx to +xxx and -mno-xxx to -xxx and
196/// append it to \p Features.
197///
198/// Note: Since \p Features may contain default values before calling
199/// this function, or may be appended with entries to override arguments,
200/// entries in \p Features are not unique.
201void handleTargetFeaturesGroup(const Driver &D, const llvm::Triple &Triple,
202 const llvm::opt::ArgList &Args,
203 std::vector<StringRef> &Features,
204 llvm::opt::OptSpecifier Group);
205
206/// If there are multiple +xxx or -xxx features, keep the last one.
208
209/// Handles the -save-stats option and returns the filename to save statistics
210/// to.
211SmallString<128> getStatsFileName(const llvm::opt::ArgList &Args,
212 const InputInfo &Output,
213 const InputInfo &Input, const Driver &D);
214
215/// \p Flag must be a flag accepted by the driver.
216void addMultilibFlag(bool Enabled, const StringRef Flag,
217 Multilib::flags_list &Flags);
218
219void addX86AlignBranchArgs(const Driver &D, const llvm::opt::ArgList &Args,
220 llvm::opt::ArgStringList &CmdArgs, bool IsLTO,
221 const StringRef PluginOptPrefix = "");
222
224 const llvm::opt::ArgList &Args);
225
226unsigned getAMDGPUCodeObjectVersion(const Driver &D,
227 const llvm::opt::ArgList &Args);
228
230 const llvm::opt::ArgList &Args);
231
232void addMachineOutlinerArgs(const Driver &D, const llvm::opt::ArgList &Args,
233 llvm::opt::ArgStringList &CmdArgs,
234 const llvm::Triple &Triple, bool IsLTO,
235 const StringRef PluginOptPrefix = "");
236
237void addOpenMPDeviceRTL(const Driver &D, const llvm::opt::ArgList &DriverArgs,
238 llvm::opt::ArgStringList &CC1Args,
239 StringRef BitcodeSuffix, const llvm::Triple &Triple,
240 const ToolChain &HostTC);
241
242void addOpenCLBuiltinsLib(const Driver &D, const llvm::Triple &TT,
243 const llvm::opt::ArgList &DriverArgs,
244 llvm::opt::ArgStringList &CC1Args);
245
246void addOutlineAtomicsArgs(const Driver &D, const ToolChain &TC,
247 const llvm::opt::ArgList &Args,
248 llvm::opt::ArgStringList &CmdArgs,
249 const llvm::Triple &Triple);
250void addOffloadCompressArgs(const llvm::opt::ArgList &TCArgs,
251 llvm::opt::ArgStringList &CmdArgs);
252void addMCModel(const Driver &D, const llvm::opt::ArgList &Args,
253 const llvm::Triple &Triple,
254 const llvm::Reloc::Model &RelocationModel,
255 llvm::opt::ArgStringList &CmdArgs);
256
257/// Handle the -f{no}-color-diagnostics and -f{no}-diagnostics-colors options.
258void handleColorDiagnosticsArgs(const Driver &D, const llvm::opt::ArgList &Args,
259 llvm::opt::ArgStringList &CmdArgs);
260
261/// Add backslashes to escape spaces and other backslashes.
262/// This is used for the space-separated argument list specified with
263/// the -dwarf-debug-flags option.
264void escapeSpacesAndBackslashes(const char *Arg,
266
267/// Join the args in the given ArgList, escape spaces and backslashes and
268/// return the joined string. This is used when saving the command line as a
269/// result of using either the -frecord-command-line or -grecord-command-line
270/// options. The lifetime of the returned c-string will match that of the Args
271/// argument.
272const char *renderEscapedCommandLine(const ToolChain &TC,
273 const llvm::opt::ArgList &Args);
274
275/// Check if the command line should be recorded in the object file. This is
276/// done if either -frecord-command-line or -grecord-command-line options have
277/// been passed. This also does some error checking since -frecord-command-line
278/// is currently only supported on ELF platforms. The last two boolean
279/// arguments are out parameters and will be set depending on the command
280/// line options that were passed.
282 const llvm::opt::ArgList &Args,
283 bool &FRecordCommandLine, bool &GRecordCommandLine,
284 bool &DXRecordCommandLine);
285
286void renderGlobalISelOptions(const Driver &D, const llvm::opt::ArgList &Args,
287 llvm::opt::ArgStringList &CmdArgs,
288 const llvm::Triple &Triple);
289
290void renderCommonIntegerOverflowOptions(const llvm::opt::ArgList &Args,
291 llvm::opt::ArgStringList &CmdArgs,
292 bool IsMSVCCompat);
293
294bool shouldEnableVectorizerAtOLevel(const llvm::opt::ArgList &Args,
295 bool isSlpVec);
296
297/// Enable -floop-interchange based on the optimization level selected.
298void handleInterchangeLoopsArgs(const llvm::opt::ArgList &Args,
299 llvm::opt::ArgStringList &CmdArgs);
300
301/// Enable -fvectorize based on the optimization level selected.
302void handleVectorizeLoopsArgs(const llvm::opt::ArgList &Args,
303 llvm::opt::ArgStringList &CmdArgs);
304
305/// Enable -fslp-vectorize based on the optimization level selected.
306void handleVectorizeSLPArgs(const llvm::opt::ArgList &Args,
307 llvm::opt::ArgStringList &CmdArgs);
308
309// Convert ComplexRangeKind to a string that can be passed as a frontend option.
311
312// Render a frontend option corresponding to ComplexRangeKind.
314
315// Set the complex range and output a warning as needed.
316void setComplexRange(const Driver &D, StringRef NewOpt,
317 LangOptions::ComplexRangeKind NewRange, StringRef &LastOpt,
319
320// This function expects that the inputs to llvm-link will be specified by the
321// caller, but the output is handled by this function, with the optional ability
322// to set the output filename.
324 const JobAction &JA,
325 const InputInfoList &JobInputs,
326 const llvm::opt::ArgStringList &LinkerInputs,
327 const InputInfo &Output,
328 const llvm::opt::ArgList &Args,
329 const char *OutputFilename = nullptr);
330
331} // end namespace tools
332} // end namespace driver
333} // end namespace clang
334
336getFramePointerKind(const llvm::opt::ArgList &Args, const llvm::Triple &Triple);
337
338#endif // LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_COMMONARGS_H
clang::CodeGenOptions::FramePointerKind getFramePointerKind(const llvm::opt::ArgList &Args, const llvm::Triple &Triple)
ComplexRangeKind
Controls the various implementations for complex multiplication and.
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:94
InputInfo - Wrapper for information about an input source.
Definition InputInfo.h:22
std::vector< std::string > flags_list
Definition Multilib.h:37
ToolChain - Access to tools for a single platform.
Definition ToolChain.h:95
SmallVector< std::string, 16 > path_list
Definition ToolChain.h:97
Tool - Information on a specific compilation tool.
Definition Tool.h:32
void AddStaticDeviceLibs(Compilation *C, const Tool *T, const JobAction *JA, const InputInfoList *Inputs, const Driver &D, const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CmdArgs, StringRef Arch, StringRef Target, bool isBitCodeSDL)
void addX86AlignBranchArgs(const Driver &D, const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs, bool IsLTO, const StringRef PluginOptPrefix="")
void addMachineOutlinerArgs(const Driver &D, const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs, const llvm::Triple &Triple, bool IsLTO, const StringRef PluginOptPrefix="")
unsigned ParseFunctionAlignment(const ToolChain &TC, const llvm::opt::ArgList &Args)
void addOffloadCompressArgs(const llvm::opt::ArgList &TCArgs, llvm::opt::ArgStringList &CmdArgs)
void handleTargetFeaturesGroup(const Driver &D, const llvm::Triple &Triple, const llvm::opt::ArgList &Args, std::vector< StringRef > &Features, llvm::opt::OptSpecifier Group)
Iterate Args and convert -mxxx to +xxx and -mno-xxx to -xxx and append it to Features.
void addMCModel(const Driver &D, const llvm::opt::ArgList &Args, const llvm::Triple &Triple, const llvm::Reloc::Model &RelocationModel, llvm::opt::ArgStringList &CmdArgs)
SmallVector< StringRef > unifyTargetFeatures(ArrayRef< StringRef > Features)
If there are multiple +xxx or -xxx features, keep the last one.
llvm::opt::Arg * getLastProfileSampleUseArg(const llvm::opt::ArgList &Args)
void handleVectorizeSLPArgs(const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs)
Enable -fslp-vectorize based on the optimization level selected.
void addOpenMPDeviceRTL(const Driver &D, const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args, StringRef BitcodeSuffix, const llvm::Triple &Triple, const ToolChain &HostTC)
const char * SplitDebugName(const JobAction &JA, const llvm::opt::ArgList &Args, const InputInfo &Input, const InputInfo &Output)
void addOutlineAtomicsArgs(const Driver &D, const ToolChain &TC, const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs, const llvm::Triple &Triple)
void checkAMDGPUCodeObjectVersion(const Driver &D, const llvm::opt::ArgList &Args)
void getTargetFeatures(const Driver &D, const llvm::Triple &Triple, const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs, bool ForAS, bool IsAux=false)
void AddStaticDeviceLibsLinking(Compilation &C, const Tool &T, const JobAction &JA, const InputInfoList &Inputs, const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CmdArgs, StringRef Arch, StringRef Target, bool isBitCodeSDL)
std::string complexRangeKindToStr(LangOptions::ComplexRangeKind Range)
void addAsNeededOption(const ToolChain &TC, const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs, bool as_needed)
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.
bool getStaticPIE(const llvm::opt::ArgList &Args, const ToolChain &TC)
std::string getCPUName(const Driver &D, const llvm::opt::ArgList &Args, const llvm::Triple &T, bool FromAs=false)
void addHIPRuntimeLibArgs(const ToolChain &TC, Compilation &C, const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs)
void addLTOOptions(const ToolChain &ToolChain, const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs, const InputInfo &Output, const InputInfoList &Inputs, bool IsThinLTO)
void addMultilibFlag(bool Enabled, const StringRef Flag, Multilib::flags_list &Flags)
Flag must be a flag accepted by the driver.
bool isUseSeparateSections(const llvm::Triple &Triple)
void linkXRayRuntimeDeps(const ToolChain &TC, const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs)
void AddRunTimeLibs(const ToolChain &TC, const Driver &D, llvm::opt::ArgStringList &CmdArgs, const llvm::opt::ArgList &Args)
void SplitDebugInfo(const ToolChain &TC, Compilation &C, const Tool &T, const JobAction &JA, const llvm::opt::ArgList &Args, const InputInfo &Output, const char *OutFile)
void linkSanitizerRuntimeDeps(const ToolChain &TC, const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs)
void addDirectoryList(const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs, const char *ArgName, const char *EnvVar)
EnvVar is split by system delimiter for environment variables.
bool addSanitizerRuntimes(const ToolChain &TC, const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs)
bool areOptimizationsEnabled(const llvm::opt::ArgList &Args)
void addOpenMPRuntimeLibraryPath(const ToolChain &TC, const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs)
void setComplexRange(const Driver &D, StringRef NewOpt, LangOptions::ComplexRangeKind NewRange, StringRef &LastOpt, LangOptions::ComplexRangeKind &Range)
bool addXRayRuntime(const ToolChain &TC, const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs)
void AddAssemblerKPIC(const ToolChain &ToolChain, const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs)
bool haveAMDGPUCodeObjectVersionArgument(const Driver &D, const llvm::opt::ArgList &Args)
bool isTLSDESCEnabled(const ToolChain &TC, const llvm::opt::ArgList &Args)
void addDebugInfoForProfilingArgs(const Driver &D, const ToolChain &TC, const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs)
void addDebugInfoKind(llvm::opt::ArgStringList &CmdArgs, llvm::codegenoptions::DebugInfoKind DebugInfoKind)
void addPathIfExists(const Driver &D, const Twine &Path, ToolChain::path_list &Paths)
llvm::codegenoptions::DebugInfoKind debugLevelToInfoKind(const llvm::opt::Arg &A)
llvm::opt::Arg * getLastCSProfileGenerateArg(const llvm::opt::ArgList &Args)
void renderGlobalISelOptions(const Driver &D, const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs, const llvm::Triple &Triple)
llvm::opt::Arg * getLastProfileUseArg(const llvm::opt::ArgList &Args)
void addDTLTOOptions(const ToolChain &ToolChain, const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs)
std::string renderComplexRangeOption(LangOptions::ComplexRangeKind Range)
DwarfFissionKind getDebugFissionKind(const Driver &D, const llvm::opt::ArgList &Args, llvm::opt::Arg *&Arg)
llvm::StringRef getLTOParallelism(const llvm::opt::ArgList &Args, const Driver &D)
void addLinkerCompressDebugSectionsOption(const ToolChain &TC, const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs)
void constructLLVMLinkCommand(Compilation &C, const Tool &T, const JobAction &JA, const InputInfoList &JobInputs, const llvm::opt::ArgStringList &LinkerInputs, const InputInfo &Output, const llvm::opt::ArgList &Args, const char *OutputFilename=nullptr)
void handleInterchangeLoopsArgs(const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs)
Enable -floop-interchange based on the optimization level selected.
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, bool IsMSVCCompat)
bool addOpenMPRuntime(const Compilation &C, 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.
bool checkDebugInfoOption(const llvm::opt::Arg *A, const llvm::opt::ArgList &Args, const Driver &D, const ToolChain &TC)
std::tuple< llvm::Reloc::Model, unsigned, bool > ParsePICArgs(const ToolChain &ToolChain, const llvm::opt::ArgList &Args)
void claimNoWarnArgs(const llvm::opt::ArgList &Args)
unsigned DwarfVersionNum(StringRef ArgValue)
void AddLinkerInputs(const ToolChain &TC, const InputInfoList &Inputs, const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs, const JobAction &JA)
unsigned getDwarfVersion(const ToolChain &TC, const llvm::opt::ArgList &Args)
bool shouldRecordCommandLine(const ToolChain &TC, const llvm::opt::ArgList &Args, bool &FRecordCommandLine, bool &GRecordCommandLine, bool &DXRecordCommandLine)
Check if the command line should be recorded in the object file.
unsigned getAMDGPUCodeObjectVersion(const Driver &D, const llvm::opt::ArgList &Args)
const llvm::opt::Arg * getDwarfNArg(const llvm::opt::ArgList &Args)
void AddTargetFeature(const llvm::opt::ArgList &Args, std::vector< StringRef > &Features, llvm::opt::OptSpecifier OnOpt, llvm::opt::OptSpecifier OffOpt, StringRef FeatureName)
SmallString< 128 > getStatsFileName(const llvm::opt::ArgList &Args, const InputInfo &Output, const InputInfo &Input, const Driver &D)
Handles the -save-stats option and returns the filename to save statistics to.
void addArchSpecificRPath(const ToolChain &TC, const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs)
void addSeparateSectionFlags(const llvm::Triple &Triple, const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs)
Append -ffunction-sections / -fdata-sections to CmdArgs when the corresponding flags are enabled (exp...
void handleVectorizeLoopsArgs(const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs)
Enable -fvectorize based on the optimization level selected.
void escapeSpacesAndBackslashes(const char *Arg, llvm::SmallVectorImpl< char > &Res)
Add backslashes to escape spaces and other backslashes.
const char * getLDMOption(const llvm::Triple &T, const llvm::opt::ArgList &Args)
void addOpenCLBuiltinsLib(const Driver &D, const llvm::Triple &TT, const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args)
bool isObjCAutoRefCount(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.
bool shouldEnableVectorizerAtOLevel(const llvm::opt::ArgList &Args, bool isSlpVec)
SmallVector< InputInfo, 4 > InputInfoList
Definition Driver.h:50
The JSON file list parser is used to communicate input to InstallAPI.