clang 10.0.0git

Job.cpp
Go to the documentation of this file.
1 //===- Job.cpp - Command to Execute ---------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8
9 #include "clang/Driver/Job.h"
10 #include "InputInfo.h"
11 #include "clang/Basic/LLVM.h"
12 #include "clang/Driver/Driver.h"
13 #include "clang/Driver/DriverDiagnostic.h"
14 #include "clang/Driver/Tool.h"
15 #include "clang/Driver/ToolChain.h"
16 #include "llvm/ADT/ArrayRef.h"
17 #include "llvm/ADT/SmallString.h"
18 #include "llvm/ADT/SmallVector.h"
19 #include "llvm/ADT/StringRef.h"
20 #include "llvm/ADT/StringSet.h"
21 #include "llvm/ADT/StringSwitch.h"
22 #include "llvm/Support/CrashRecoveryContext.h"
23 #include "llvm/Support/FileSystem.h"
24 #include "llvm/Support/Path.h"
25 #include "llvm/Support/PrettyStackTrace.h"
26 #include "llvm/Support/Program.h"
27 #include "llvm/Support/raw_ostream.h"
28 #include <algorithm>
29 #include <cassert>
30 #include <cstddef>
31 #include <string>
32 #include <system_error>
33 #include <utility>
34
35 using namespace clang;
36 using namespace driver;
37
38 Command::Command(const Action &Source, const Tool &Creator,
39 const char *Executable,
40 const llvm::opt::ArgStringList &Arguments,
41 ArrayRef<InputInfo> Inputs)
42 : Source(Source), Creator(Creator), Executable(Executable),
43 Arguments(Arguments) {
44 for (const auto &II : Inputs)
45 if (II.isFilename())
46 InputFilenames.push_back(II.getFilename());
47 }
48
49 /// Check if the compiler flag in question should be skipped when
50 /// emitting a reproducer. Also track how many arguments it has and if the
51 /// option is some kind of include path.
52 static bool skipArgs(const char *Flag, bool HaveCrashVFS, int &SkipNum,
53 bool &IsInclude) {
54 SkipNum = 2;
55 // These flags are all of the form -Flag <Arg> and are treated as two
56 // arguments. Therefore, we need to skip the flag and the next argument.
57 bool ShouldSkip = llvm::StringSwitch<bool>(Flag)
58 .Cases("-MF", "-MT", "-MQ", "-serialize-diagnostic-file", true)
59 .Cases("-o", "-dependency-file", true)
60 .Cases("-fdebug-compilation-dir", "-diagnostic-log-file", true)
61 .Cases("-dwarf-debug-flags", "-ivfsoverlay", true)
62 .Default(false);
63 if (ShouldSkip)
64 return true;
65
66 // Some include flags shouldn't be skipped if we have a crash VFS
67 IsInclude = llvm::StringSwitch<bool>(Flag)
68 .Cases("-include", "-header-include-file", true)
69 .Cases("-idirafter", "-internal-isystem", "-iwithprefix", true)
70 .Cases("-internal-externc-isystem", "-iprefix", true)
71 .Cases("-iwithprefixbefore", "-isystem", "-iquote", true)
72 .Cases("-isysroot", "-I", "-F", "-resource-dir", true)
73 .Cases("-iframework", "-include-pch", true)
74 .Default(false);
75 if (IsInclude)
76 return !HaveCrashVFS;
77
78 // The remaining flags are treated as a single argument.
79
80 // These flags are all of the form -Flag and have no second argument.
81 ShouldSkip = llvm::StringSwitch<bool>(Flag)
82 .Cases("-M", "-MM", "-MG", "-MP", "-MD", true)
83 .Case("-MMD", true)
84 .Default(false);
85
86 // Match found.
87 SkipNum = 1;
88 if (ShouldSkip)
89 return true;
90
91 // These flags are treated as a single argument (e.g., -F<Dir>).
92 StringRef FlagRef(Flag);
93 IsInclude = FlagRef.startswith("-F") || FlagRef.startswith("-I");
94 if (IsInclude)
95 return !HaveCrashVFS;
96 if (FlagRef.startswith("-fmodules-cache-path="))
97 return true;
98
99 SkipNum = 0;
100 return false;
101 }
102
103 void Command::printArg(raw_ostream &OS, StringRef Arg, bool Quote) {
104 const bool Escape = Arg.find_first_of(" \"\\$") != StringRef::npos;
105
106 if (!Quote && !Escape) {
107 OS << Arg;
108 return;
109 }
110
111 // Quote and escape. This isn't really complete, but good enough.
112 OS << '"';
113 for (const auto c : Arg) {
114 if (c == '"' || c == '\\' || c == '$')
115 OS << '\\';
116 OS << c;
117 }
118 OS << '"';
119 }
120
121 void Command::writeResponseFile(raw_ostream &OS) const {
122 // In a file list, we only write the set of inputs to the response file
123 if (Creator.getResponseFilesSupport() == Tool::RF_FileList) {
124 for (const auto *Arg : InputFileList) {
125 OS << Arg << '\n';
126 }
127 return;
128 }
129
130 // In regular response files, we send all arguments to the response file.
131 // Wrapping all arguments in double quotes ensures that both Unix tools and
132 // Windows tools understand the response file.
133 for (const auto *Arg : Arguments) {
134 OS << '"';
135
136 for (; *Arg != '\0'; Arg++) {
137 if (*Arg == '\"' || *Arg == '\\') {
138 OS << '\\';
139 }
140 OS << *Arg;
141 }
142
143 OS << "\" ";
144 }
145 }
146
147 void Command::buildArgvForResponseFile(
148 llvm::SmallVectorImpl<const char *> &Out) const {
149 // When not a file list, all arguments are sent to the response file.
150 // This leaves us to set the argv to a single parameter, requesting the tool
151 // to read the response file.
152 if (Creator.getResponseFilesSupport() != Tool::RF_FileList) {
153 Out.push_back(Executable);
154 Out.push_back(ResponseFileFlag.c_str());
155 return;
156 }
157
158 llvm::StringSet<> Inputs;
159 for (const auto *InputName : InputFileList)
160 Inputs.insert(InputName);
161 Out.push_back(Executable);
162 // In a file list, build args vector ignoring parameters that will go in the
163 // response file (elements of the InputFileList vector)
164 bool FirstInput = true;
165 for (const auto *Arg : Arguments) {
166 if (Inputs.count(Arg) == 0) {
167 Out.push_back(Arg);
168 } else if (FirstInput) {
169 FirstInput = false;
170 Out.push_back(Creator.getResponseFileFlag());
171 Out.push_back(ResponseFile);
172 }
173 }
174 }
175
176 /// Rewrite relative include-like flag paths to absolute ones.
177 static void
178 rewriteIncludes(const llvm::ArrayRef<const char *> &Args, size_t Idx,
179 size_t NumArgs,
180 llvm::SmallVectorImpl<llvm::SmallString<128>> &IncFlags) {
181 using namespace llvm;
182 using namespace sys;
183
184 auto getAbsPath = [](StringRef InInc, SmallVectorImpl<char> &OutInc) -> bool {
185 if (path::is_absolute(InInc)) // Nothing to do here...
186 return false;
187 std::error_code EC = fs::current_path(OutInc);
188 if (EC)
189 return false;
190 path::append(OutInc, InInc);
191 return true;
192 };
193
194 SmallString<128> NewInc;
195 if (NumArgs == 1) {
196 StringRef FlagRef(Args[Idx + NumArgs - 1]);
197 assert((FlagRef.startswith("-F") || FlagRef.startswith("-I")) &&
198 "Expecting -I or -F");
199 StringRef Inc = FlagRef.slice(2, StringRef::npos);
200 if (getAbsPath(Inc, NewInc)) {
201 SmallString<128> NewArg(FlagRef.slice(0, 2));
202 NewArg += NewInc;
203 IncFlags.push_back(std::move(NewArg));
204 }
205 return;
206 }
207
208 assert(NumArgs == 2 && "Not expecting more than two arguments");
209 StringRef Inc(Args[Idx + NumArgs - 1]);
210 if (!getAbsPath(Inc, NewInc))
211 return;
212 IncFlags.push_back(SmallString<128>(Args[Idx]));
213 IncFlags.push_back(std::move(NewInc));
214 }
215
216 void Command::Print(raw_ostream &OS, const char *Terminator, bool Quote,
217 CrashReportInfo *CrashInfo) const {
218 // Always quote the exe.
219 OS << ' ';
220 printArg(OS, Executable, /*Quote=*/true);
221
222 ArrayRef<const char *> Args = Arguments;
223 SmallVector<const char *, 128> ArgsRespFile;
224 if (ResponseFile != nullptr) {
225 buildArgvForResponseFile(ArgsRespFile);
226 Args = ArrayRef<const char *>(ArgsRespFile).slice(1); // no executable name
227 }
228
229 bool HaveCrashVFS = CrashInfo && !CrashInfo->VFSPath.empty();
230 for (size_t i = 0, e = Args.size(); i < e; ++i) {
231 const char *const Arg = Args[i];
232
233 if (CrashInfo) {
234 int NumArgs = 0;
235 bool IsInclude = false;
236 if (skipArgs(Arg, HaveCrashVFS, NumArgs, IsInclude)) {
237 i += NumArgs - 1;
238 continue;
239 }
240
241 // Relative includes need to be expanded to absolute paths.
242 if (HaveCrashVFS && IsInclude) {
243 SmallVector<SmallString<128>, 2> NewIncFlags;
244 rewriteIncludes(Args, i, NumArgs, NewIncFlags);
245 if (!NewIncFlags.empty()) {
246 for (auto &F : NewIncFlags) {
247 OS << ' ';
248 printArg(OS, F.c_str(), Quote);
249 }
250 i += NumArgs - 1;
251 continue;
252 }
253 }
254
255 auto Found = llvm::find_if(InputFilenames,
256 [&Arg](StringRef IF) { return IF == Arg; });
257 if (Found != InputFilenames.end() &&
258 (i == 0 || StringRef(Args[i - 1]) != "-main-file-name")) {
259 // Replace the input file name with the crashinfo's file name.
260 OS << ' ';
261 StringRef ShortName = llvm::sys::path::filename(CrashInfo->Filename);
262 printArg(OS, ShortName.str(), Quote);
263 continue;
264 }
265 }
266
267 OS << ' ';
268 printArg(OS, Arg, Quote);
269 }
270
271 if (CrashInfo && HaveCrashVFS) {
272 OS << ' ';
273 printArg(OS, "-ivfsoverlay", Quote);
274 OS << ' ';
275 printArg(OS, CrashInfo->VFSPath.str(), Quote);
276
277 // The leftover modules from the crash are stored in
278 // <name>.cache/vfs/modules
279 // Leave it untouched for pcm inspection and provide a clean/empty dir
280 // path to contain the future generated module cache:
281 // <name>.cache/vfs/repro-modules
282 SmallString<128> RelModCacheDir = llvm::sys::path::parent_path(
283 llvm::sys::path::parent_path(CrashInfo->VFSPath));
284 llvm::sys::path::append(RelModCacheDir, "repro-modules");
285
286 std::string ModCachePath = "-fmodules-cache-path=";
287 ModCachePath.append(RelModCacheDir.c_str());
288
289 OS << ' ';
290 printArg(OS, ModCachePath, Quote);
291 }
292
293 if (ResponseFile != nullptr) {
294 OS << "\n Arguments passed via response file:\n";
295 writeResponseFile(OS);
296 // Avoiding duplicated newline terminator, since FileLists are
297 // newline-separated.
298 if (Creator.getResponseFilesSupport() != Tool::RF_FileList)
299 OS << "\n";
300 OS << " (end of response file)";
301 }
302
303 OS << Terminator;
304 }
305
306 void Command::setResponseFile(const char *FileName) {
307 ResponseFile = FileName;
308 ResponseFileFlag = Creator.getResponseFileFlag();
309 ResponseFileFlag += FileName;
310 }
311
312 void Command::setEnvironment(llvm::ArrayRef<const char *> NewEnvironment) {
313 Environment.reserve(NewEnvironment.size() + 1);
314 Environment.assign(NewEnvironment.begin(), NewEnvironment.end());
315 Environment.push_back(nullptr);
316 }
317
318 void Command::PrintFileNames() const {
319 if (PrintInputFilenames) {
320 for (const char *Arg : InputFilenames)
321 llvm::outs() << llvm::sys::path::filename(Arg) << "\n";
322 llvm::outs().flush();
323 }
324 }
325
326 int Command::Execute(ArrayRef<llvm::Optional<StringRef>> Redirects,
327 std::string *ErrMsg, bool *ExecutionFailed) const {
328 PrintFileNames();
329
330 SmallVector<const char *, 128> Argv;
331 if (ResponseFile == nullptr) {
332 Argv.push_back(Executable);
333 Argv.append(Arguments.begin(), Arguments.end());
334 Argv.push_back(nullptr);
335 } else {
336 // If the command is too large, we need to put arguments in a response file.
337 std::string RespContents;
338 llvm::raw_string_ostream SS(RespContents);
339
340 // Write file contents and build the Argv vector
341 writeResponseFile(SS);
342 buildArgvForResponseFile(Argv);
343 Argv.push_back(nullptr);
344 SS.flush();
345
346 // Save the response file in the appropriate encoding
347 if (std::error_code EC = writeFileWithEncoding(
348 ResponseFile, RespContents, Creator.getResponseFileEncoding())) {
349 if (ErrMsg)
350 *ErrMsg = EC.message();
351 if (ExecutionFailed)
352 *ExecutionFailed = true;
353 // Return -1 by convention (see llvm/include/llvm/Support/Program.h) to
354 // indicate the requested executable cannot be started.
355 return -1;
356 }
357 }
358
359 Optional<ArrayRef<StringRef>> Env;
360 std::vector<StringRef> ArgvVectorStorage;
361 if (!Environment.empty()) {
362 assert(Environment.back() == nullptr &&
363 "Environment vector should be null-terminated by now");
364 ArgvVectorStorage = llvm::toStringRefArray(Environment.data());
365 Env = makeArrayRef(ArgvVectorStorage);
366 }
367
368 auto Args = llvm::toStringRefArray(Argv.data());
369 return llvm::sys::ExecuteAndWait(Executable, Args, Env, Redirects,
370 /*secondsToWait*/ 0,
371 /*memoryLimit*/ 0, ErrMsg, ExecutionFailed);
372 }
373
374 void CC1Command::Print(raw_ostream &OS, const char *Terminator, bool Quote,
375 CrashReportInfo *CrashInfo) const {
376 OS << " (in-process)\n";
377 Command::Print(OS, Terminator, Quote, CrashInfo);
378 }
379
380 int CC1Command::Execute(ArrayRef<llvm::Optional<StringRef>> /*Redirects*/,
381 std::string *ErrMsg, bool *ExecutionFailed) const {
382 PrintFileNames();
383
384 SmallVector<const char *, 128> Argv;
385 Argv.push_back(getExecutable());
386 Argv.append(getArguments().begin(), getArguments().end());
387 Argv.push_back(nullptr);
388
389 // This flag simply indicates that the program couldn't start, which isn't
390 // applicable here.
391 if (ExecutionFailed)
392 *ExecutionFailed = false;
393
394 llvm::CrashRecoveryContext CRC;
395 CRC.DumpStackAndCleanupOnFailure = true;
396
397 const void *PrettyState = llvm::SavePrettyStackState();
398 const Driver &D = getCreator().getToolChain().getDriver();
399
400 int R = 0;
401 // Enter ExecuteCC1Tool() instead of starting up a new process
402 if (!CRC.RunSafely([&]() { R = D.CC1Main(Argv); })) {
403 llvm::RestorePrettyStackState(PrettyState);
404 return CRC.RetCode;
405 }
406 return R;
407 }
408
409 void CC1Command::setEnvironment(llvm::ArrayRef<const char *> NewEnvironment) {
410 // We don't support set a new environment when calling into ExecuteCC1Tool()
411 llvm_unreachable(
412 "The CC1Command doesn't support changing the environment vars!");
413 }
414
415 FallbackCommand::FallbackCommand(const Action &Source_, const Tool &Creator_,
416 const char *Executable_,
417 const llvm::opt::ArgStringList &Arguments_,
418 ArrayRef<InputInfo> Inputs,
419 std::unique_ptr<Command> Fallback_)
420 : Command(Source_, Creator_, Executable_, Arguments_, Inputs),
421 Fallback(std::move(Fallback_)) {}
422
423 void FallbackCommand::Print(raw_ostream &OS, const char *Terminator,
424 bool Quote, CrashReportInfo *CrashInfo) const {
425 Command::Print(OS, "", Quote, CrashInfo);
426 OS << " ||";
427 Fallback->Print(OS, Terminator, Quote, CrashInfo);
428 }
429
430 static bool ShouldFallback(int ExitCode) {
431 // FIXME: We really just want to fall back for internal errors, such
432 // as when some symbol cannot be mangled, when we should be able to
433 // parse something but can't, etc.
434 return ExitCode != 0;
435 }
436
437 int FallbackCommand::Execute(ArrayRef<llvm::Optional<StringRef>> Redirects,
438 std::string *ErrMsg, bool *ExecutionFailed) const {
439 int PrimaryStatus = Command::Execute(Redirects, ErrMsg, ExecutionFailed);
440 if (!ShouldFallback(PrimaryStatus))
441 return PrimaryStatus;
442
443 // Clear ExecutionFailed and ErrMsg before falling back.
444 if (ErrMsg)
445 ErrMsg->clear();
446 if (ExecutionFailed)
447 *ExecutionFailed = false;
448
449 const Driver &D = getCreator().getToolChain().getDriver();
450 D.Diag(diag::warn_drv_invoking_fallback) << Fallback->getExecutable();
451
452 int SecondaryStatus = Fallback->Execute(Redirects, ErrMsg, ExecutionFailed);
453 return SecondaryStatus;
454 }
455
456 ForceSuccessCommand::ForceSuccessCommand(
457 const Action &Source_, const Tool &Creator_, const char *Executable_,
458 const llvm::opt::ArgStringList &Arguments_, ArrayRef<InputInfo> Inputs)
459 : Command(Source_, Creator_, Executable_, Arguments_, Inputs) {}
460
461 void ForceSuccessCommand::Print(raw_ostream &OS, const char *Terminator,
462 bool Quote, CrashReportInfo *CrashInfo) const {
463 Command::Print(OS, "", Quote, CrashInfo);
464 OS << " || (exit 0)" << Terminator;
465 }
466
467 int ForceSuccessCommand::Execute(ArrayRef<llvm::Optional<StringRef>> Redirects,
468 std::string *ErrMsg,
469 bool *ExecutionFailed) const {
470 int Status = Command::Execute(Redirects, ErrMsg, ExecutionFailed);
471 (void)Status;
472 if (ExecutionFailed)
473 *ExecutionFailed = false;
474 return 0;
475 }
476
477 void JobList::Print(raw_ostream &OS, const char *Terminator, bool Quote,
478 CrashReportInfo *CrashInfo) const {
479 for (const auto &Job : *this)
480 Job.Print(OS, Terminator, Quote, CrashInfo);
481 }
482
483 void JobList::clear() { Jobs.clear(); }
clang::driver::CC1Command::Execute
int Execute(ArrayRef< Optional< StringRef >> Redirects, std::string *ErrMsg, bool *ExecutionFailed) const override
Definition: Job.cpp:380
llvm
Specialize PointerLikeTypeTraits to allow LazyGenerationalUpdatePtr to be placed into a PointerUnion...
Definition: Dominators.h:30
Tool.h
clang::driver::Tool::RF_FileList
Definition: Tool.h:45
Job.h
clang::driver::Tool::getResponseFileFlag
const char * getResponseFileFlag() const
Returns which prefix to use when passing the name of a response file as a parameter to this tool...
Definition: Tool.h:112
clang::driver::Command::setResponseFile
void setResponseFile(const char *FileName)
Set to pass arguments via a response file when launching the command.
Definition: Job.cpp:306
clang::driver::Driver::Diag
DiagnosticBuilder Diag(unsigned DiagID) const
Definition: Driver.h:109
skipArgs
static bool skipArgs(const char *Flag, bool HaveCrashVFS, int &SkipNum, bool &IsInclude)
Check if the compiler flag in question should be skipped when emitting a reproducer.
Definition: Job.cpp:52
clang::driver::Tool::getResponseFilesSupport
ResponseFileSupport getResponseFilesSupport() const
Returns the level of support for response files of this tool, whether it accepts arguments to be pass...
Definition: Tool.h:92
clang::driver::CrashReportInfo::VFSPath
StringRef VFSPath
Definition: Job.h:33
clang::driver::CC1Command::Print
void Print(llvm::raw_ostream &OS, const char *Terminator, bool Quote, CrashReportInfo *CrashInfo=nullptr) const override
Definition: Job.cpp:374
clang::driver::Command::Command
Command(const Action &Source, const Tool &Creator, const char *Executable, const llvm::opt::ArgStringList &Arguments, ArrayRef< InputInfo > Inputs)
Definition: Job.cpp:38
llvm::Optional
Definition: LLVM.h:37
std
Definition: Format.h:2445
llvm::SmallVectorImpl
Definition: LLVM.h:36
clang::driver::CrashReportInfo
Definition: Job.h:31
clang::driver::Action
Action - Represent an abstract compilation step to perform.
Definition: Action.h:47
LLVM.h
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified...
clang::driver::Driver
Driver - Encapsulate logic for constructing compilation processes from a set of gcc-driver-like comma...
Definition: Driver.h:59
clang::driver::FallbackCommand::FallbackCommand
FallbackCommand(const Action &Source_, const Tool &Creator_, const char *Executable_, const llvm::opt::ArgStringList &Arguments_, ArrayRef< InputInfo > Inputs, std::unique_ptr< Command > Fallback_)
Definition: Job.cpp:415
llvm::ArrayRef
Definition: LLVM.h:31
llvm::SmallString< 128 >
clang::driver::CrashReportInfo::Filename
StringRef Filename
Definition: Job.h:32
Driver.h
clang::driver::ForceSuccessCommand::Execute
int Execute(ArrayRef< Optional< StringRef >> Redirects, std::string *ErrMsg, bool *ExecutionFailed) const override
Definition: Job.cpp:467
clang::driver::Command::getCreator
const Tool & getCreator() const
getCreator - Return the Tool which caused the creation of this job.
Definition: Job.h:107
clang::driver::Command::setEnvironment
virtual void setEnvironment(llvm::ArrayRef< const char *> NewEnvironment)
Sets the environment to be used by the new process.
Definition: Job.cpp:312
rewriteIncludes
static void rewriteIncludes(const llvm::ArrayRef< const char *> &Args, size_t Idx, size_t NumArgs, llvm::SmallVectorImpl< llvm::SmallString< 128 >> &IncFlags)
Rewrite relative include-like flag paths to absolute ones.
Definition: Job.cpp:178
clang::driver::JobList::Print
void Print(llvm::raw_ostream &OS, const char *Terminator, bool Quote, CrashReportInfo *CrashInfo=nullptr) const
Definition: Job.cpp:477
ShouldFallback
static bool ShouldFallback(int ExitCode)
Definition: Job.cpp:430
clang::driver::Command::printArg
static void printArg(llvm::raw_ostream &OS, StringRef Arg, bool Quote)
Print a command argument, and optionally quote it.
Definition: Job.cpp:103
clang::driver::JobList::clear
void clear()
Clear the job list.
Definition: Job.cpp:483
clang::driver::Command
Command - An executable path/name and argument vector to execute.
Definition: Job.h:41
clang::driver::ToolChain::getDriver
const Driver & getDriver() const
Definition: ToolChain.h:199
ToolChain.h
llvm::SmallVector
Definition: LLVM.h:35
clang::driver::FallbackCommand::Print
void Print(llvm::raw_ostream &OS, const char *Terminator, bool Quote, CrashReportInfo *CrashInfo=nullptr) const override
Definition: Job.cpp:423
clang
Dataflow Directional Tag Classes.
Definition: CFGReachabilityAnalysis.h:21
clang::driver::Command::getExecutable
const char * getExecutable() const
Definition: Job.h:124
clang::driver::Command::getArguments
const llvm::opt::ArgStringList & getArguments() const
Definition: Job.h:126
clang::driver::ForceSuccessCommand::Print
void Print(llvm::raw_ostream &OS, const char *Terminator, bool Quote, CrashReportInfo *CrashInfo=nullptr) const override
Definition: Job.cpp:461
clang::driver::CC1Command::setEnvironment
void setEnvironment(llvm::ArrayRef< const char *> NewEnvironment) override
Sets the environment to be used by the new process.
Definition: Job.cpp:409
clang::driver::Tool
Tool - Information on a specific compilation tool.
Definition: Tool.h:33
InputInfo.h
clang::driver::Tool::getToolChain
const ToolChain & getToolChain() const
Definition: Tool.h:83
clang::driver::Command::PrintFileNames
void PrintFileNames() const
Optionally print the filenames to be compiled.
Definition: Job.cpp:318
DriverDiagnostic.h
clang::driver::FallbackCommand::Execute
int Execute(ArrayRef< Optional< StringRef >> Redirects, std::string *ErrMsg, bool *ExecutionFailed) const override
Definition: Job.cpp:437
clang::driver::ForceSuccessCommand::ForceSuccessCommand
ForceSuccessCommand(const Action &Source_, const Tool &Creator_, const char *Executable_, const llvm::opt::ArgStringList &Arguments_, ArrayRef< InputInfo > Inputs)
Definition: Job.cpp:456
clang::driver::Command::Print
virtual void Print(llvm::raw_ostream &OS, const char *Terminator, bool Quote, CrashReportInfo *CrashInfo=nullptr) const
Definition: Job.cpp:216
clang::driver::Command::Execute
virtual int Execute(ArrayRef< Optional< StringRef >> Redirects, std::string *ErrMsg, bool *ExecutionFailed) const
Definition: Job.cpp:326