|
clang 24.0.0git
|
Driver - Encapsulate logic for constructing compilation processes from a set of gcc-driver-like command line arguments. More...
#include "clang/Driver/Driver.h"
Classes | |
| struct | CompilationDiagnosticReport |
| Contains the files in the compilation diagnostic report generated by generateCompilationDiagnostics. More... | |
Public Types | |
| enum | OpenMPRuntimeKind { OMPRT_Unknown , OMPRT_OMP , OMPRT_GOMP , OMPRT_IOMP5 } |
| typedef SmallVector< std::string, 4 > | prefix_list |
| A prefix directory used to emulate a limited subset of GCC's '-Bprefix' functionality. | |
| using | CC1ToolFunc |
| Pointer to the ExecuteCC1Tool function, if available. | |
Public Member Functions | |
| DiagnosticBuilder | Diag (unsigned DiagID) const |
| bool | CCCIsCXX () const |
| Whether the driver should follow g++ like behavior. | |
| bool | CCCIsCPP () const |
| Whether the driver is just the preprocessor. | |
| bool | CCCIsCC () const |
| Whether the driver should follow gcc like behavior. | |
| bool | IsCLMode () const |
| Whether the driver should follow cl.exe like behavior. | |
| bool | IsFlangMode () const |
| Whether the driver should invoke flang for fortran inputs. | |
| bool | IsDXCMode () const |
| Whether the driver should follow dxc.exe like behavior. | |
| phases::ID | getFinalPhase (const llvm::opt::DerivedArgList &DAL, llvm::opt::Arg **FinalPhaseArg=nullptr) const |
| llvm::Expected< std::unique_ptr< llvm::MemoryBuffer > > | executeProgram (llvm::ArrayRef< llvm::StringRef > Args) const |
| Driver (StringRef DriverExecutable, StringRef TargetTriple, DiagnosticsEngine &Diags, std::string Title="clang LLVM compiler", IntrusiveRefCntPtr< llvm::vfs::FileSystem > VFS=nullptr) | |
Accessors | |
| const std::string & | getCCCGenericGCCName () const |
| Name to use when invoking gcc/g++. | |
| llvm::ArrayRef< std::string > | getConfigFiles () const |
| const llvm::opt::OptTable & | getOpts () const |
| DiagnosticsEngine & | getDiags () const |
| llvm::vfs::FileSystem & | getVFS () const |
| bool | getCheckInputsExist () const |
| void | setCheckInputsExist (bool Value) |
| bool | getProbePrecompiled () const |
| void | setProbePrecompiled (bool Value) |
| const char * | getPrependArg () const |
| void | setPrependArg (const char *Value) |
| void | setTargetAndMode (const ParsedClangName &TM) |
| const std::string & | getTitle () |
| void | setTitle (std::string Value) |
| std::string | getTargetTriple () const |
| const char * | getDriverProgramPath () const |
| Get the path to the main driver executable. | |
| StringRef | getPreferredLinker () const |
| void | setPreferredLinker (std::string Value) |
| bool | isSaveTempsEnabled () const |
| bool | isSaveTempsObj () const |
| bool | embedBitcodeEnabled () const |
| bool | embedBitcodeInObject () const |
| bool | embedBitcodeMarkerOnly () const |
| bool | offloadHostOnly () const |
| bool | offloadDeviceOnly () const |
| void | setFlangF128MathLibrary (std::string name) |
| StringRef | getFlangF128MathLibrary () const |
| OpenMPRuntimeKind | getOpenMPRuntime (const llvm::opt::ArgList &Args) const |
| Compute the desired OpenMP runtime from the flags provided. | |
Public Attributes | |
| std::string | Name |
| The name the driver was invoked as. | |
| std::string | Dir |
| The path the driver executable was in, as invoked from the command line. | |
| std::string | DriverExecutable |
| The original path to the driver executable. | |
| ParsedClangName | ClangNameParts |
| Target and driver mode components extracted from clang executable name. | |
| std::string | ResourceDir |
| The path to the compiler resource directory. | |
| std::string | SystemConfigDir |
| System directory for config files. | |
| std::string | UserConfigDir |
| User directory for config files. | |
| prefix_list | PrefixDirs |
| std::string | SysRoot |
| sysroot, if present | |
| std::string | DyldPrefix |
| Dynamic loader prefix, if present. | |
| std::string | DriverTitle |
| Driver title to use with help. | |
| std::string | HostBits |
| Information about the host which can be overridden by the user. | |
| std::string | HostMachine |
| std::string | HostSystem |
| std::string | HostRelease |
| std::string | CCPrintStatReportFilename |
| The file to log CC_PRINT_PROC_STAT_FILE output to, if enabled. | |
| std::string | CCPrintInternalStatReportFilename |
| The file to log CC_PRINT_INTERNAL_STAT_FILE output to, if enabled. | |
| std::string | CCPrintOptionsFilename |
| The file to log CC_PRINT_OPTIONS output to, if enabled. | |
| std::string | CCPrintHeadersFilename |
| The file to log CC_PRINT_HEADERS output to, if enabled. | |
| std::string | CCLogDiagnosticsFilename |
| The file to log CC_LOG_DIAGNOSTICS output to, if enabled. | |
| unsigned | CCCPrintBindings: 1 |
| Only print tool bindings, don't build any jobs. | |
| unsigned | CCPrintOptions: 1 |
| Set CC_PRINT_OPTIONS mode, which is like -v but logs the commands to CCPrintOptionsFilename or to stderr. | |
| HeaderIncludeFormatKind | CCPrintHeadersFormat = HIFMT_None |
| The format of the header information that is emitted. | |
| HeaderIncludeFilteringKind | CCPrintHeadersFiltering = HIFIL_None |
| This flag determines whether clang should filter the header information that is emitted. | |
| std::string | FlangF128MathLibrary |
| Name of the library that provides implementations of IEEE-754 128-bit float math functions used by Fortran F128 runtime library. | |
| unsigned | CCLogDiagnostics: 1 |
| Set CC_LOG_DIAGNOSTICS mode, which causes the frontend to log diagnostics to CCLogDiagnosticsFilename or to stderr, in a stable machine readable format. | |
| unsigned | CCGenDiagnostics: 1 |
| Whether the driver is generating diagnostics for debugging purposes. | |
| unsigned | CCPrintProcessStats: 1 |
| Set CC_PRINT_PROC_STAT mode, which causes the driver to dump performance report to CC_PRINT_PROC_STAT_FILE or to stdout. | |
| unsigned | CCPrintInternalStats: 1 |
| Set CC_PRINT_INTERNAL_STAT mode, which causes the driver to dump internal performance report to CC_PRINT_INTERNAL_STAT_FILE or to stdout. | |
| CC1ToolFunc | CC1Main = nullptr |
Primary Functionality | |
| enum class | CommandStatus { Crash = 1 , Error , Ok } |
| enum class | ReproLevel { Off = 0 , OnCrash = static_cast<int>(CommandStatus::Crash) , OnError = static_cast<int>(CommandStatus::Error) , Always = static_cast<int>(CommandStatus::Ok) } |
| void | CreateOffloadingDeviceToolChains (Compilation &C, InputList &Inputs) |
| CreateOffloadingDeviceToolChains - create all the toolchains required to support offloading devices given the programming models specified in the current compilation. | |
| Compilation * | BuildCompilation (ArrayRef< const char * > Args) |
| BuildCompilation - Construct a compilation object for a command line argument vector. | |
| llvm::opt::InputArgList | ParseArgStrings (ArrayRef< const char * > Args, bool UseDriverMode, bool &ContainsError) const |
| ParseArgStrings - Parse the given list of strings into an ArgList. | |
| void | BuildInputs (const ToolChain &TC, llvm::opt::DerivedArgList &Args, InputList &Inputs) const |
| BuildInputs - Construct the list of inputs and their types from the given arguments. | |
| void | BuildActions (Compilation &C, llvm::opt::DerivedArgList &Args, const InputList &Inputs, ActionList &Actions) const |
| BuildActions - Construct the list of actions to perform for the given arguments, which are only done for a single architecture. | |
| void | BuildUniversalActions (Compilation &C, const ToolChain &TC, const InputList &BAInputs) const |
| BuildUniversalActions - Construct the list of actions to perform for the given arguments, which may require a universal build. | |
| Action * | BuildOffloadingActions (Compilation &C, llvm::opt::DerivedArgList &Args, const InputTy &Input, StringRef CUID, Action *HostAction, ActionList *HIPAsmBundleDeviceOut=nullptr) const |
| BuildOffloadingActions - Construct the list of actions to perform for the offloading toolchain that will be embedded in the host. | |
| llvm::SmallVector< BoundArch > | getOffloadArchs (Compilation &C, const llvm::opt::DerivedArgList &Args, Action::OffloadKind Kind, const ToolChain &TC) const |
| Returns the set of bound architectures active for this offload kind. | |
| bool | DiagnoseInputExistence (StringRef Value, types::ID Ty, bool TypoCorrect) const |
| Check that the file referenced by Value exists. | |
| void | BuildJobs (Compilation &C) const |
| BuildJobs - Bind actions to concrete tools and translate arguments to form the list of jobs to run. | |
| int | ExecuteCompilation (Compilation &C, SmallVectorImpl< std::pair< int, const Command * > > &FailingCommands) |
| ExecuteCompilation - Execute the compilation according to the command line arguments and return an appropriate exit code. | |
| void | generateCompilationDiagnostics (Compilation &C, const Command &FailingCommand, StringRef AdditionalInformation="", CompilationDiagnosticReport *GeneratedReport=nullptr) |
| generateCompilationDiagnostics - Generate diagnostics information including preprocessed source file(s). | |
| bool | maybeGenerateCompilationDiagnostics (CommandStatus CS, ReproLevel Level, Compilation &C, const Command &FailingCommand, StringRef AdditionalInformation="", CompilationDiagnosticReport *GeneratedReport=nullptr) |
Helper Methods | |
| void | PrintActions (const Compilation &C) const |
| PrintActions - Print the list of actions. | |
| void | PrintHelp (bool ShowHidden) const |
| PrintHelp - Print the help text. | |
| void | PrintVersion (const Compilation &C, raw_ostream &OS) const |
| PrintVersion - Print the driver version. | |
| std::string | GetFilePath (StringRef Name, const ToolChain &TC) const |
GetFilePath - Lookup Name in the list of file search paths. | |
| std::string | GetProgramPath (StringRef Name, const ToolChain &TC) const |
GetProgramPath - Lookup Name in the list of program search paths. | |
| std::string | GetStdModuleManifestPath (const Compilation &C, const ToolChain &TC) const |
| Lookup the path to the Standard library module manifest. | |
| void | HandleAutocompletions (StringRef PassedFlags) const |
| HandleAutocompletions - Handle –autocomplete by searching and printing possible flags, descriptions, and its arguments. | |
| bool | HandleImmediateArgs (Compilation &C) |
| HandleImmediateArgs - Handle any arguments which should be treated before building actions or binding tools. | |
| Action * | ConstructPhaseAction (Compilation &C, const llvm::opt::ArgList &Args, phases::ID Phase, Action *Input, Action::OffloadKind TargetDeviceOffloadKind=Action::OFK_None, LTOKind TargetLTOMode=LTOK_None) const |
ConstructAction - Construct the appropriate action to do for Phase on the Input, taking in to account arguments like -fsyntax-only or –analyze. | |
| InputInfoList | BuildJobsForAction (Compilation &C, const Action *A, const ToolChain *TC, BoundArch BA, bool AtTopLevel, bool MultipleArchs, const char *LinkingOutput, std::map< std::pair< const Action *, std::string >, InputInfoList > &CachedResults, Action::OffloadKind TargetDeviceOffloadKind) const |
BuildJobsForAction - Construct the jobs to perform for the action A and return an InputInfo for the result of running A. | |
| const char * | getDefaultImageName () const |
| Returns the default name for linked images (e.g., "a.out"). | |
| const char * | CreateTempFile (Compilation &C, StringRef Prefix, StringRef Suffix, bool MultipleArchs=false, StringRef BoundArchStr={}, bool NeedUniqueDirectory=false) const |
| Creates a temp file. | |
| const char * | GetNamedOutputPath (Compilation &C, const JobAction &JA, const char *BaseInput, BoundArch BA, bool AtTopLevel, bool MultipleArchs, StringRef NormalizedTriple) const |
GetNamedOutputPath - Return the name to use for the output of the action JA. | |
| std::string | GetTemporaryPath (StringRef Prefix, StringRef Suffix) const |
| GetTemporaryPath - Return the pathname of a temporary file to use as part of compilation; the file will have the given prefix and suffix. | |
| std::string | GetTemporaryDirectory (StringRef Prefix) const |
| GetTemporaryDirectory - Return the pathname of a temporary directory to use as part of compilation; the directory will have the given prefix. | |
| std::string | GetClPchPath (Compilation &C, StringRef BaseName) const |
| Return the pathname of the pch file in clang-cl mode. | |
| bool | ShouldUseClangCompiler (const JobAction &JA) const |
| ShouldUseClangCompiler - Should the clang compiler be used to handle this action. | |
| bool | ShouldUseFlangCompiler (const JobAction &JA) const |
| ShouldUseFlangCompiler - Should the flang compiler be used to handle this action. | |
| bool | ShouldEmitStaticLibrary (const llvm::opt::ArgList &Args) const |
| ShouldEmitStaticLibrary - Should the linker emit a static library. | |
| bool | hasHeaderMode () const |
| Returns true if the user has indicated a C++20 header unit mode. | |
| ModuleHeaderMode | getModuleHeaderMode () const |
| Get the mode for handling headers as set by fmodule-header{=}. | |
| const CUIDOptions & | getCUIDOpts () const |
| Get the CUID option. | |
| static bool | GetReleaseVersion (StringRef Str, unsigned &Major, unsigned &Minor, unsigned &Micro, bool &HadExtra) |
| GetReleaseVersion - Parse (([0-9]+)(. | |
| static bool | GetReleaseVersion (StringRef Str, MutableArrayRef< unsigned > Digits) |
Parse digits from a string Str and fulfill Digits with the parsed numbers. | |
| static bool | getDefaultModuleCachePath (SmallVectorImpl< char > &Result) |
| Compute the default -fmodule-cache-path. | |
Driver - Encapsulate logic for constructing compilation processes from a set of gcc-driver-like command line arguments.
Pointer to the ExecuteCC1Tool function, if available.
When the clangDriver lib is used through clang.exe, this provides a shortcut for executing the -cc1 command-line directly, in the same process.
| typedef SmallVector<std::string, 4> clang::driver::Driver::prefix_list |
|
strong |
|
strong |
| Driver::Driver | ( | StringRef | DriverExecutable, |
| StringRef | TargetTriple, | ||
| DiagnosticsEngine & | Diags, | ||
| std::string | Title = "clang LLVM compiler", | ||
| IntrusiveRefCntPtr< llvm::vfs::FileSystem > | VFS = nullptr ) |
Definition at line 200 of file Driver.cpp.
References CCCPrintBindings, CCGenDiagnostics, CCLogDiagnostics, CCPrintInternalStats, CCPrintOptions, CCPrintProcessStats, Dir, DriverExecutable, DriverTitle, false, clang::GetResourcesPath(), clang::driver::HeaderMode_None, Name, clang::nullptr, ResourceDir, SysRoot, SystemConfigDir, true, and UserConfigDir.
| void Driver::BuildActions | ( | Compilation & | C, |
| llvm::opt::DerivedArgList & | Args, | ||
| const InputList & | Inputs, | ||
| ActionList & | Actions ) const |
BuildActions - Construct the list of actions to perform for the given arguments, which are only done for a single architecture.
| C | - The compilation that is being built. |
| Args | - The input arguments. |
| Actions | - The list to store the resulting actions onto. |
Definition at line 3591 of file Driver.cpp.
References BuildOffloadingActions(), clang::C, clang::cast(), clang::driver::phases::Compile, ConstructPhaseAction(), Diag(), clang::driver::types::getCompilationPhases(), getFinalPhase(), clang::driver::Action::getType(), clang::driver::phases::IfsMerge, IsFlangMode(), clang::driver::types::isSrcFile(), clang::driver::phases::Link, offloadDeviceOnly(), clang::driver::Action::OFK_HIP, clang::driver::Action::OFK_None, clang::driver::phases::Precompile, clang::driver::Action::propagateHostOffloadInfo(), and ShouldEmitStaticLibrary().
Referenced by BuildCompilation(), BuildUniversalActions(), and generateCompilationDiagnostics().
| Compilation * Driver::BuildCompilation | ( | ArrayRef< const char * > | Args | ) |
BuildCompilation - Construct a compilation object for a command line argument vector.
Definition at line 1509 of file Driver.cpp.
References appendOneArg(), BuildActions(), BuildInputs(), BuildJobs(), clang::driver::modules::buildStdModuleManifestInputs(), BuildUniversalActions(), clang::C, CCCPrintBindings, CCPrintProcessStats, CCPrintStatReportFilename, computeTargetTriple(), CreateOffloadingDeviceToolChains(), Diag(), clang::driver::modules::diagnoseModulesDriverArgs(), Dir, DriverExecutable, DyldPrefix, getDiags(), clang::driver::getDriverMode(), getFinalPhase(), clang::driver::ToolChain::getMultilibMacroDefinesStr(), GetStdModuleManifestPath(), clang::driver::ToolChain::getTriple(), clang::driver::ToolChain::getTripleString(), getVFS(), HandleImmediateArgs(), clang::driver::HeaderMode_Default, clang::driver::HeaderMode_System, clang::driver::HeaderMode_User, IsCLMode(), IsDXCMode(), clang::driver::phases::Link, clang::driver::modules::StdModuleManifest::Modules, Name, ParseArgStrings(), clang::driver::toolchains::HLSLToolChain::parseTargetProfile(), PrefixDirs, PrintActions(), clang::driver::modules::readStdModuleManifest(), clang::DiagnosticsEngine::Report(), ResourceDir, clang::driver::modules::runModulesDriver(), SysRoot, and clang::T.
Referenced by clang::createInvocation().
| void Driver::BuildInputs | ( | const ToolChain & | TC, |
| llvm::opt::DerivedArgList & | Args, | ||
| InputList & | Inputs ) const |
BuildInputs - Construct the list of inputs and their types from the given arguments.
| TC | - The default host tool chain. |
| Args | - The input arguments. |
| Inputs | - The list to store the resulting compilation inputs onto. |
Definition at line 3172 of file Driver.cpp.
References CCCIsCPP(), CCCIsCXX(), CCGenDiagnostics, CXXHeaderUnitType(), Diag(), DiagnoseInputExistence(), clang::driver::Action::getKind(), getOpts(), hasHeaderMode(), IsCLMode(), IsDXCMode(), IsFlangMode(), clang::options::LinkerInput, clang::driver::types::lookupCXXTypeForCType(), clang::driver::ToolChain::LookupTypeForExtension(), clang::driver::types::lookupTypeForTypeSpecifier(), clang::driver::makeInputArg(), Previous, and clang::driver::types::TY_INVALID.
Referenced by BuildCompilation(), and generateCompilationDiagnostics().
| void Driver::BuildJobs | ( | Compilation & | C | ) | const |
BuildJobs - Bind actions to concrete tools and translate arguments to form the list of jobs to run.
| C | - The compilation that is being built. |
Definition at line 4579 of file Driver.cpp.
References clang::driver::Action::BinaryAnalyzeJobClass, clang::driver::Action::BinaryTranslatorJobClass, clang::driver::Action::BindArchClass, BuildJobsForAction(), clang::C, CCPrintProcessStats, CCPrintStatReportFilename, claimAndDiagnoseOffloadJobs(), clang::driver::Action::CompileJobClass, Diag(), getDefaultImageName(), clang::driver::Command::getExecutable(), clang::driver::Action::getInputs(), clang::driver::Action::getKind(), clang::driver::Command::getOutputFilenames(), clang::driver::Command::getProcessStatistics(), getTargetTriple(), clang::driver::Action::getType(), clang::driver::Action::IfsMergeJobClass, clang::isa(), IsCLMode(), markOffloadDeviceCC1JobsForParallelExecution(), clang::options::NoArgumentUnused, clang::driver::Action::OffloadClass, clang::driver::Action::OFK_None, clang::driver::Action::size(), clang::options::TargetSpecific, and toString().
Referenced by BuildCompilation(), and generateCompilationDiagnostics().
| InputInfoList Driver::BuildJobsForAction | ( | Compilation & | C, |
| const Action * | A, | ||
| const ToolChain * | TC, | ||
| BoundArch | BA, | ||
| bool | AtTopLevel, | ||
| bool | MultipleArchs, | ||
| const char * | LinkingOutput, | ||
| std::map< std::pair< const Action *, std::string >, InputInfoList > & | CachedResults, | ||
| Action::OffloadKind | TargetDeviceOffloadKind ) const |
BuildJobsForAction - Construct the jobs to perform for the action A and return an InputInfo for the result of running A.
Will only construct jobs for a given (Action, ToolChain, BoundArch, DeviceKind) tuple once.
Definition at line 5131 of file Driver.cpp.
References clang::C, GetTriplePlusArchString(), and clang::Result.
Referenced by BuildJobs().
| Action * Driver::BuildOffloadingActions | ( | Compilation & | C, |
| llvm::opt::DerivedArgList & | Args, | ||
| const InputTy & | Input, | ||
| StringRef | CUID, | ||
| Action * | HostAction, | ||
| ActionList * | HIPAsmBundleDeviceOut = nullptr ) const |
BuildOffloadingActions - Construct the list of actions to perform for the offloading toolchain that will be embedded in the host.
| C | - The compilation that is being built. |
| Args | - The input arguments. |
| Input | - The input type and arguments |
| CUID | - The CUID for Input |
| HostAction | - The host action used in the offloading toolchain. |
| HIPAsmBundleDeviceOut | - If non-null, HIP non-RDC -S (AMDGCN) device actions are appended here and HostAction is returned unchanged so the caller can emit a bundled .s via OffloadBundlingJobAction. |
Definition at line 4091 of file Driver.cpp.
References clang::driver::OffloadAction::DeviceDependences::add(), Arch, clang::driver::phases::Assemble, clang::C, ConstructPhaseAction(), clang::driver::OffloadAction::DeviceDependences::getActions(), clang::driver::types::getCompilationPhases(), getFinalPhase(), clang::driver::Action::getInputs(), getOffloadArchs(), clang::driver::Action::getOffloadingToolChain(), clang::driver::ToolChain::getTriple(), clang::driver::Action::getType(), clang::isa(), clang::driver::types::isCuda(), clang::driver::types::isHIP(), clang::driver::types::isSrcFile(), clang::driver::phases::Link, offloadDeviceOnly(), offloadHostOnly(), clang::driver::Action::OFK_Cuda, clang::driver::Action::OFK_HIP, clang::driver::Action::OFK_Host, clang::driver::Action::OFK_OpenMP, clang::driver::Action::OFK_SYCL, clang::driver::phases::Preprocess, clang::driver::Action::propagateDeviceOffloadInfo(), clang::driver::Action::setCannotBeCollapsedWithNextDependentAction(), and shouldBundleHIPAsm().
Referenced by BuildActions().
| void Driver::BuildUniversalActions | ( | Compilation & | C, |
| const ToolChain & | TC, | ||
| const InputList & | BAInputs ) const |
BuildUniversalActions - Construct the list of actions to perform for the given arguments, which may require a universal build.
| C | - The compilation that is being built. |
| TC | - The default host tool chain. |
Definition at line 2986 of file Driver.cpp.
References Arch, BuildActions(), clang::C, clang::driver::types::canLipoType(), ContainsCompileOrAssembleAction(), Diag(), clang::driver::tools::darwin::getArchTypeForMachOArchName(), clang::driver::ToolChain::getDefaultUniversalArchName(), clang::driver::types::getTypeName(), and clang::driver::willEmitRemarks().
Referenced by BuildCompilation(), and generateCompilationDiagnostics().
|
inline |
|
inline |
Whether the driver is just the preprocessor.
Definition at line 226 of file Driver.h.
Referenced by BuildInputs(), CheckPreprocessingOptions(), and getFinalPhase().
|
inline |
Whether the driver should follow g++ like behavior.
Definition at line 223 of file Driver.h.
Referenced by AddLibgcc(), AddUnwindLibrary(), BuildInputs(), constructHexagonLinkArgs(), clang::driver::toolchains::cygwin::Linker::ConstructJob(), clang::driver::tools::aix::Linker::ConstructJob(), clang::driver::tools::Clang::ConstructJob(), clang::driver::tools::dragonfly::Linker::ConstructJob(), clang::driver::tools::freebsd::Linker::ConstructJob(), clang::driver::tools::fuchsia::Linker::ConstructJob(), clang::driver::tools::gcc::Common::ConstructJob(), clang::driver::tools::gnutools::Linker::ConstructJob(), clang::driver::tools::haiku::Linker::ConstructJob(), clang::driver::tools::netbsd::Linker::ConstructJob(), clang::driver::tools::openbsd::Linker::ConstructJob(), clang::driver::tools::solaris::Linker::ConstructJob(), clang::driver::SanitizerArgs::SanitizerArgs(), and clang::driver::ToolChain::ShouldLinkCXXStdlib().
| Action * Driver::ConstructPhaseAction | ( | Compilation & | C, |
| const llvm::opt::ArgList & | Args, | ||
| phases::ID | Phase, | ||
| Action * | Input, | ||
| Action::OffloadKind | TargetDeviceOffloadKind = Action::OFK_None, | ||
| LTOKind | TargetLTOMode = LTOK_None ) const |
ConstructAction - Construct the appropriate action to do for Phase on the Input, taking in to account arguments like -fsyntax-only or –analyze.
Definition at line 4351 of file Driver.cpp.
References clang::driver::phases::Assemble, clang::driver::phases::Backend, clang::C, CCGenDiagnostics, clang::driver::phases::Compile, clang::driver::types::getPreprocessedType(), clang::driver::Action::getType(), clang::driver::phases::IfsMerge, clang::driver::phases::Link, clang::driver::LTOK_None, offloadDeviceOnly(), clang::driver::Action::OFK_None, clang::driver::Action::OFK_SYCL, clang::driver::phases::Precompile, clang::driver::phases::Preprocess, clang::Target, and clang::driver::types::TY_INVALID.
Referenced by BuildActions(), and BuildOffloadingActions().
| void Driver::CreateOffloadingDeviceToolChains | ( | Compilation & | C, |
| InputList & | Inputs ) |
CreateOffloadingDeviceToolChains - create all the toolchains required to support offloading devices given the programming models specified in the current compilation.
Also, update the host tool chain kind accordingly.
Definition at line 1070 of file Driver.cpp.
References clang::C, Diag(), clang::driver::Action::GetOffloadKindName(), getOpenMPRuntime(), hasFlag(), inferOffloadToolchains(), clang::driver::types::isCuda(), clang::driver::types::isHIP(), clang::driver::ToolChain::normalizeOffloadTriple(), clang::driver::Action::OFK_Cuda, clang::driver::Action::OFK_HIP, clang::driver::Action::OFK_OpenMP, clang::driver::Action::OFK_SYCL, OMPRT_IOMP5, OMPRT_OMP, and clang::Target.
Referenced by BuildCompilation().
| const char * Driver::CreateTempFile | ( | Compilation & | C, |
| StringRef | Prefix, | ||
| StringRef | Suffix, | ||
| bool | MultipleArchs = false, | ||
| StringRef | BoundArchStr = {}, | ||
| bool | NeedUniqueDirectory = false ) const |
Creates a temp file.
MultipleArch is false or BA is empty, the temp file is in the temporary directory with name $Prefix-%%%%%%.$Suffix.MultipleArch is true and BA is not empty, 2a. If NeedUniqueDirectory is false, the temp file is in the temporary directory with name $Prefix-$BA-%%%%%.$Suffix. 2b. If NeedUniqueDirectory is true, the temp file is in a unique subdiretory with random name under the temporary directory, and the temp file itself has name $Prefix-$BA.$Suffix. Definition at line 5489 of file Driver.cpp.
References clang::C, CCGenDiagnostics, Diag(), GetTemporaryDirectory(), GetTemporaryPath(), and getVFS().
Referenced by generateCompilationDiagnostics(), and GetNamedOutputPath().
|
inline |
Definition at line 160 of file Driver.h.
Referenced by clang::driver::SanitizerArgs::addArgs(), clang::driver::XRayArgs::addArgs(), clang::driver::toolchains::CudaToolChain::addClangTargetOptions(), clang::driver::toolchains::HexagonToolChain::addClangTargetOptions(), addCoveragePrefixMapArg(), clang::driver::toolchains::HexagonToolChain::AddCXXStdlibLibArgs(), addDebugPrefixMapArg(), addDefaultIgnorelists(), addFloatingPointOptions(), addIEEEFPModesOptions(), clang::driver::toolchains::DarwinClang::AddLinkARCArgs(), clang::driver::tools::addLinkerCompressDebugSectionsOption(), clang::driver::toolchains::DarwinClang::AddLinkRuntimeLibArgs(), clang::driver::tools::addMachineOutlinerArgs(), addMacroPrefixMapArg(), clang::driver::tools::addMCModel(), clang::driver::tools::addOpenCLBuiltinsLib(), clang::driver::tools::addOpenMPDeviceRTL(), clang::driver::tools::addOutlineAtomicsArgs(), addPGOAndCoverageFlags(), addPGOAndCoverageFlags(), addPgProfilingLinkArgs(), addQFloatBackendArg(), clang::driver::tools::addSplitMachineFunctionsArgs(), clang::driver::tools::ClangAs::AddX86TargetArgs(), BuildActions(), clang::driver::toolchains::MSVCToolChain::buildAssembler(), BuildCompilation(), BuildInputs(), BuildJobs(), BuildUniversalActions(), clang::driver::tools::checkAMDGPUCodeObjectVersion(), checkARMArchName(), checkARMCPUName(), checkARMFloatABI(), CheckCodeGenerationOptions(), clang::driver::toolchains::Darwin::CheckObjCARC(), CheckPreprocessingOptions(), checkRemarksOptions(), checkRemarksOptions(), clang::driver::toolchains::AMDGPUToolChain::checkTargetID(), claimAndDiagnoseOffloadJobs(), clang::driver::Compilation::CleanupFile(), CollectArgsForIntegratedAssembler(), CollectARMPACBTIOptions(), computeTargetTriple(), clang::driver::toolchains::cygwin::Linker::ConstructJob(), clang::driver::tools::aix::Assembler::ConstructJob(), clang::driver::tools::aix::Linker::ConstructJob(), clang::driver::tools::AVR::Linker::ConstructJob(), clang::driver::tools::baremetal::Linker::ConstructJob(), clang::driver::tools::baremetal::StaticLibTool::ConstructJob(), clang::driver::tools::Clang::ConstructJob(), clang::driver::tools::CrossWindows::Linker::ConstructJob(), clang::driver::tools::darwin::Linker::ConstructJob(), clang::driver::tools::darwin::StaticLibTool::ConstructJob(), clang::driver::tools::Flang::ConstructJob(), clang::driver::tools::fuchsia::StaticLibTool::ConstructJob(), clang::driver::tools::gcc::Common::ConstructJob(), clang::driver::tools::gnutools::Linker::ConstructJob(), clang::driver::tools::gnutools::StaticLibTool::ConstructJob(), clang::driver::tools::hexagon::Assembler::ConstructJob(), clang::driver::tools::MinGW::Linker::ConstructJob(), clang::driver::tools::PS4cpu::Linker::ConstructJob(), clang::driver::tools::PS5cpu::Linker::ConstructJob(), clang::driver::tools::wasm::Linker::ConstructJob(), CreateOffloadingDeviceToolChains(), CreateTempFile(), DecodeAArch64Features(), DiagnoseInputExistence(), DiagnoseUnclaimedMultilibCustomFlags(), emitComplexRangeDiag(), clang::driver::Compilation::ExecuteCommand(), ExecuteCompilation(), findPassPlugin(), gchProbe(), generateCompilationDiagnostics(), getARMFPUFeatures(), getARMHWDivFeatures(), getCSKYFPUFeatures(), clang::driver::ToolChain::GetCStdlibType(), clang::driver::ToolChain::GetCXXStdlibType(), clang::driver::toolchains::Fuchsia::GetCXXStdlibType(), clang::driver::toolchains::HexagonToolChain::GetCXXStdlibType(), clang::driver::toolchains::MipsLLVMToolChain::GetCXXStdlibType(), clang::driver::toolchains::OHOS::GetCXXStdlibType(), clang::driver::toolchains::AMDGPUToolChain::getDeviceLibs(), clang::driver::tools::getDwarfVersion(), clang::driver::ToolChain::GetLinkerPath(), clang::driver::tools::solaris::Linker::getLinkerPath(), clang::driver::tools::wasm::Linker::getLinkerPath(), clang::driver::toolchains::MachO::getLinkerVersion(), clang::driver::ToolChain::getLTOMode(), GetNamedOutputPath(), getOffloadArchs(), getOpenMPRuntime(), clang::driver::tools::riscv::getRISCVTuneCPU(), clang::driver::ToolChain::GetRuntimeLibType(), clang::driver::toolchains::DarwinClang::GetRuntimeLibType(), clang::driver::toolchains::Fuchsia::GetRuntimeLibType(), clang::driver::toolchains::OHOS::GetRuntimeLibType(), clang::driver::tools::getStatsFileName(), GetTemporaryDirectory(), GetTemporaryPath(), clang::driver::ToolChain::GetUnwindLibType(), clang::driver::toolchains::HLSLToolChain::getValidationInfo(), handleHVXTargetFeatures(), handleHVXWarnings(), clang::driver::tools::isTLSDESCEnabled(), isValidRISCVCPU(), parseArgCutoffs(), ParseArgStrings(), parseArgValues(), parseBinaryMetadataFeatures(), parseClangCLEHFlags(), parseCoverageFeatures(), ParseDebugDefaultVersion(), parseOverflowPatternExclusionValues(), parseSanitizeArgs(), parseSpecialCaseListArg(), renderDebugOptions(), RenderDiagnosticsOptions(), renderDwarfFormat(), clang::driver::tools::gcc::Compiler::RenderExtraToolArgs(), RenderFloatingPointOptions(), RenderHLSLOptions(), RenderModulesOptions(), RenderObjCOptions(), RenderSSPOptions(), RenderTrivialAutoVarInitOptions(), clang::driver::SanitizerArgs::SanitizerArgs(), setPAuthABIInTriple(), setZosTargetVersion(), clang::driver::tools::shouldRecordCommandLine(), clang::driver::toolchains::AMDGPUToolChain::TranslateArgs(), clang::driver::toolchains::Darwin::TranslateArgs(), clang::driver::toolchains::HLSLToolChain::TranslateArgs(), clang::driver::ToolChain::TranslateOpenMPTargetArgs(), clang::driver::ToolChain::TranslateXarchArgs(), tryExecuteParallelOffloadJobGroup(), validateSpecialCaseListFormat(), and clang::driver::XRayArgs::XRayArgs().
Check that the file referenced by Value exists.
If it doesn't, issue a diagnostic and return false. If TypoCorrect is true and the file does not exist, see if it looks like a likely typo for a flag and if so print a "did you mean" blurb.
Definition at line 3081 of file Driver.cpp.
References Diag(), getCheckInputsExist(), getOpts(), getVFS(), and IsCLMode().
Referenced by BuildInputs().
|
inline |
|
inline |
|
inline |
| int Driver::ExecuteCompilation | ( | Compilation & | C, |
| SmallVectorImpl< std::pair< int, const Command * > > & | FailingCommands ) |
ExecuteCompilation - Execute the compilation according to the command line arguments and return an appropriate exit code.
This routine handles additional processing that must be done in addition to just running the subprocesses, for example reporting errors, setting up response files, removing temporary files, etc.
Definition at line 2403 of file Driver.cpp.
References clang::C, clang::cast(), Diag(), clang::driver::Command::getCreator(), clang::driver::Tool::getShortName(), clang::driver::Command::getSource(), clang::driver::Tool::hasGoodDiagnostics(), and isSaveTempsEnabled().
| llvm::Expected< std::unique_ptr< llvm::MemoryBuffer > > Driver::executeProgram | ( | llvm::ArrayRef< llvm::StringRef > | Args | ) | const |
Definition at line 415 of file Driver.cpp.
Referenced by clang::driver::toolchains::AMDGPUToolChain::getSystemGPUArchs().
| void Driver::generateCompilationDiagnostics | ( | Compilation & | C, |
| const Command & | FailingCommand, | ||
| StringRef | AdditionalInformation = "", | ||
| CompilationDiagnosticReport * | GeneratedReport = nullptr ) |
generateCompilationDiagnostics - Generate diagnostics information including preprocessed source file(s).
Definition at line 2044 of file Driver.cpp.
References clang::BoundArch::ArchName, BugReportMsg, BuildActions(), BuildInputs(), BuildJobs(), BuildUniversalActions(), clang::C, CCGenDiagnostics, CreateTempFile(), Diag(), clang::driver::Command::Execute(), clang::driver::CrashReportInfo::Filename, clang::driver::Command::getArguments(), clang::driver::Command::getBoundArch(), clang::getClangFullVersion(), clang::driver::Command::getCreator(), getOpts(), clang::driver::types::getPreprocessedType(), clang::driver::ToolChain::getTriple(), clang::DiagnosticErrorTrap::hasErrorOccurred(), clang::driver::Tool::isDsymutilJob(), clang::driver::Tool::isLinkJob(), clang::driver::types::isLLVMIR(), Name, clang::driver::Command::Print(), printArgList(), PrintVersion(), clang::driver::Command::replaceArguments(), clang::sema::Report, and clang::driver::types::TY_INVALID.
Referenced by maybeGenerateCompilationDiagnostics().
|
inline |
Name to use when invoking gcc/g++.
Definition at line 402 of file Driver.h.
References getCCCGenericGCCName().
Referenced by clang::driver::tools::gcc::Common::ConstructJob(), and getCCCGenericGCCName().
|
inline |
Definition at line 414 of file Driver.h.
Referenced by DiagnoseInputExistence().
| std::string Driver::GetClPchPath | ( | Compilation & | C, |
| StringRef | BaseName ) const |
Return the pathname of the pch file in clang-cl mode.
Definition at line 6053 of file Driver.cpp.
References clang::C.
Referenced by GetNamedOutputPath().
|
inline |
|
inline |
| const char * Driver::getDefaultImageName | ( | ) | const |
Returns the default name for linked images (e.g., "a.out").
Definition at line 5440 of file Driver.cpp.
References clang::Target.
Referenced by BuildJobs(), and GetNamedOutputPath().
|
static |
Compute the default -fmodule-cache-path.
Definition at line 4046 of file Clang.cpp.
References clang::Result.
Referenced by getModuleCachePath(), and RenderModulesOptions().
|
inline |
Definition at line 410 of file Driver.h.
Referenced by addFloatingPointOptions(), addPGOAndCoverageFlags(), BuildCompilation(), clang::driver::tools::Clang::ConstructJob(), RenderFloatingPointOptions(), and clang::driver::ToolChain::TranslateXarchArgs().
|
inline |
Get the path to the main driver executable.
Definition at line 432 of file Driver.h.
References DriverExecutable.
Referenced by clang::driver::tools::Clang::ConstructJob(), clang::driver::tools::ClangAs::ConstructJob(), clang::driver::tools::Flang::ConstructJob(), and clang::driver::tools::renderEscapedCommandLine().
| std::string Driver::GetFilePath | ( | StringRef | Name, |
| const ToolChain & | TC ) const |
GetFilePath - Lookup Name in the list of file search paths.
| TC | - The tool chain for additional information on directories to search. |
Definition at line 5850 of file Driver.cpp.
References Dir, clang::driver::ToolChain::getCompilerRTPath(), clang::driver::ToolChain::getDefaultIntrinsicModuleDir(), clang::driver::ToolChain::getFilePaths(), clang::driver::ToolChain::getLibraryPaths(), IsFlangMode(), Name, PrefixDirs, ResourceDir, and SysRoot.
Referenced by GetStdModuleManifestPath(), and HandleImmediateArgs().
| phases::ID Driver::getFinalPhase | ( | const llvm::opt::DerivedArgList & | DAL, |
| llvm::opt::Arg ** | FinalPhaseArg = nullptr ) const |
Definition at line 356 of file Driver.cpp.
References clang::driver::phases::Assemble, clang::driver::phases::Backend, CCCIsCPP(), CCGenDiagnostics, clang::driver::phases::Compile, clang::driver::phases::IfsMerge, clang::driver::phases::Link, clang::driver::phases::Precompile, and clang::driver::phases::Preprocess.
Referenced by BuildActions(), BuildCompilation(), BuildOffloadingActions(), and clang::driver::types::getCompilationPhases().
|
inline |
Definition at line 452 of file Driver.h.
References FlangF128MathLibrary.
Referenced by clang::driver::ToolChain::addFortranRuntimeLibs().
|
inline |
| const char * Driver::GetNamedOutputPath | ( | Compilation & | C, |
| const JobAction & | JA, | ||
| const char * | BaseInput, | ||
| BoundArch | BA, | ||
| bool | AtTopLevel, | ||
| bool | MultipleArchs, | ||
| StringRef | NormalizedTriple ) const |
GetNamedOutputPath - Return the name to use for the output of the action JA.
The result is appended to the compilation's list of temporary or result files, as appropriate.
| C | - The compilation. |
| JA | - The action of interest. |
| BaseInput | - The original input file that this action was triggered by. |
| BA | - The bound architecture. |
| AtTopLevel | - Whether this is a "top-level" action. |
| MultipleArchs | - Whether multiple -arch options were supplied. |
| NormalizedTriple | - The normalized triple of the relevant target. |
Definition at line 5551 of file Driver.cpp.
References clang::driver::types::appendSuffixForType(), clang::BoundArch::ArchName, clang::C, CCGenDiagnostics, CreateTempFile(), Diag(), GetClPchPath(), getDefaultImageName(), clang::driver::Action::getInputs(), clang::driver::Action::getKind(), GetModuleOutputPath(), clang::driver::Action::getOffloadingDeviceKind(), clang::driver::Action::getOffloadingToolChain(), GetTemporaryPath(), clang::driver::ToolChain::getTriple(), clang::driver::Action::getType(), clang::driver::types::getTypeTempSuffix(), HasPreprocessOutput(), clang::isa(), IsCLMode(), IsDXCMode(), isSaveTempsEnabled(), isSaveTempsObj(), MakeCLOutputFilename(), Name, clang::driver::Action::OFK_HIP, clang::driver::Action::OFK_Host, clang::driver::Action::OFK_None, clang::driver::Action::OFK_OpenMP, clang::Result, and clang::sanitizeTargetIDInFileName().
| llvm::SmallVector< BoundArch > Driver::getOffloadArchs | ( | Compilation & | C, |
| const llvm::opt::DerivedArgList & | Args, | ||
| Action::OffloadKind | Kind, | ||
| const ToolChain & | TC ) const |
Returns the set of bound architectures active for this offload kind.
If there are no bound architctures we return a set containing only the empty string.
Definition at line 3964 of file Driver.cpp.
References Arch, clang::C, clang::OffloadArch::CudaDefault(), Diag(), clang::driver::ToolChain::getArchName(), getCanonicalArchString(), getConflictOffloadArchCombination(), clang::driver::ToolChain::getDriver(), clang::OffloadArch::getGeneric(), clang::getSubArchOffloadArch(), clang::driver::ToolChain::getSystemGPUArchs(), clang::driver::ToolChain::getTriple(), clang::OffloadArch::getUnused(), clang::OffloadArch::HIPDefault(), clang::OffloadArch::isUnknown(), clang::OffloadArchToString(), clang::driver::Action::OFK_Cuda, clang::driver::Action::OFK_HIP, clang::driver::Action::OFK_OpenMP, clang::driver::Action::OFK_SYCL, and clang::Result.
Referenced by BuildOffloadingActions().
| Driver::OpenMPRuntimeKind Driver::getOpenMPRuntime | ( | const llvm::opt::ArgList & | Args | ) | const |
Compute the desired OpenMP runtime from the flags provided.
Definition at line 896 of file Driver.cpp.
References Diag(), OMPRT_GOMP, OMPRT_IOMP5, OMPRT_OMP, and OMPRT_Unknown.
Referenced by clang::driver::ToolChain::addFortranRuntimeLibs(), clang::driver::tools::aix::Linker::ConstructJob(), clang::driver::tools::Clang::ConstructJob(), clang::driver::tools::Flang::ConstructJob(), clang::driver::tools::MinGW::Linker::ConstructJob(), and CreateOffloadingDeviceToolChains().
|
inline |
Definition at line 408 of file Driver.h.
References clang::getDriverOptTable().
Referenced by BuildInputs(), DiagnoseInputExistence(), generateCompilationDiagnostics(), HandleAutocompletions(), ParseArgStrings(), PrintHelp(), clang::driver::toolchains::AMDGPUToolChain::TranslateArgs(), clang::driver::toolchains::CudaToolChain::TranslateArgs(), clang::driver::toolchains::Generic_GCC::TranslateArgs(), clang::driver::toolchains::HLSLToolChain::TranslateArgs(), clang::driver::toolchains::MachO::TranslateArgs(), clang::driver::toolchains::MSVCToolChain::TranslateArgs(), clang::driver::toolchains::SYCLToolChain::TranslateArgs(), clang::driver::ToolChain::TranslateOpenMPTargetArgs(), and clang::driver::ToolChain::TranslateXarchArgs().
|
inline |
Definition at line 434 of file Driver.h.
Referenced by clang::driver::ToolChain::GetLinkerPath().
|
inline |
Definition at line 421 of file Driver.h.
Referenced by clang::driver::tools::Clang::ConstructJob(), clang::driver::tools::ClangAs::ConstructJob(), and clang::driver::tools::Flang::ConstructJob().
|
inline |
| std::string Driver::GetProgramPath | ( | StringRef | Name, |
| const ToolChain & | TC ) const |
GetProgramPath - Lookup Name in the list of program search paths.
| TC | - The provided tool chain for additional information on directories to search. |
Definition at line 5926 of file Driver.cpp.
References clang::driver::ToolChain::getProgramPaths(), Name, PrefixDirs, and ScanDirForExecutable().
Referenced by clang::driver::tools::Flang::ConstructJob(), and HandleImmediateArgs().
|
static |
Parse digits from a string Str and fulfill Digits with the parsed numbers.
This method assumes that the max number of digits to look for is equal to Digits.size().
Definition at line 6453 of file Driver.cpp.
|
static |
GetReleaseVersion - Parse (([0-9]+)(.
([0-9]+)(.([0-9]+)?))?)? and return the grouped values as integers. Numbers which are not provided are set to 0.
([0-9]+)(.([0-9]+)?))?)? and return the grouped values as integers. Numbers which are not provided are set to 0.
Definition at line 6418 of file Driver.cpp.
Referenced by getSystemOrSDKMacOSVersion().
| std::string Driver::GetStdModuleManifestPath | ( | const Compilation & | C, |
| const ToolChain & | TC ) const |
Lookup the path to the Standard library module manifest.
| C | - The compilation. |
| TC | - The tool chain for additional information on directories to search. |
Definition at line 5968 of file Driver.cpp.
References clang::C, clang::driver::ToolChain::CST_Libcxx, clang::driver::ToolChain::CST_Libstdcxx, clang::driver::ToolChain::GetCXXStdlibType(), GetFilePath(), and clang::driver::ToolChain::getVFS().
Referenced by BuildCompilation(), and HandleImmediateArgs().
|
inline |
Definition at line 429 of file Driver.h.
Referenced by BuildJobs(), CollectArgsForIntegratedAssembler(), computeClangRuntimesSysRoot(), clang::driver::tools::aix::Assembler::ConstructJob(), clang::driver::tools::aix::Linker::ConstructJob(), detectGCCToolchainAdjacent(), and getLiteralTriple().
| std::string Driver::GetTemporaryDirectory | ( | StringRef | Prefix | ) | const |
GetTemporaryDirectory - Return the pathname of a temporary directory to use as part of compilation; the directory will have the given prefix.
Definition at line 6042 of file Driver.cpp.
References Diag().
Referenced by CreateTempFile().
| std::string Driver::GetTemporaryPath | ( | StringRef | Prefix, |
| StringRef | Suffix ) const |
GetTemporaryPath - Return the pathname of a temporary file to use as part of compilation; the file will have the given prefix and suffix.
GCC goes to extra lengths here to be a bit more robust.
Definition at line 6031 of file Driver.cpp.
References Diag().
Referenced by CreateTempFile(), and GetNamedOutputPath().
|
inline |
Definition at line 426 of file Driver.h.
References DriverTitle.
|
inline |
Definition at line 412 of file Driver.h.
Referenced by addDefaultIgnorelists(), clang::driver::tools::addOpenCLBuiltinsLib(), clang::driver::tools::addPathIfExists(), addPGOAndCoverageFlags(), BuildCompilation(), clang::driver::tools::Clang::ConstructJob(), CreateTempFile(), DiagnoseInputExistence(), findAndroidArmMultilibs(), findBiarchMultilibs(), findCSKYMultilibs(), findMSP430Multilibs(), findRISCVBareMetalMultilibs(), findRISCVMultilibs(), gchProbe(), clang::driver::ToolChain::getVFS(), HandleImmediateArgs(), maybeHasClangPchSignature(), parseSpecialCaseListArg(), renderDebugOptions(), validateSpecialCaseListFormat(), and clang::driver::XRayArgs::XRayArgs().
| void Driver::HandleAutocompletions | ( | StringRef | PassedFlags | ) | const |
HandleAutocompletions - Handle –autocomplete by searching and printing possible flags, descriptions, and its arguments.
Definition at line 2544 of file Driver.cpp.
References clang::options::CC1Option, clang::options::ClangOption, clang::options::FlangOption, clang::DiagnosticIDs::getDiagnosticFlags(), getOpts(), clang::options::Ignored, IsFlangMode(), clang::options::Unsupported, and X.
Referenced by HandleImmediateArgs().
| bool Driver::HandleImmediateArgs | ( | Compilation & | C | ) |
HandleImmediateArgs - Handle any arguments which should be treated before building actions or binding tools.
Definition at line 2631 of file Driver.cpp.
References clang::C, clang::driver::ToolChain::ComputeEffectiveClangTriple(), clang::driver::MultilibSet::expandFlags(), clang::driver::Multilib::gccSuffix(), clang::driver::ToolChain::getCompilerRT(), clang::driver::ToolChain::getCompilerRTPath(), clang::driver::ToolChain::GetCXXStdlibName(), clang::DiagnosticIDs::getDiagnosticFlags(), GetFilePath(), clang::driver::ToolChain::getFilePaths(), clang::driver::ToolChain::getMultilibFlags(), clang::driver::ToolChain::getMultilibs(), GetProgramPath(), clang::driver::ToolChain::getProgramPaths(), clang::driver::ToolChain::GetRuntimeLibType(), clang::driver::ToolChain::getRuntimePath(), clang::driver::ToolChain::getSelectedMultilibs(), GetStdModuleManifestPath(), clang::driver::ToolChain::getTripleString(), getVFS(), HandleAutocompletions(), clang::driver::Multilib::isError(), clang::driver::Action::OFK_Host, PrefixDirs, clang::ssaf::printAvailableFormats(), clang::ssaf::printAvailableTUSummaryExtractors(), printCXXStdlibIncludeDirs(), PrintDiagnosticCategories(), PrintHelp(), clang::driver::ToolChain::printVerboseInfo(), PrintVersion(), ResourceDir, clang::driver::ToolChain::RLT_CompilerRT, clang::driver::ToolChain::RLT_Libgcc, SystemConfigDir, and UserConfigDir.
Referenced by BuildCompilation().
|
inline |
Returns true if the user has indicated a C++20 header unit mode.
Definition at line 728 of file Driver.h.
References clang::driver::HeaderMode_None.
Referenced by BuildInputs().
|
inline |
Whether the driver should follow cl.exe like behavior.
Definition at line 232 of file Driver.h.
Referenced by BuildCompilation(), BuildInputs(), BuildJobs(), CheckPreprocessingOptions(), clang::driver::tools::Clang::ConstructJob(), DiagnoseInputExistence(), clang::driver::Compilation::ExecuteJobs(), GetNamedOutputPath(), ParseArgStrings(), and renderDebugOptions().
|
inline |
Whether the driver should follow dxc.exe like behavior.
Definition at line 239 of file Driver.h.
Referenced by BuildCompilation(), BuildInputs(), and GetNamedOutputPath().
|
inline |
Whether the driver should invoke flang for fortran inputs.
Other modes fall back to calling gcc which in turn calls gfortran.
Definition at line 236 of file Driver.h.
Referenced by AddLibgcc(), BuildActions(), BuildInputs(), computeTargetTriple(), clang::driver::toolchains::cygwin::Linker::ConstructJob(), clang::driver::tools::aix::Linker::ConstructJob(), clang::driver::tools::dragonfly::Linker::ConstructJob(), clang::driver::tools::Flang::ConstructJob(), clang::driver::tools::freebsd::Linker::ConstructJob(), clang::driver::tools::gnutools::Linker::ConstructJob(), clang::driver::tools::haiku::Linker::ConstructJob(), clang::driver::tools::netbsd::Linker::ConstructJob(), clang::driver::tools::openbsd::Linker::ConstructJob(), clang::driver::tools::solaris::Linker::ConstructJob(), GetFilePath(), HandleAutocompletions(), ParseArgStrings(), and PrintVersion().
|
inline |
Definition at line 439 of file Driver.h.
Referenced by ExecuteCompilation(), and GetNamedOutputPath().
|
inline |
Definition at line 440 of file Driver.h.
Referenced by GetNamedOutputPath().
|
inline |
Definition at line 581 of file Driver.h.
References clang::C, Crash, and generateCompilationDiagnostics().
|
inline |
Definition at line 447 of file Driver.h.
Referenced by BuildActions(), BuildOffloadingActions(), ConstructPhaseAction(), and shouldBundleHIPAsm().
|
inline |
Definition at line 446 of file Driver.h.
Referenced by BuildOffloadingActions().
| InputArgList Driver::ParseArgStrings | ( | ArrayRef< const char * > | Args, |
| bool | UseDriverMode, | ||
| bool & | ContainsError ) const |
ParseArgStrings - Parse the given list of strings into an ArgList.
Definition at line 265 of file Driver.cpp.
References clang::options::CC1Option, Diag(), clang::options::FC1Option, getOpts(), IsCLMode(), IsFlangMode(), clang::options::Unsupported, and clang::DiagnosticsEngine::Warning.
Referenced by BuildCompilation().
| void Driver::PrintActions | ( | const Compilation & | C | ) | const |
PrintActions - Print the list of actions.
Definition at line 2970 of file Driver.cpp.
References clang::C, and PrintActions1().
Referenced by BuildCompilation().
| void Driver::PrintHelp | ( | bool | ShowHidden | ) | const |
PrintHelp - Print the help text.
| ShowHidden | - Show hidden options. |
Definition at line 2492 of file Driver.cpp.
References DriverTitle, getOpts(), and Name.
Referenced by HandleImmediateArgs().
| void Driver::PrintVersion | ( | const Compilation & | C, |
| raw_ostream & | OS ) const |
PrintVersion - Print the driver version.
Definition at line 2501 of file Driver.cpp.
References clang::C, Dir, clang::getClangFullVersion(), clang::getClangToolFullVersion(), clang::driver::ToolChain::getThreadModel(), clang::driver::ToolChain::getTripleString(), IsFlangMode(), and clang::driver::ToolChain::isThreadModelSupported().
Referenced by CollectArgsForIntegratedAssembler(), generateCompilationDiagnostics(), and HandleImmediateArgs().
|
inline |
Definition at line 416 of file Driver.h.
Referenced by clang::createInvocation().
|
inline |
Definition at line 449 of file Driver.h.
References FlangF128MathLibrary.
|
inline |
|
inline |
|
inline |
Definition at line 419 of file Driver.h.
Referenced by clang::createInvocation().
|
inline |
Definition at line 424 of file Driver.h.
References ClangNameParts.
|
inline |
| bool Driver::ShouldEmitStaticLibrary | ( | const llvm::opt::ArgList & | Args | ) | const |
ShouldEmitStaticLibrary - Should the linker emit a static library.
Definition at line 6406 of file Driver.cpp.
Referenced by BuildActions().
ShouldUseClangCompiler - Should the clang compiler be used to handle this action.
Definition at line 6377 of file Driver.cpp.
References clang::driver::Action::input_begin(), clang::isa(), clang::driver::types::isAcceptedByClang(), and clang::driver::Action::size().
ShouldUseFlangCompiler - Should the flang compiler be used to handle this action.
Definition at line 6392 of file Driver.cpp.
References clang::driver::Action::input_begin(), clang::isa(), clang::driver::types::isAcceptedByFlang(), and clang::driver::Action::size().
| CC1ToolFunc clang::driver::Driver::CC1Main = nullptr |
Definition at line 292 of file Driver.h.
Referenced by clang::driver::tools::Clang::ConstructJob(), and clang::driver::tools::ClangAs::ConstructJob().
| unsigned clang::driver::Driver::CCCPrintBindings |
Only print tool bindings, don't build any jobs.
Definition at line 243 of file Driver.h.
Referenced by BuildCompilation(), and Driver().
| unsigned clang::driver::Driver::CCGenDiagnostics |
Whether the driver is generating diagnostics for debugging purposes.
Definition at line 274 of file Driver.h.
Referenced by BuildInputs(), clang::driver::tools::Clang::ConstructJob(), clang::driver::tools::ClangAs::ConstructJob(), ConstructPhaseAction(), CreateTempFile(), Driver(), clang::driver::Compilation::ExecuteJobs(), generateCompilationDiagnostics(), getFinalPhase(), and GetNamedOutputPath().
| unsigned clang::driver::Driver::CCLogDiagnostics |
Set CC_LOG_DIAGNOSTICS mode, which causes the frontend to log diagnostics to CCLogDiagnosticsFilename or to stderr, in a stable machine readable format.
Definition at line 270 of file Driver.h.
Referenced by clang::driver::tools::Clang::ConstructJob(), and Driver().
| std::string clang::driver::Driver::CCLogDiagnosticsFilename |
The file to log CC_LOG_DIAGNOSTICS output to, if enabled.
Definition at line 220 of file Driver.h.
Referenced by clang::driver::tools::Clang::ConstructJob().
| std::string clang::driver::Driver::CCPrintHeadersFilename |
The file to log CC_PRINT_HEADERS output to, if enabled.
Definition at line 217 of file Driver.h.
Referenced by clang::driver::tools::Clang::ConstructJob().
| HeaderIncludeFilteringKind clang::driver::Driver::CCPrintHeadersFiltering = HIFIL_None |
This flag determines whether clang should filter the header information that is emitted.
If enviroment variable CC_PRINT_HEADERS_FILTERING is set to "only-direct-system", only system headers that are directly included from non-system headers are emitted.
Definition at line 259 of file Driver.h.
Referenced by clang::driver::tools::Clang::ConstructJob().
| HeaderIncludeFormatKind clang::driver::Driver::CCPrintHeadersFormat = HIFMT_None |
The format of the header information that is emitted.
If CC_PRINT_HEADERS is set, the format is textual. Otherwise, the format is determined by the enviroment variable CC_PRINT_HEADERS_FORMAT.
Definition at line 253 of file Driver.h.
Referenced by clang::driver::tools::Clang::ConstructJob().
| std::string clang::driver::Driver::CCPrintInternalStatReportFilename |
The file to log CC_PRINT_INTERNAL_STAT_FILE output to, if enabled.
Definition at line 211 of file Driver.h.
Referenced by clang::driver::tools::getStatsFileName().
| unsigned clang::driver::Driver::CCPrintInternalStats |
Set CC_PRINT_INTERNAL_STAT mode, which causes the driver to dump internal performance report to CC_PRINT_INTERNAL_STAT_FILE or to stdout.
Definition at line 284 of file Driver.h.
Referenced by clang::driver::tools::Clang::ConstructJob(), Driver(), and clang::driver::tools::getStatsFileName().
| unsigned clang::driver::Driver::CCPrintOptions |
Set CC_PRINT_OPTIONS mode, which is like -v but logs the commands to CCPrintOptionsFilename or to stderr.
Definition at line 248 of file Driver.h.
Referenced by Driver(), and clang::driver::Compilation::ExecuteJobs().
| std::string clang::driver::Driver::CCPrintOptionsFilename |
| unsigned clang::driver::Driver::CCPrintProcessStats |
Set CC_PRINT_PROC_STAT mode, which causes the driver to dump performance report to CC_PRINT_PROC_STAT_FILE or to stdout.
Definition at line 279 of file Driver.h.
Referenced by BuildCompilation(), BuildJobs(), Driver(), and clang::driver::Compilation::ExecuteJobs().
| std::string clang::driver::Driver::CCPrintStatReportFilename |
The file to log CC_PRINT_PROC_STAT_FILE output to, if enabled.
Definition at line 208 of file Driver.h.
Referenced by BuildCompilation(), and BuildJobs().
| ParsedClangName clang::driver::Driver::ClangNameParts |
Target and driver mode components extracted from clang executable name.
Definition at line 177 of file Driver.h.
Referenced by setTargetAndMode().
| std::string clang::driver::Driver::Dir |
The path the driver executable was in, as invoked from the command line.
Definition at line 171 of file Driver.h.
Referenced by clang::driver::toolchains::OHOS::AddClangCXXStdlibIncludeArgs(), clang::driver::toolchains::MipsLLVMToolChain::addLibCxxIncludePaths(), clang::driver::tools::addOpenMPDeviceRTL(), BuildCompilation(), computeClangRuntimesSysRoot(), clang::driver::toolchains::Linux::computeSysRoot(), clang::driver::toolchains::OHOS::computeSysRoot(), detectGCCToolchainAdjacent(), Driver(), findClangRelativeSysroot(), GetFilePath(), PrintVersion(), and testTriple().
| std::string clang::driver::Driver::DriverExecutable |
The original path to the driver executable.
Definition at line 174 of file Driver.h.
Referenced by BuildCompilation(), clang::driver::tools::aix::Linker::ConstructJob(), Driver(), and getDriverProgramPath().
| std::string clang::driver::Driver::DriverTitle |
Driver title to use with help.
Definition at line 202 of file Driver.h.
Referenced by Driver(), getTitle(), PrintHelp(), and setTitle().
| std::string clang::driver::Driver::DyldPrefix |
Dynamic loader prefix, if present.
Definition at line 199 of file Driver.h.
Referenced by BuildCompilation(), clang::driver::tools::fuchsia::Linker::ConstructJob(), and clang::driver::tools::gnutools::Linker::ConstructJob().
| std::string clang::driver::Driver::FlangF128MathLibrary |
Name of the library that provides implementations of IEEE-754 128-bit float math functions used by Fortran F128 runtime library.
It should be linked as needed by the linker job.
Definition at line 264 of file Driver.h.
Referenced by getFlangF128MathLibrary(), and setFlangF128MathLibrary().
| std::string clang::driver::Driver::HostBits |
| std::string clang::driver::Driver::Name |
The name the driver was invoked as.
Definition at line 167 of file Driver.h.
Referenced by BuildCompilation(), clang::driver::tools::Flang::ConstructJob(), Driver(), generateCompilationDiagnostics(), GetFilePath(), GetNamedOutputPath(), GetProgramPath(), and PrintHelp().
| prefix_list clang::driver::Driver::PrefixDirs |
Definition at line 193 of file Driver.h.
Referenced by BuildCompilation(), GetFilePath(), GetProgramPath(), and HandleImmediateArgs().
| std::string clang::driver::Driver::ResourceDir |
The path to the compiler resource directory.
Definition at line 180 of file Driver.h.
Referenced by addDefaultIgnorelists(), clang::driver::tools::addOpenCLBuiltinsLib(), BuildCompilation(), clang::driver::tools::Clang::ConstructJob(), clang::driver::tools::Flang::ConstructJob(), Driver(), clang::driver::toolchains::OHOS::getArchSpecificLibPaths(), GetFilePath(), HandleImmediateArgs(), and RenderModulesOptions().
| std::string clang::driver::Driver::SysRoot |
sysroot, if present
Definition at line 196 of file Driver.h.
Referenced by clang::driver::toolchains::CrossWindowsToolChain::AddClangCXXStdlibIncludeArgs(), BuildCompilation(), computeClangRuntimesSysRoot(), clang::driver::toolchains::Linux::computeSysRoot(), clang::driver::toolchains::Managarm::computeSysRoot(), clang::driver::toolchains::MipsLLVMToolChain::computeSysRoot(), clang::driver::toolchains::OHOS::computeSysRoot(), constructHexagonLinkArgs(), clang::driver::toolchains::cygwin::Linker::ConstructJob(), clang::driver::tools::aix::Linker::ConstructJob(), clang::driver::tools::baremetal::Linker::ConstructJob(), clang::driver::tools::CrossWindows::Linker::ConstructJob(), clang::driver::tools::CSKY::Linker::ConstructJob(), clang::driver::tools::dragonfly::Linker::ConstructJob(), clang::driver::tools::freebsd::Linker::ConstructJob(), clang::driver::tools::fuchsia::Linker::ConstructJob(), clang::driver::tools::gnutools::Linker::ConstructJob(), clang::driver::tools::haiku::Linker::ConstructJob(), clang::driver::tools::MinGW::Linker::ConstructJob(), clang::driver::tools::msp430::Linker::ConstructJob(), clang::driver::tools::netbsd::Linker::ConstructJob(), clang::driver::tools::openbsd::Linker::ConstructJob(), Driver(), clang::driver::toolchains::AVRToolChain::findAVRLibcInstallation(), clang::driver::toolchains::AppleMachO::GetEffectiveSysroot(), GetFilePath(), clang::driver::Compilation::getSysRoot(), clang::driver::toolchains::MinGW::MinGW(), and testTriple().
| std::string clang::driver::Driver::SystemConfigDir |
System directory for config files.
Definition at line 183 of file Driver.h.
Referenced by Driver(), and HandleImmediateArgs().
| std::string clang::driver::Driver::UserConfigDir |
User directory for config files.
Definition at line 186 of file Driver.h.
Referenced by Driver(), and HandleImmediateArgs().