;
30std::unique_ptr<CompilerInvocation>
33assert(!ArgList.empty());
34 autoDiags = Opts.
Diags 35? std::move(Opts.
Diags)
37Opts.
VFS? *Opts.
VFS: *llvm::vfs::getRealFileSystem(),
45Args, [](
const char*Elem) {
returnllvm::StringRef(Elem) ==
"--"; }),
49 driver::DriverTheDriver(Args[0], llvm::sys::getDefaultTargetTriple(), *Diags,
50 "clang LLVM compiler", Opts.
VFS);
60 if(
C->getArgs().hasArg(driver::options::OPT_fdriver_only))
64 if(
C->getArgs().hasArg(driver::options::OPT__HASH_HASH_HASH)) {
65 C->getJobs().Print(llvm::errs(),
"\n",
true);
75 boolOffloadCompilation =
false;
76 if(Jobs.
size() > 1) {
77 for(
auto&A :
C->getActions()){
79 if(isa<driver::BindArchAction>(A))
80A = *A->input_begin();
81 if(isa<driver::OffloadAction>(A)) {
82OffloadCompilation =
true;
88 boolPickFirstOfMany = OffloadCompilation || Opts.
RecoverOnError;
89 if(Jobs.
size() == 0 || (Jobs.
size() > 1 && !PickFirstOfMany)) {
91llvm::raw_svector_ostream OS(Msg);
92Jobs.
Print(OS,
"; ",
true);
93Diags->Report(diag::err_fe_expected_compiler_job) << OS.str();
97 returnStringRef(
Cmd.getCreator().getName()) ==
"clang";
99 if(
Cmd== Jobs.
end()) {
100Diags->Report(diag::err_fe_expected_clang_command);
104 constArgStringList &CCArgs =
Cmd->getArguments();
106*Opts.
CC1Args= {CCArgs.begin(), CCArgs.end()};
107 autoCI = std::make_unique<CompilerInvocation>();
void createDiagnostics(llvm::vfs::FileSystem &VFS, DiagnosticConsumer *Client=nullptr, bool ShouldOwnClient=true)
Create the diagnostics engine using the invocation's diagnostic options and replace any existing one ...
static bool CreateFromArgs(CompilerInvocation &Res, ArrayRef< const char * > CommandLineArgs, DiagnosticsEngine &Diags, const char *Argv0=nullptr)
Create a compiler invocation from a list of input options.
Options for controlling the compiler diagnostics engine.
Command - An executable path/name and argument vector to execute.
Driver - Encapsulate logic for constructing compilation processes from a set of gcc-driver-like comma...
void setCheckInputsExist(bool Value)
void setProbePrecompiled(bool Value)
Compilation * BuildCompilation(ArrayRef< const char * > Args)
BuildCompilation - Construct a compilation object for a command line argument vector.
JobList - A sequence of jobs to perform.
void Print(llvm::raw_ostream &OS, const char *Terminator, bool Quote, CrashReportInfo *CrashInfo=nullptr) const
The JSON file list parser is used to communicate input to InstallAPI.
std::unique_ptr< CompilerInvocation > createInvocation(ArrayRef< const char * > Args, CreateInvocationOptions Opts={})
Interpret clang arguments in preparation to parse a file.
Optional inputs to createInvocation.
IntrusiveRefCntPtr< DiagnosticsEngine > Diags
Receives diagnostics encountered while parsing command-line flags.
bool ProbePrecompiled
Allow the driver to probe the filesystem for PCH files.
bool RecoverOnError
Whether to attempt to produce a non-null (possibly incorrect) invocation if any errors were encounter...
IntrusiveRefCntPtr< llvm::vfs::FileSystem > VFS
Used e.g.
std::vector< std::string > * CC1Args
If set, the target is populated with the cc1 args produced by the driver.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4