clang  7.0.0svn
Driver.h
Go to the documentation of this file.
1 //===--- Driver.h - Clang GCC Compatible Driver -----------------*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
10 #ifndef LLVM_CLANG_DRIVER_DRIVER_H
11 #define LLVM_CLANG_DRIVER_DRIVER_H
12 
13 #include "clang/Basic/Diagnostic.h"
14 #include "clang/Basic/LLVM.h"
15 #include "clang/Driver/Action.h"
16 #include "clang/Driver/Phases.h"
17 #include "clang/Driver/ToolChain.h"
18 #include "clang/Driver/Types.h"
19 #include "clang/Driver/Util.h"
20 #include "llvm/ADT/StringMap.h"
21 #include "llvm/ADT/StringRef.h"
22 #include "llvm/Option/ArgList.h"
23 #include "llvm/Support/StringSaver.h"
24 
25 #include <list>
26 #include <map>
27 #include <string>
28 
29 namespace llvm {
30 class Triple;
31 }
32 
33 namespace clang {
34 
35 namespace vfs {
36 class FileSystem;
37 }
38 
39 namespace driver {
40 
41  class Command;
42  class Compilation;
43  class InputInfo;
44  class JobList;
45  class JobAction;
46  class SanitizerArgs;
47  class ToolChain;
48 
49 /// Describes the kind of LTO mode selected via -f(no-)?lto(=.*)? options.
50 enum LTOKind {
55 };
56 
57 /// Driver - Encapsulate logic for constructing compilation processes
58 /// from a set of gcc-driver-like command line arguments.
59 class Driver {
60  std::unique_ptr<llvm::opt::OptTable> Opts;
61 
62  DiagnosticsEngine &Diags;
63 
65 
66  enum DriverMode {
67  GCCMode,
68  GXXMode,
69  CPPMode,
70  CLMode
71  } Mode;
72 
73  enum SaveTempsMode {
74  SaveTempsNone,
75  SaveTempsCwd,
76  SaveTempsObj
77  } SaveTemps;
78 
79  enum BitcodeEmbedMode {
80  EmbedNone,
81  EmbedMarker,
83  } BitcodeEmbed;
84 
85  /// LTO mode selected via -f(no-)?lto(=.*)? options.
86  LTOKind LTOMode;
87 
88 public:
90  /// An unknown OpenMP runtime. We can't generate effective OpenMP code
91  /// without knowing what runtime to target.
93 
94  /// The LLVM OpenMP runtime. When completed and integrated, this will become
95  /// the default for Clang.
97 
98  /// The GNU OpenMP runtime. Clang doesn't support generating OpenMP code for
99  /// this runtime but can swallow the pragmas, and find and link against the
100  /// runtime library itself.
102 
103  /// The legacy name for the LLVM OpenMP runtime from when it was the Intel
104  /// OpenMP runtime. We support this mode for users with existing
105  /// dependencies on this runtime library name.
106  OMPRT_IOMP5
107  };
108 
109  // Diag - Forwarding function for diagnostics.
110  DiagnosticBuilder Diag(unsigned DiagID) const {
111  return Diags.Report(DiagID);
112  }
113 
114  // FIXME: Privatize once interface is stable.
115 public:
116  /// The name the driver was invoked as.
117  std::string Name;
118 
119  /// The path the driver executable was in, as invoked from the
120  /// command line.
121  std::string Dir;
122 
123  /// The original path to the clang executable.
124  std::string ClangExecutable;
125 
126  /// Target and driver mode components extracted from clang executable name.
128 
129  /// The path to the installed clang directory, if any.
130  std::string InstalledDir;
131 
132  /// The path to the compiler resource directory.
133  std::string ResourceDir;
134 
135  /// System directory for config files.
136  std::string SystemConfigDir;
137 
138  /// User directory for config files.
139  std::string UserConfigDir;
140 
141  /// A prefix directory used to emulate a limited subset of GCC's '-Bprefix'
142  /// functionality.
143  /// FIXME: This type of customization should be removed in favor of the
144  /// universal driver when it is ready.
146  prefix_list PrefixDirs;
147 
148  /// sysroot, if present
149  std::string SysRoot;
150 
151  /// Dynamic loader prefix, if present
152  std::string DyldPrefix;
153 
154  /// Driver title to use with help.
155  std::string DriverTitle;
156 
157  /// Information about the host which can be overridden by the user.
158  std::string HostBits, HostMachine, HostSystem, HostRelease;
159 
160  /// The file to log CC_PRINT_OPTIONS output to, if enabled.
162 
163  /// The file to log CC_PRINT_HEADERS output to, if enabled.
165 
166  /// The file to log CC_LOG_DIAGNOSTICS output to, if enabled.
168 
169  /// A list of inputs and their types for the given arguments.
172 
173  /// Whether the driver should follow g++ like behavior.
174  bool CCCIsCXX() const { return Mode == GXXMode; }
175 
176  /// Whether the driver is just the preprocessor.
177  bool CCCIsCPP() const { return Mode == CPPMode; }
178 
179  /// Whether the driver should follow gcc like behavior.
180  bool CCCIsCC() const { return Mode == GCCMode; }
181 
182  /// Whether the driver should follow cl.exe like behavior.
183  bool IsCLMode() const { return Mode == CLMode; }
184 
185  /// Only print tool bindings, don't build any jobs.
186  unsigned CCCPrintBindings : 1;
187 
188  /// Set CC_PRINT_OPTIONS mode, which is like -v but logs the commands to
189  /// CCPrintOptionsFilename or to stderr.
190  unsigned CCPrintOptions : 1;
191 
192  /// Set CC_PRINT_HEADERS mode, which causes the frontend to log header include
193  /// information to CCPrintHeadersFilename or to stderr.
194  unsigned CCPrintHeaders : 1;
195 
196  /// Set CC_LOG_DIAGNOSTICS mode, which causes the frontend to log diagnostics
197  /// to CCLogDiagnosticsFilename or to stderr, in a stable machine readable
198  /// format.
199  unsigned CCLogDiagnostics : 1;
200 
201  /// Whether the driver is generating diagnostics for debugging purposes.
202  unsigned CCGenDiagnostics : 1;
203 
204 private:
205  /// Default target triple.
206  std::string DefaultTargetTriple;
207 
208  /// Name to use when invoking gcc/g++.
209  std::string CCCGenericGCCName;
210 
211  /// Name of configuration file if used.
212  std::string ConfigFile;
213 
214  /// Allocator for string saver.
215  llvm::BumpPtrAllocator Alloc;
216 
217  /// Object that stores strings read from configuration file.
218  llvm::StringSaver Saver;
219 
220  /// Arguments originated from configuration file.
221  std::unique_ptr<llvm::opt::InputArgList> CfgOptions;
222 
223  /// Arguments originated from command line.
224  std::unique_ptr<llvm::opt::InputArgList> CLOptions;
225 
226  /// Whether to check that input files exist when constructing compilation
227  /// jobs.
228  unsigned CheckInputsExist : 1;
229 
230 public:
231  /// Use lazy precompiled headers for PCH support.
232  unsigned CCCUsePCH : 1;
233 
234  /// Force clang to emit reproducer for driver invocation. This is enabled
235  /// indirectly by setting FORCE_CLANG_DIAGNOSTICS_CRASH environment variable
236  /// or when using the -gen-reproducer driver flag.
237  unsigned GenReproducer : 1;
238 
239 private:
240  /// Certain options suppress the 'no input files' warning.
241  unsigned SuppressMissingInputWarning : 1;
242 
243  std::list<std::string> TempFiles;
244  std::list<std::string> ResultFiles;
245 
246  /// \brief Cache of all the ToolChains in use by the driver.
247  ///
248  /// This maps from the string representation of a triple to a ToolChain
249  /// created targeting that triple. The driver owns all the ToolChain objects
250  /// stored in it, and will clean them up when torn down.
251  mutable llvm::StringMap<std::unique_ptr<ToolChain>> ToolChains;
252 
253 private:
254  /// TranslateInputArgs - Create a new derived argument list from the input
255  /// arguments, after applying the standard argument translations.
256  llvm::opt::DerivedArgList *
257  TranslateInputArgs(const llvm::opt::InputArgList &Args) const;
258 
259  // getFinalPhase - Determine which compilation mode we are in and record
260  // which option we used to determine the final phase.
261  phases::ID getFinalPhase(const llvm::opt::DerivedArgList &DAL,
262  llvm::opt::Arg **FinalPhaseArg = nullptr) const;
263 
264  // Before executing jobs, sets up response files for commands that need them.
265  void setUpResponseFiles(Compilation &C, Command &Cmd);
266 
267  void generatePrefixedToolNames(StringRef Tool, const ToolChain &TC,
268  SmallVectorImpl<std::string> &Names) const;
269 
270  /// \brief Find the appropriate .crash diagonostic file for the child crash
271  /// under this driver and copy it out to a temporary destination with the
272  /// other reproducer related files (.sh, .cache, etc). If not found, suggest a
273  /// directory for the user to look at.
274  ///
275  /// \param ReproCrashFilename The file path to copy the .crash to.
276  /// \param CrashDiagDir The suggested directory for the user to look at
277  /// in case the search or copy fails.
278  ///
279  /// \returns If the .crash is found and successfully copied return true,
280  /// otherwise false and return the suggested directory in \p CrashDiagDir.
281  bool getCrashDiagnosticFile(StringRef ReproCrashFilename,
282  SmallString<128> &CrashDiagDir);
283 
284 public:
285  Driver(StringRef ClangExecutable, StringRef DefaultTargetTriple,
286  DiagnosticsEngine &Diags,
288 
289  /// @name Accessors
290  /// @{
291 
292  /// Name to use when invoking gcc/g++.
293  const std::string &getCCCGenericGCCName() const { return CCCGenericGCCName; }
294 
295  const std::string &getConfigFile() const { return ConfigFile; }
296 
297  const llvm::opt::OptTable &getOpts() const { return *Opts; }
298 
299  const DiagnosticsEngine &getDiags() const { return Diags; }
300 
301  vfs::FileSystem &getVFS() const { return *VFS; }
302 
303  bool getCheckInputsExist() const { return CheckInputsExist; }
304 
305  void setCheckInputsExist(bool Value) { CheckInputsExist = Value; }
306 
307  void setTargetAndMode(const ParsedClangName &TM) { ClangNameParts = TM; }
308 
309  const std::string &getTitle() { return DriverTitle; }
310  void setTitle(std::string Value) { DriverTitle = std::move(Value); }
311 
312  /// \brief Get the path to the main clang executable.
313  const char *getClangProgramPath() const {
314  return ClangExecutable.c_str();
315  }
316 
317  /// \brief Get the path to where the clang executable was installed.
318  const char *getInstalledDir() const {
319  if (!InstalledDir.empty())
320  return InstalledDir.c_str();
321  return Dir.c_str();
322  }
323  void setInstalledDir(StringRef Value) {
324  InstalledDir = Value;
325  }
326 
327  bool isSaveTempsEnabled() const { return SaveTemps != SaveTempsNone; }
328  bool isSaveTempsObj() const { return SaveTemps == SaveTempsObj; }
329 
330  bool embedBitcodeEnabled() const { return BitcodeEmbed != EmbedNone; }
331  bool embedBitcodeInObject() const { return (BitcodeEmbed == EmbedBitcode); }
332  bool embedBitcodeMarkerOnly() const { return (BitcodeEmbed == EmbedMarker); }
333 
334  /// Compute the desired OpenMP runtime from the flags provided.
335  OpenMPRuntimeKind getOpenMPRuntime(const llvm::opt::ArgList &Args) const;
336 
337  /// @}
338  /// @name Primary Functionality
339  /// @{
340 
341  /// CreateOffloadingDeviceToolChains - create all the toolchains required to
342  /// support offloading devices given the programming models specified in the
343  /// current compilation. Also, update the host tool chain kind accordingly.
344  void CreateOffloadingDeviceToolChains(Compilation &C, InputList &Inputs);
345 
346  /// BuildCompilation - Construct a compilation object for a command
347  /// line argument vector.
348  ///
349  /// \return A compilation, or 0 if none was built for the given
350  /// argument vector. A null return value does not necessarily
351  /// indicate an error condition, the diagnostics should be queried
352  /// to determine if an error occurred.
353  Compilation *BuildCompilation(ArrayRef<const char *> Args);
354 
355  /// @name Driver Steps
356  /// @{
357 
358  /// ParseDriverMode - Look for and handle the driver mode option in Args.
359  void ParseDriverMode(StringRef ProgramName, ArrayRef<const char *> Args);
360 
361  /// ParseArgStrings - Parse the given list of strings into an
362  /// ArgList.
363  llvm::opt::InputArgList ParseArgStrings(ArrayRef<const char *> Args,
364  bool &ContainsError);
365 
366  /// BuildInputs - Construct the list of inputs and their types from
367  /// the given arguments.
368  ///
369  /// \param TC - The default host tool chain.
370  /// \param Args - The input arguments.
371  /// \param Inputs - The list to store the resulting compilation
372  /// inputs onto.
373  void BuildInputs(const ToolChain &TC, llvm::opt::DerivedArgList &Args,
374  InputList &Inputs) const;
375 
376  /// BuildActions - Construct the list of actions to perform for the
377  /// given arguments, which are only done for a single architecture.
378  ///
379  /// \param C - The compilation that is being built.
380  /// \param Args - The input arguments.
381  /// \param Actions - The list to store the resulting actions onto.
382  void BuildActions(Compilation &C, llvm::opt::DerivedArgList &Args,
383  const InputList &Inputs, ActionList &Actions) const;
384 
385  /// BuildUniversalActions - Construct the list of actions to perform
386  /// for the given arguments, which may require a universal build.
387  ///
388  /// \param C - The compilation that is being built.
389  /// \param TC - The default host tool chain.
390  void BuildUniversalActions(Compilation &C, const ToolChain &TC,
391  const InputList &BAInputs) const;
392 
393  /// BuildJobs - Bind actions to concrete tools and translate
394  /// arguments to form the list of jobs to run.
395  ///
396  /// \param C - The compilation that is being built.
397  void BuildJobs(Compilation &C) const;
398 
399  /// ExecuteCompilation - Execute the compilation according to the command line
400  /// arguments and return an appropriate exit code.
401  ///
402  /// This routine handles additional processing that must be done in addition
403  /// to just running the subprocesses, for example reporting errors, setting
404  /// up response files, removing temporary files, etc.
405  int ExecuteCompilation(Compilation &C,
406  SmallVectorImpl< std::pair<int, const Command *> > &FailingCommands);
407 
408  /// generateCompilationDiagnostics - Generate diagnostics information
409  /// including preprocessed source file(s).
410  ///
411  void generateCompilationDiagnostics(Compilation &C,
412  const Command &FailingCommand);
413 
414  /// @}
415  /// @name Helper Methods
416  /// @{
417 
418  /// PrintActions - Print the list of actions.
419  void PrintActions(const Compilation &C) const;
420 
421  /// PrintHelp - Print the help text.
422  ///
423  /// \param ShowHidden - Show hidden options.
424  void PrintHelp(bool ShowHidden) const;
425 
426  /// PrintVersion - Print the driver version.
427  void PrintVersion(const Compilation &C, raw_ostream &OS) const;
428 
429  /// GetFilePath - Lookup \p Name in the list of file search paths.
430  ///
431  /// \param TC - The tool chain for additional information on
432  /// directories to search.
433  //
434  // FIXME: This should be in CompilationInfo.
435  std::string GetFilePath(StringRef Name, const ToolChain &TC) const;
436 
437  /// GetProgramPath - Lookup \p Name in the list of program search paths.
438  ///
439  /// \param TC - The provided tool chain for additional information on
440  /// directories to search.
441  //
442  // FIXME: This should be in CompilationInfo.
443  std::string GetProgramPath(StringRef Name, const ToolChain &TC) const;
444 
445  /// handleAutocompletions - Handle --autocomplete by searching and printing
446  /// possible flags, descriptions, and its arguments.
447  void handleAutocompletions(StringRef PassedFlags) const;
448 
449  /// HandleImmediateArgs - Handle any arguments which should be
450  /// treated before building actions or binding tools.
451  ///
452  /// \return Whether any compilation should be built for this
453  /// invocation.
454  bool HandleImmediateArgs(const Compilation &C);
455 
456  /// ConstructAction - Construct the appropriate action to do for
457  /// \p Phase on the \p Input, taking in to account arguments
458  /// like -fsyntax-only or --analyze.
459  Action *ConstructPhaseAction(Compilation &C, const llvm::opt::ArgList &Args,
460  phases::ID Phase, Action *Input) const;
461 
462  /// BuildJobsForAction - Construct the jobs to perform for the action \p A and
463  /// return an InputInfo for the result of running \p A. Will only construct
464  /// jobs for a given (Action, ToolChain, BoundArch, DeviceKind) tuple once.
465  InputInfo
466  BuildJobsForAction(Compilation &C, const Action *A, const ToolChain *TC,
467  StringRef BoundArch, bool AtTopLevel, bool MultipleArchs,
468  const char *LinkingOutput,
469  std::map<std::pair<const Action *, std::string>, InputInfo>
470  &CachedResults,
471  Action::OffloadKind TargetDeviceOffloadKind) const;
472 
473  /// Returns the default name for linked images (e.g., "a.out").
474  const char *getDefaultImageName() const;
475 
476  /// GetNamedOutputPath - Return the name to use for the output of
477  /// the action \p JA. The result is appended to the compilation's
478  /// list of temporary or result files, as appropriate.
479  ///
480  /// \param C - The compilation.
481  /// \param JA - The action of interest.
482  /// \param BaseInput - The original input file that this action was
483  /// triggered by.
484  /// \param BoundArch - The bound architecture.
485  /// \param AtTopLevel - Whether this is a "top-level" action.
486  /// \param MultipleArchs - Whether multiple -arch options were supplied.
487  /// \param NormalizedTriple - The normalized triple of the relevant target.
488  const char *GetNamedOutputPath(Compilation &C, const JobAction &JA,
489  const char *BaseInput, StringRef BoundArch,
490  bool AtTopLevel, bool MultipleArchs,
491  StringRef NormalizedTriple) const;
492 
493  /// GetTemporaryPath - Return the pathname of a temporary file to use
494  /// as part of compilation; the file will have the given prefix and suffix.
495  ///
496  /// GCC goes to extra lengths here to be a bit more robust.
497  std::string GetTemporaryPath(StringRef Prefix, StringRef Suffix) const;
498 
499  /// Return the pathname of the pch file in clang-cl mode.
500  std::string GetClPchPath(Compilation &C, StringRef BaseName) const;
501 
502  /// ShouldUseClangCompiler - Should the clang compiler be used to
503  /// handle this action.
504  bool ShouldUseClangCompiler(const JobAction &JA) const;
505 
506  /// Returns true if we are performing any kind of LTO.
507  bool isUsingLTO() const { return LTOMode != LTOK_None; }
508 
509  /// Get the specific kind of LTO being performed.
510  LTOKind getLTOMode() const { return LTOMode; }
511 
512 private:
513 
514  /// Tries to load options from configuration file.
515  ///
516  /// \returns true if error occurred.
517  bool loadConfigFile();
518 
519  /// Read options from the specified file.
520  ///
521  /// \param [in] FileName File to read.
522  /// \returns true, if error occurred while reading.
523  bool readConfigFile(StringRef FileName);
524 
525  /// Set the driver mode (cl, gcc, etc) from an option string of the form
526  /// --driver-mode=<mode>.
527  void setDriverModeFromOption(StringRef Opt);
528 
529  /// Parse the \p Args list for LTO options and record the type of LTO
530  /// compilation based on which -f(no-)?lto(=.*)? option occurs last.
531  void setLTOMode(const llvm::opt::ArgList &Args);
532 
533  /// \brief Retrieves a ToolChain for a particular \p Target triple.
534  ///
535  /// Will cache ToolChains for the life of the driver object, and create them
536  /// on-demand.
537  const ToolChain &getToolChain(const llvm::opt::ArgList &Args,
538  const llvm::Triple &Target) const;
539 
540  /// @}
541 
542  /// \brief Get bitmasks for which option flags to include and exclude based on
543  /// the driver mode.
544  std::pair<unsigned, unsigned> getIncludeExcludeOptionFlagMasks() const;
545 
546  /// Helper used in BuildJobsForAction. Doesn't use the cache when building
547  /// jobs specifically for the given action, but will use the cache when
548  /// building jobs for the Action's inputs.
549  InputInfo BuildJobsForActionNoCache(
550  Compilation &C, const Action *A, const ToolChain *TC, StringRef BoundArch,
551  bool AtTopLevel, bool MultipleArchs, const char *LinkingOutput,
552  std::map<std::pair<const Action *, std::string>, InputInfo>
553  &CachedResults,
554  Action::OffloadKind TargetDeviceOffloadKind) const;
555 
556 public:
557  /// GetReleaseVersion - Parse (([0-9]+)(.([0-9]+)(.([0-9]+)?))?)? and
558  /// return the grouped values as integers. Numbers which are not
559  /// provided are set to 0.
560  ///
561  /// \return True if the entire string was parsed (9.2), or all
562  /// groups were parsed (10.3.5extrastuff). HadExtra is true if all
563  /// groups were parsed but extra characters remain at the end.
564  static bool GetReleaseVersion(StringRef Str, unsigned &Major, unsigned &Minor,
565  unsigned &Micro, bool &HadExtra);
566 
567  /// Parse digits from a string \p Str and fulfill \p Digits with
568  /// the parsed numbers. This method assumes that the max number of
569  /// digits to look for is equal to Digits.size().
570  ///
571  /// \return True if the entire string was parsed and there are
572  /// no extra characters remaining at the end.
573  static bool GetReleaseVersion(StringRef Str,
575  /// Compute the default -fmodule-cache-path.
576  static void getDefaultModuleCachePath(SmallVectorImpl<char> &Result);
577 };
578 
579 /// \return True if the last defined optimization level is -Ofast.
580 /// And False otherwise.
581 bool isOptimizationLevelFast(const llvm::opt::ArgList &Args);
582 
583 } // end namespace driver
584 } // end namespace clang
585 
586 #endif
ID
ID - Ordered values for successive stages in the compilation process which interact with user options...
Definition: Phases.h:18
prefix_list PrefixDirs
Definition: Driver.h:146
DominatorTree GraphTraits specialization so the DominatorTree can be iterable by generic graph iterat...
Definition: Dominators.h:26
unsigned CCPrintHeaders
Set CC_PRINT_HEADERS mode, which causes the frontend to log header include information to CCPrintHead...
Definition: Driver.h:194
unsigned CCCUsePCH
Use lazy precompiled headers for PCH support.
Definition: Driver.h:232
bool isUsingLTO() const
Returns true if we are performing any kind of LTO.
Definition: Driver.h:507
DiagnosticBuilder Report(SourceLocation Loc, unsigned DiagID)
Issue the message to the client.
Definition: Diagnostic.h:1294
std::string DyldPrefix
Dynamic loader prefix, if present.
Definition: Driver.h:152
bool embedBitcodeEnabled() const
Definition: Driver.h:330
LTOKind getLTOMode() const
Get the specific kind of LTO being performed.
Definition: Driver.h:510
DiagnosticBuilder Diag(unsigned DiagID) const
Definition: Driver.h:110
The virtual file system interface.
bool embedBitcodeMarkerOnly() const
Definition: Driver.h:332
unsigned CCLogDiagnostics
Set CC_LOG_DIAGNOSTICS mode, which causes the frontend to log diagnostics to CCLogDiagnosticsFilename...
Definition: Driver.h:199
const std::string & getTitle()
Definition: Driver.h:309
std::string Dir
The path the driver executable was in, as invoked from the command line.
Definition: Driver.h:121
Action - Represent an abstract compilation step to perform.
Definition: Action.h:45
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified...
InputInfo - Wrapper for information about an input source.
Definition: InputInfo.h:23
Concrete class used by the front-end to report problems and issues.
Definition: Diagnostic.h:149
bool isOptimizationLevelFast(const llvm::opt::ArgList &Args)
void setTargetAndMode(const ParsedClangName &TM)
Definition: Driver.h:307
Defines the Diagnostic-related interfaces.
The LLVM OpenMP runtime.
Definition: Driver.h:96
Driver - Encapsulate logic for constructing compilation processes from a set of gcc-driver-like comma...
Definition: Driver.h:59
An unknown OpenMP runtime.
Definition: Driver.h:92
const char * CCPrintOptionsFilename
The file to log CC_PRINT_OPTIONS output to, if enabled.
Definition: Driver.h:161
std::string HostSystem
Definition: Driver.h:158
SmallVector< std::pair< types::ID, const llvm::opt::Arg * >, 16 > InputList
A list of inputs and their types for the given arguments.
Definition: Driver.h:171
A little helper class used to produce diagnostics.
Definition: Diagnostic.h:1042
unsigned GenReproducer
Force clang to emit reproducer for driver invocation.
Definition: Driver.h:237
const DiagnosticsEngine & getDiags() const
Definition: Driver.h:299
bool isSaveTempsObj() const
Definition: Driver.h:328
const std::string & getConfigFile() const
Definition: Driver.h:295
bool IsCLMode() const
Whether the driver should follow cl.exe like behavior.
Definition: Driver.h:183
unsigned CCPrintOptions
Set CC_PRINT_OPTIONS mode, which is like -v but logs the commands to CCPrintOptionsFilename or to std...
Definition: Driver.h:190
void setCheckInputsExist(bool Value)
Definition: Driver.h:305
bool embedBitcodeInObject() const
Definition: Driver.h:331
Command - An executable path/name and argument vector to execute.
Definition: Job.h:44
vfs::FileSystem & getVFS() const
Definition: Driver.h:301
std::string InstalledDir
The path to the installed clang directory, if any.
Definition: Driver.h:130
bool CCCIsCXX() const
Whether the driver should follow g++ like behavior.
Definition: Driver.h:174
bool isSaveTempsEnabled() const
Definition: Driver.h:327
std::string UserConfigDir
User directory for config files.
Definition: Driver.h:139
void setTitle(std::string Value)
Definition: Driver.h:310
Helper structure used to pass information extracted from clang executable name such as i686-linux-and...
Definition: ToolChain.h:53
void EmbedBitcode(llvm::Module *M, const CodeGenOptions &CGOpts, llvm::MemoryBufferRef Buf)
Dataflow Directional Tag Classes.
const char * CCPrintHeadersFilename
The file to log CC_PRINT_HEADERS output to, if enabled.
Definition: Driver.h:164
unsigned CCCPrintBindings
Only print tool bindings, don&#39;t build any jobs.
Definition: Driver.h:186
const std::string & getCCCGenericGCCName() const
Name to use when invoking gcc/g++.
Definition: Driver.h:293
std::string SysRoot
sysroot, if present
Definition: Driver.h:149
Tool - Information on a specific compilation tool.
Definition: Tool.h:34
std::string Name
The name the driver was invoked as.
Definition: Driver.h:117
The GNU OpenMP runtime.
Definition: Driver.h:101
ParsedClangName ClangNameParts
Target and driver mode components extracted from clang executable name.
Definition: Driver.h:127
bool getCheckInputsExist() const
Definition: Driver.h:303
const char * getInstalledDir() const
Get the path to where the clang executable was installed.
Definition: Driver.h:318
std::string ClangExecutable
The original path to the clang executable.
Definition: Driver.h:124
Compilation - A set of tasks to perform for a single driver invocation.
Definition: Compilation.h:34
SmallVector< std::string, 4 > prefix_list
A prefix directory used to emulate a limited subset of GCC&#39;s &#39;-Bprefix&#39; functionality.
Definition: Driver.h:145
const char * CCLogDiagnosticsFilename
The file to log CC_LOG_DIAGNOSTICS output to, if enabled.
Definition: Driver.h:167
LTOKind
Describes the kind of LTO mode selected via -f(no-)?lto(=.*)? options.
Definition: Driver.h:50
const llvm::opt::OptTable & getOpts() const
Definition: Driver.h:297
const char * getClangProgramPath() const
Get the path to the main clang executable.
Definition: Driver.h:313
std::string DriverTitle
Driver title to use with help.
Definition: Driver.h:155
bool CCCIsCPP() const
Whether the driver is just the preprocessor.
Definition: Driver.h:177
void setInstalledDir(StringRef Value)
Definition: Driver.h:323
bool CCCIsCC() const
Whether the driver should follow gcc like behavior.
Definition: Driver.h:180
unsigned CCGenDiagnostics
Whether the driver is generating diagnostics for debugging purposes.
Definition: Driver.h:202
std::string SystemConfigDir
System directory for config files.
Definition: Driver.h:136
ToolChain - Access to tools for a single platform.
Definition: ToolChain.h:73
std::string ResourceDir
The path to the compiler resource directory.
Definition: Driver.h:133