clang 22.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 addLTOOptions(const ToolChain &ToolChain, const llvm::opt::ArgList &Args,
80 llvm::opt::ArgStringList &CmdArgs, const InputInfo &Output,
81 const InputInfoList &Inputs, bool IsThinLTO);
82
83const char *RelocationModelName(llvm::Reloc::Model Model);
84
85std::tuple<llvm::Reloc::Model, unsigned, bool>
86ParsePICArgs(const ToolChain &ToolChain, const llvm::opt::ArgList &Args);
87
88bool getStaticPIE(const llvm::opt::ArgList &Args, const ToolChain &TC);
89
91 const llvm::opt::ArgList &Args);
92
93void addDebugInfoKind(llvm::opt::ArgStringList &CmdArgs,
94 llvm::codegenoptions::DebugInfoKind DebugInfoKind);
95
96llvm::codegenoptions::DebugInfoKind
97debugLevelToInfoKind(const llvm::opt::Arg &A);
98
99// Extract the integer N from a string spelled "-dwarf-N", returning 0
100// on mismatch. The StringRef input (rather than an Arg) allows
101// for use by the "-Xassembler" option parser.
102unsigned DwarfVersionNum(StringRef ArgValue);
103// Find a DWARF format version option.
104// This function is a complementary for DwarfVersionNum().
105const llvm::opt::Arg *getDwarfNArg(const llvm::opt::ArgList &Args);
106unsigned getDwarfVersion(const ToolChain &TC, const llvm::opt::ArgList &Args);
107
109
111 const llvm::opt::ArgList &Args,
112 llvm::opt::Arg *&Arg);
113
114bool checkDebugInfoOption(const llvm::opt::Arg *A,
115 const llvm::opt::ArgList &Args, const Driver &D,
116 const ToolChain &TC);
117
119 const llvm::opt::ArgList &Args,
120 llvm::opt::ArgStringList &CmdArgs);
121
122void addArchSpecificRPath(const ToolChain &TC, const llvm::opt::ArgList &Args,
123 llvm::opt::ArgStringList &CmdArgs);
125 const llvm::opt::ArgList &Args,
126 llvm::opt::ArgStringList &CmdArgs);
127/// Returns true, if an OpenMP runtime has been added.
128bool addOpenMPRuntime(const Compilation &C, llvm::opt::ArgStringList &CmdArgs,
129 const ToolChain &TC, const llvm::opt::ArgList &Args,
130 bool ForceStaticHostRuntime = false,
131 bool IsOffloadingHost = false, bool GompNeedsRT = false);
132
133/// Adds offloading options for OpenMP host compilation to \p CmdArgs.
135 const llvm::opt::ArgList &Args,
136 llvm::opt::ArgStringList &CmdArgs);
137
139 const llvm::opt::ArgList &Args,
140 llvm::opt::ArgStringList &CmdArgs);
141
142void addAsNeededOption(const ToolChain &TC, const llvm::opt::ArgList &Args,
143 llvm::opt::ArgStringList &CmdArgs, bool as_needed);
144
145llvm::opt::Arg *getLastCSProfileGenerateArg(const llvm::opt::ArgList &Args);
146llvm::opt::Arg *getLastProfileUseArg(const llvm::opt::ArgList &Args);
147llvm::opt::Arg *getLastProfileSampleUseArg(const llvm::opt::ArgList &Args);
148
149bool isObjCAutoRefCount(const llvm::opt::ArgList &Args);
150
151llvm::StringRef getLTOParallelism(const llvm::opt::ArgList &Args,
152 const Driver &D);
153
154bool areOptimizationsEnabled(const llvm::opt::ArgList &Args);
155
156bool isUseSeparateSections(const llvm::Triple &Triple);
157// Parse -mtls-dialect=. Return true if the target supports both general-dynamic
158// and TLSDESC, and TLSDESC is requested.
159bool isTLSDESCEnabled(const ToolChain &TC, const llvm::opt::ArgList &Args);
160
161/// \p EnvVar is split by system delimiter for environment variables.
162/// If \p ArgName is "-I", "-L", or an empty string, each entry from \p EnvVar
163/// is prefixed by \p ArgName then added to \p Args. Otherwise, for each
164/// entry of \p EnvVar, \p ArgName is added to \p Args first, then the entry
165/// itself is added.
166void addDirectoryList(const llvm::opt::ArgList &Args,
167 llvm::opt::ArgStringList &CmdArgs, const char *ArgName,
168 const char *EnvVar);
169
170void AddTargetFeature(const llvm::opt::ArgList &Args,
171 std::vector<StringRef> &Features,
172 llvm::opt::OptSpecifier OnOpt,
173 llvm::opt::OptSpecifier OffOpt, StringRef FeatureName);
174
175std::string getCPUName(const Driver &D, const llvm::opt::ArgList &Args,
176 const llvm::Triple &T, bool FromAs = false);
177
178void getTargetFeatures(const Driver &D, const llvm::Triple &Triple,
179 const llvm::opt::ArgList &Args,
180 llvm::opt::ArgStringList &CmdArgs, bool ForAS,
181 bool IsAux = false);
182
183/// Iterate \p Args and convert -mxxx to +xxx and -mno-xxx to -xxx and
184/// append it to \p Features.
185///
186/// Note: Since \p Features may contain default values before calling
187/// this function, or may be appended with entries to override arguments,
188/// entries in \p Features are not unique.
189void handleTargetFeaturesGroup(const Driver &D, const llvm::Triple &Triple,
190 const llvm::opt::ArgList &Args,
191 std::vector<StringRef> &Features,
192 llvm::opt::OptSpecifier Group);
193
194/// If there are multiple +xxx or -xxx features, keep the last one.
196
197/// Handles the -save-stats option and returns the filename to save statistics
198/// to.
199SmallString<128> getStatsFileName(const llvm::opt::ArgList &Args,
200 const InputInfo &Output,
201 const InputInfo &Input, const Driver &D);
202
203/// \p Flag must be a flag accepted by the driver.
204void addMultilibFlag(bool Enabled, const StringRef Flag,
205 Multilib::flags_list &Flags);
206
207void addX86AlignBranchArgs(const Driver &D, const llvm::opt::ArgList &Args,
208 llvm::opt::ArgStringList &CmdArgs, bool IsLTO,
209 const StringRef PluginOptPrefix = "");
210
212 const llvm::opt::ArgList &Args);
213
214unsigned getAMDGPUCodeObjectVersion(const Driver &D,
215 const llvm::opt::ArgList &Args);
216
218 const llvm::opt::ArgList &Args);
219
220void addMachineOutlinerArgs(const Driver &D, const llvm::opt::ArgList &Args,
221 llvm::opt::ArgStringList &CmdArgs,
222 const llvm::Triple &Triple, bool IsLTO,
223 const StringRef PluginOptPrefix = "");
224
225void addOpenMPDeviceRTL(const Driver &D, const llvm::opt::ArgList &DriverArgs,
226 llvm::opt::ArgStringList &CC1Args,
227 StringRef BitcodeSuffix, const llvm::Triple &Triple,
228 const ToolChain &HostTC);
229
230void addOpenCLBuiltinsLib(const Driver &D, const llvm::opt::ArgList &DriverArgs,
231 llvm::opt::ArgStringList &CC1Args);
232
233void addOutlineAtomicsArgs(const Driver &D, const ToolChain &TC,
234 const llvm::opt::ArgList &Args,
235 llvm::opt::ArgStringList &CmdArgs,
236 const llvm::Triple &Triple);
237void addOffloadCompressArgs(const llvm::opt::ArgList &TCArgs,
238 llvm::opt::ArgStringList &CmdArgs);
239void addMCModel(const Driver &D, const llvm::opt::ArgList &Args,
240 const llvm::Triple &Triple,
241 const llvm::Reloc::Model &RelocationModel,
242 llvm::opt::ArgStringList &CmdArgs);
243
244/// Handle the -f{no}-color-diagnostics and -f{no}-diagnostics-colors options.
245void handleColorDiagnosticsArgs(const Driver &D, const llvm::opt::ArgList &Args,
246 llvm::opt::ArgStringList &CmdArgs);
247
248/// Add backslashes to escape spaces and other backslashes.
249/// This is used for the space-separated argument list specified with
250/// the -dwarf-debug-flags option.
251void escapeSpacesAndBackslashes(const char *Arg,
253
254/// Join the args in the given ArgList, escape spaces and backslashes and
255/// return the joined string. This is used when saving the command line as a
256/// result of using either the -frecord-command-line or -grecord-command-line
257/// options. The lifetime of the returned c-string will match that of the Args
258/// argument.
259const char *renderEscapedCommandLine(const ToolChain &TC,
260 const llvm::opt::ArgList &Args);
261
262/// Check if the command line should be recorded in the object file. This is
263/// done if either -frecord-command-line or -grecord-command-line options have
264/// been passed. This also does some error checking since -frecord-command-line
265/// is currently only supported on ELF platforms. The last two boolean
266/// arguments are out parameters and will be set depending on the command
267/// line options that were passed.
269 const llvm::opt::ArgList &Args,
270 bool &FRecordCommandLine,
271 bool &GRecordCommandLine);
272
273void renderCommonIntegerOverflowOptions(const llvm::opt::ArgList &Args,
274 llvm::opt::ArgStringList &CmdArgs);
275
276bool shouldEnableVectorizerAtOLevel(const llvm::opt::ArgList &Args,
277 bool isSlpVec);
278
279/// Enable -floop-interchange based on the optimization level selected.
280void handleInterchangeLoopsArgs(const llvm::opt::ArgList &Args,
281 llvm::opt::ArgStringList &CmdArgs);
282
283/// Enable -fvectorize based on the optimization level selected.
284void handleVectorizeLoopsArgs(const llvm::opt::ArgList &Args,
285 llvm::opt::ArgStringList &CmdArgs);
286
287/// Enable -fslp-vectorize based on the optimization level selected.
288void handleVectorizeSLPArgs(const llvm::opt::ArgList &Args,
289 llvm::opt::ArgStringList &CmdArgs);
290
291// Parse -mprefer-vector-width=. Return the Value string if well-formed.
292// Otherwise, return an empty string and issue a diagnosic message if needed.
294 const llvm::opt::ArgList &Args);
295
296// Parse -mrecip. Return the Value string if well-formed.
297// Otherwise, return an empty string and issue a diagnosic message if needed.
299 const llvm::opt::ArgList &Args);
300
301// Convert ComplexRangeKind to a string that can be passed as a frontend option.
303
304// Render a frontend option corresponding to ComplexRangeKind.
306
307// Set the complex range and output a warning as needed.
308void setComplexRange(const Driver &D, StringRef NewOpt,
309 LangOptions::ComplexRangeKind NewRange, StringRef &LastOpt,
311
312} // end namespace tools
313} // end namespace driver
314} // end namespace clang
315
317getFramePointerKind(const llvm::opt::ArgList &Args, const llvm::Triple &Triple);
318
319#endif // LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_COMMONARGS_H
clang::CodeGenOptions::FramePointerKind getFramePointerKind(const llvm::opt::ArgList &Args, const llvm::Triple &Triple)
Concrete class used by the front-end to report problems and issues.
Definition Diagnostic.h:232
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 addOpenCLBuiltinsLib(const Driver &D, const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args)
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 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)
llvm::opt::Arg * getLastProfileUseArg(const llvm::opt::ArgList &Args)
StringRef parseMRecipOption(clang::DiagnosticsEngine &Diags, const llvm::opt::ArgList &Args)
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 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.
StringRef parseMPreferVectorWidthOption(clang::DiagnosticsEngine &Diags, const llvm::opt::ArgList &Args)
const char * getLDMOption(const llvm::Triple &T, const llvm::opt::ArgList &Args)
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.
const FunctionProtoType * T