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// Parse -mtls-dialect=. Return true if the target supports both general-dynamic
165// and TLSDESC, and TLSDESC is requested.
166bool isTLSDESCEnabled(const ToolChain &TC, const llvm::opt::ArgList &Args);
167
168/// \p EnvVar is split by system delimiter for environment variables.
169/// If \p ArgName is "-I", "-L", or an empty string, each entry from \p EnvVar
170/// is prefixed by \p ArgName then added to \p Args. Otherwise, for each
171/// entry of \p EnvVar, \p ArgName is added to \p Args first, then the entry
172/// itself is added.
173void addDirectoryList(const llvm::opt::ArgList &Args,
174 llvm::opt::ArgStringList &CmdArgs, const char *ArgName,
175 const char *EnvVar);
176
177void AddTargetFeature(const llvm::opt::ArgList &Args,
178 std::vector<StringRef> &Features,
179 llvm::opt::OptSpecifier OnOpt,
180 llvm::opt::OptSpecifier OffOpt, StringRef FeatureName);
181
182std::string getCPUName(const Driver &D, const llvm::opt::ArgList &Args,
183 const llvm::Triple &T, bool FromAs = false);
184
185void getTargetFeatures(const Driver &D, const llvm::Triple &Triple,
186 const llvm::opt::ArgList &Args,
187 llvm::opt::ArgStringList &CmdArgs, bool ForAS,
188 bool IsAux = false);
189
190/// Iterate \p Args and convert -mxxx to +xxx and -mno-xxx to -xxx and
191/// append it to \p Features.
192///
193/// Note: Since \p Features may contain default values before calling
194/// this function, or may be appended with entries to override arguments,
195/// entries in \p Features are not unique.
196void handleTargetFeaturesGroup(const Driver &D, const llvm::Triple &Triple,
197 const llvm::opt::ArgList &Args,
198 std::vector<StringRef> &Features,
199 llvm::opt::OptSpecifier Group);
200
201/// If there are multiple +xxx or -xxx features, keep the last one.
203
204/// Handles the -save-stats option and returns the filename to save statistics
205/// to.
206SmallString<128> getStatsFileName(const llvm::opt::ArgList &Args,
207 const InputInfo &Output,
208 const InputInfo &Input, const Driver &D);
209
210/// \p Flag must be a flag accepted by the driver.
211void addMultilibFlag(bool Enabled, const StringRef Flag,
212 Multilib::flags_list &Flags);
213
214void addX86AlignBranchArgs(const Driver &D, const llvm::opt::ArgList &Args,
215 llvm::opt::ArgStringList &CmdArgs, bool IsLTO,
216 const StringRef PluginOptPrefix = "");
217
219 const llvm::opt::ArgList &Args);
220
221unsigned getAMDGPUCodeObjectVersion(const Driver &D,
222 const llvm::opt::ArgList &Args);
223
225 const llvm::opt::ArgList &Args);
226
227void addMachineOutlinerArgs(const Driver &D, const llvm::opt::ArgList &Args,
228 llvm::opt::ArgStringList &CmdArgs,
229 const llvm::Triple &Triple, bool IsLTO,
230 const StringRef PluginOptPrefix = "");
231
232void addOpenMPDeviceRTL(const Driver &D, const llvm::opt::ArgList &DriverArgs,
233 llvm::opt::ArgStringList &CC1Args,
234 StringRef BitcodeSuffix, const llvm::Triple &Triple,
235 const ToolChain &HostTC);
236
237void addOpenCLBuiltinsLib(const Driver &D, const llvm::Triple &TT,
238 const llvm::opt::ArgList &DriverArgs,
239 llvm::opt::ArgStringList &CC1Args);
240
241void addOutlineAtomicsArgs(const Driver &D, const ToolChain &TC,
242 const llvm::opt::ArgList &Args,
243 llvm::opt::ArgStringList &CmdArgs,
244 const llvm::Triple &Triple);
245void addOffloadCompressArgs(const llvm::opt::ArgList &TCArgs,
246 llvm::opt::ArgStringList &CmdArgs);
247void addMCModel(const Driver &D, const llvm::opt::ArgList &Args,
248 const llvm::Triple &Triple,
249 const llvm::Reloc::Model &RelocationModel,
250 llvm::opt::ArgStringList &CmdArgs);
251
252/// Handle the -f{no}-color-diagnostics and -f{no}-diagnostics-colors options.
253void handleColorDiagnosticsArgs(const Driver &D, const llvm::opt::ArgList &Args,
254 llvm::opt::ArgStringList &CmdArgs);
255
256/// Add backslashes to escape spaces and other backslashes.
257/// This is used for the space-separated argument list specified with
258/// the -dwarf-debug-flags option.
259void escapeSpacesAndBackslashes(const char *Arg,
261
262/// Join the args in the given ArgList, escape spaces and backslashes and
263/// return the joined string. This is used when saving the command line as a
264/// result of using either the -frecord-command-line or -grecord-command-line
265/// options. The lifetime of the returned c-string will match that of the Args
266/// argument.
267const char *renderEscapedCommandLine(const ToolChain &TC,
268 const llvm::opt::ArgList &Args);
269
270/// Check if the command line should be recorded in the object file. This is
271/// done if either -frecord-command-line or -grecord-command-line options have
272/// been passed. This also does some error checking since -frecord-command-line
273/// is currently only supported on ELF platforms. The last two boolean
274/// arguments are out parameters and will be set depending on the command
275/// line options that were passed.
277 const llvm::opt::ArgList &Args,
278 bool &FRecordCommandLine,
279 bool &GRecordCommandLine);
280
281void renderGlobalISelOptions(const Driver &D, const llvm::opt::ArgList &Args,
282 llvm::opt::ArgStringList &CmdArgs,
283 const llvm::Triple &Triple);
284
285void renderCommonIntegerOverflowOptions(const llvm::opt::ArgList &Args,
286 llvm::opt::ArgStringList &CmdArgs);
287
288bool shouldEnableVectorizerAtOLevel(const llvm::opt::ArgList &Args,
289 bool isSlpVec);
290
291/// Enable -floop-interchange based on the optimization level selected.
292void handleInterchangeLoopsArgs(const llvm::opt::ArgList &Args,
293 llvm::opt::ArgStringList &CmdArgs);
294
295/// Enable -fvectorize based on the optimization level selected.
296void handleVectorizeLoopsArgs(const llvm::opt::ArgList &Args,
297 llvm::opt::ArgStringList &CmdArgs);
298
299/// Enable -fslp-vectorize based on the optimization level selected.
300void handleVectorizeSLPArgs(const llvm::opt::ArgList &Args,
301 llvm::opt::ArgStringList &CmdArgs);
302
303// Convert ComplexRangeKind to a string that can be passed as a frontend option.
305
306// Render a frontend option corresponding to ComplexRangeKind.
308
309// Set the complex range and output a warning as needed.
310void setComplexRange(const Driver &D, StringRef NewOpt,
311 LangOptions::ComplexRangeKind NewRange, StringRef &LastOpt,
313
314// This function expects that the inputs to llvm-link will be specified by the
315// caller, but the output is handled by this function, with the optional ability
316// to set the output filename.
318 const JobAction &JA,
319 const InputInfoList &JobInputs,
320 const llvm::opt::ArgStringList &LinkerInputs,
321 const InputInfo &Output,
322 const llvm::opt::ArgList &Args,
323 const char *OutputFilename = nullptr);
324
325} // end namespace tools
326} // end namespace driver
327} // end namespace clang
328
330getFramePointerKind(const llvm::opt::ArgList &Args, const llvm::Triple &Triple);
331
332#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:99
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:92
SmallVector< std::string, 16 > path_list
Definition ToolChain.h:94
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)
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 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.
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)
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)
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)
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 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.