LLVM 22.0.0git
Program.inc
Go to the documentation of this file.
1//===- llvm/Support/Unix/Program.inc ----------------------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// This file implements the Unix specific portion of the Program class.
10//
11//===----------------------------------------------------------------------===//
12
13//===----------------------------------------------------------------------===//
14//=== WARNING: Implementation here must contain only generic UNIX
15//=== code that is guaranteed to work on *all* UNIX variants.
16//===----------------------------------------------------------------------===//
17
19
20#include "Unix.h"
22#include "llvm/Config/config.h"
25#include "llvm/Support/Errc.h"
27#include "llvm/Support/Path.h"
31#include <sys/stat.h>
32#include <sys/resource.h>
33#include <signal.h>
34#include <fcntl.h>
35#if HAVE_UNISTD_H
36#include <unistd.h>
37#endif
38#ifdef HAVE_POSIX_SPAWN
39#include <spawn.h>
40
41#if defined(__APPLE__)
42#include <TargetConditionals.h>
43#endif
44
45#if defined(__APPLE__) && !(defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE)
46#define USE_NSGETENVIRON 1
47#else
48#define USE_NSGETENVIRON 0
49#endif
50
51#if !USE_NSGETENVIRON
52extern char **environ;
53#else
54#include <crt_externs.h> // _NSGetEnviron
55#endif
56#endif
57
58using namespace llvm;
59using namespace sys;
60
61ProcessInfo::ProcessInfo() : Pid(0), ReturnCode(0) {}
62
64 ArrayRef<StringRef> Paths) {
65 assert(!Name.empty() && "Must have a name!");
66 // Use the given path verbatim if it contains any slashes; this matches
67 // the behavior of sh(1) and friends.
68 if (Name.contains('/'))
69 return std::string(Name);
70
71 SmallVector<StringRef, 16> EnvironmentPaths;
72 if (Paths.empty())
73 if (const char *PathEnv = std::getenv("PATH")) {
74 SplitString(PathEnv, EnvironmentPaths, ":");
75 Paths = EnvironmentPaths;
76 }
77
78 for (auto Path : Paths) {
79 if (Path.empty())
80 continue;
81
82 // Check to see if this first directory contains the executable...
83 SmallString<128> FilePath(Path);
84 sys::path::append(FilePath, Name);
85 if (sys::fs::can_execute(FilePath.c_str()))
86 return std::string(FilePath); // Found the executable!
87 }
89}
90
91static bool RedirectIO(std::optional<StringRef> Path, int FD, std::string *ErrMsg) {
92 if (!Path) // Noop
93 return false;
94 std::string File;
95 if (Path->empty())
96 // Redirect empty paths to /dev/null
97 File = "/dev/null";
98 else
99 File = std::string(*Path);
100
101 // Open the file
102 int InFD = open(File.c_str(), FD == 0 ? O_RDONLY : O_WRONLY | O_CREAT, 0666);
103 if (InFD == -1) {
104 MakeErrMsg(ErrMsg, "Cannot open file '" + File + "' for " +
105 (FD == 0 ? "input" : "output"));
106 return true;
107 }
108
109 // Install it as the requested FD
110 if (dup2(InFD, FD) == -1) {
111 MakeErrMsg(ErrMsg, "Cannot dup2");
112 close(InFD);
113 return true;
114 }
115 close(InFD); // Close the original FD
116 return false;
117}
118
119#ifdef HAVE_POSIX_SPAWN
120static bool RedirectIO_PS(const std::string *Path, int FD, std::string *ErrMsg,
121 posix_spawn_file_actions_t *FileActions) {
122 if (!Path) // Noop
123 return false;
124 const char *File;
125 if (Path->empty())
126 // Redirect empty paths to /dev/null
127 File = "/dev/null";
128 else
129 File = Path->c_str();
130
131 if (int Err = posix_spawn_file_actions_addopen(
132 FileActions, FD, File, FD == 0 ? O_RDONLY : O_WRONLY | O_CREAT, 0666))
133 return MakeErrMsg(ErrMsg, "Cannot posix_spawn_file_actions_addopen", Err);
134 return false;
135}
136#endif
137
138static void TimeOutHandler(int Sig) {}
139
140static void SetMemoryLimits(unsigned size) {
141 struct rlimit r;
142 __typeof__(r.rlim_cur) limit = (__typeof__(r.rlim_cur))(size)*1048576;
143
144 // Heap size
145 getrlimit(RLIMIT_DATA, &r);
146 r.rlim_cur = limit;
147 setrlimit(RLIMIT_DATA, &r);
148#ifdef RLIMIT_RSS
149 // Resident set size.
150 getrlimit(RLIMIT_RSS, &r);
151 r.rlim_cur = limit;
152 setrlimit(RLIMIT_RSS, &r);
153#endif
154}
155
156static std::vector<const char *>
157toNullTerminatedCStringArray(ArrayRef<StringRef> Strings, StringSaver &Saver) {
158 std::vector<const char *> Result;
159 for (StringRef S : Strings)
160 Result.push_back(Saver.save(S).data());
161 Result.push_back(nullptr);
162 return Result;
163}
164
165static bool Execute(ProcessInfo &PI, StringRef Program,
167 std::optional<ArrayRef<StringRef>> Env,
168 ArrayRef<std::optional<StringRef>> Redirects,
169 unsigned MemoryLimit, std::string *ErrMsg,
170 BitVector *AffinityMask, bool DetachProcess) {
171 assert(!AffinityMask && "Starting a process with an affinity mask is "
172 "currently not supported on Unix!");
173
175 StringSaver Saver(Allocator);
176 std::vector<const char *> ArgVector, EnvVector;
177 const char **Argv = nullptr;
178 const char **Envp = nullptr;
179 ArgVector = toNullTerminatedCStringArray(Args, Saver);
180 Argv = ArgVector.data();
181 if (Env) {
182 EnvVector = toNullTerminatedCStringArray(*Env, Saver);
183 Envp = EnvVector.data();
184 }
185
186 // If this OS has posix_spawn and there is no memory limit being implied, use
187 // posix_spawn. It is more efficient than fork/exec.
188#ifdef HAVE_POSIX_SPAWN
189 // Cannot use posix_spawn if you would like to detach the process
190 if (MemoryLimit == 0 && !DetachProcess) {
191 posix_spawn_file_actions_t FileActionsStore;
192 posix_spawn_file_actions_t *FileActions = nullptr;
193
194 // If we call posix_spawn_file_actions_addopen we have to make sure the
195 // c strings we pass to it stay alive until the call to posix_spawn,
196 // so we copy any StringRefs into this variable.
197 std::string RedirectsStorage[3];
198
199 if (!Redirects.empty()) {
200 assert(Redirects.size() == 3);
201 std::string *RedirectsStr[3] = {nullptr, nullptr, nullptr};
202 for (int I = 0; I < 3; ++I) {
203 if (Redirects[I]) {
204 RedirectsStorage[I] = std::string(*Redirects[I]);
205 RedirectsStr[I] = &RedirectsStorage[I];
206 }
207 }
208
209 FileActions = &FileActionsStore;
210 posix_spawn_file_actions_init(FileActions);
211
212 // Redirect stdin/stdout.
213 if (RedirectIO_PS(RedirectsStr[0], 0, ErrMsg, FileActions) ||
214 RedirectIO_PS(RedirectsStr[1], 1, ErrMsg, FileActions))
215 return false;
216 if (!Redirects[1] || !Redirects[2] || *Redirects[1] != *Redirects[2]) {
217 // Just redirect stderr
218 if (RedirectIO_PS(RedirectsStr[2], 2, ErrMsg, FileActions))
219 return false;
220 } else {
221 // If stdout and stderr should go to the same place, redirect stderr
222 // to the FD already open for stdout.
223 if (int Err = posix_spawn_file_actions_adddup2(FileActions, 1, 2))
224 return !MakeErrMsg(ErrMsg, "Can't redirect stderr to stdout", Err);
225 }
226 }
227
228 if (!Envp)
229#if !USE_NSGETENVIRON
230 Envp = const_cast<const char **>(environ);
231#else
232 // environ is missing in dylibs.
233 Envp = const_cast<const char **>(*_NSGetEnviron());
234#endif
235
236 constexpr int maxRetries = 8;
237 int retries = 0;
238 pid_t PID;
239 int Err;
240 do {
241 PID = 0; // Make Valgrind happy.
242 Err = posix_spawn(&PID, Program.str().c_str(), FileActions,
243 /*attrp*/ nullptr, const_cast<char **>(Argv),
244 const_cast<char **>(Envp));
245 } while (Err == EINTR && ++retries < maxRetries);
246
247 if (FileActions)
248 posix_spawn_file_actions_destroy(FileActions);
249
250 if (Err)
251 return !MakeErrMsg(ErrMsg, "posix_spawn failed", Err);
252
253 PI.Pid = PID;
254 PI.Process = PID;
255
256 return true;
257 }
258#endif // HAVE_POSIX_SPAWN
259
260 // Create a child process.
261 int child = fork();
262 switch (child) {
263 // An error occurred: Return to the caller.
264 case -1:
265 MakeErrMsg(ErrMsg, "Couldn't fork");
266 return false;
267
268 // Child process: Execute the program.
269 case 0: {
270 // Redirect file descriptors...
271 if (!Redirects.empty()) {
272 // Redirect stdin
273 if (RedirectIO(Redirects[0], 0, ErrMsg)) {
274 return false;
275 }
276 // Redirect stdout
277 if (RedirectIO(Redirects[1], 1, ErrMsg)) {
278 return false;
279 }
280 if (Redirects[1] && Redirects[2] && *Redirects[1] == *Redirects[2]) {
281 // If stdout and stderr should go to the same place, redirect stderr
282 // to the FD already open for stdout.
283 if (-1 == dup2(1, 2)) {
284 MakeErrMsg(ErrMsg, "Can't redirect stderr to stdout");
285 return false;
286 }
287 } else {
288 // Just redirect stderr
289 if (RedirectIO(Redirects[2], 2, ErrMsg)) {
290 return false;
291 }
292 }
293 }
294
295 if (DetachProcess) {
296 // Detach from controlling terminal
297 if (::setsid() == -1) {
298 MakeErrMsg(ErrMsg, "Could not detach process, ::setsid failed");
299 return false;
300 }
301 }
302
303 // Set memory limits
304 if (MemoryLimit != 0) {
305 SetMemoryLimits(MemoryLimit);
306 }
307
308 // Execute!
309 std::string PathStr = std::string(Program);
310 if (Envp != nullptr)
311 execve(PathStr.c_str(), const_cast<char **>(Argv),
312 const_cast<char **>(Envp));
313 else
314 execv(PathStr.c_str(), const_cast<char **>(Argv));
315 // If the execve() failed, we should exit. Follow Unix protocol and
316 // return 127 if the executable was not found, and 126 otherwise.
317 // Use _exit rather than exit so that atexit functions and static
318 // object destructors cloned from the parent process aren't
319 // redundantly run, and so that any data buffered in stdio buffers
320 // cloned from the parent aren't redundantly written out.
321 _exit(errno == ENOENT ? 127 : 126);
322 }
323
324 // Parent process: Break out of the switch to do our processing.
325 default:
326 break;
327 }
328
329 PI.Pid = child;
330 PI.Process = child;
331
332 return true;
333}
334
335namespace llvm {
336namespace sys {
337
338#if defined(_AIX)
339static pid_t(wait4)(pid_t pid, int *status, int options, struct rusage *usage);
340#elif !defined(__Fuchsia__)
341using ::wait4;
342#endif
343
344} // namespace sys
345} // namespace llvm
346
347#ifdef _AIX
348#ifndef _ALL_SOURCE
349extern "C" pid_t(wait4)(pid_t pid, int *status, int options,
350 struct rusage *usage);
351#endif
352pid_t(llvm::sys::wait4)(pid_t pid, int *status, int options,
353 struct rusage *usage) {
354 assert(pid > 0 && "Only expecting to handle actual PID values!");
355 assert((options & ~WNOHANG) == 0 && "Expecting WNOHANG at most!");
356 assert(usage && "Expecting usage collection!");
357
358 // AIX wait4 does not work well with WNOHANG.
359 if (!(options & WNOHANG))
360 return ::wait4(pid, status, options, usage);
361
362 // For WNOHANG, we use waitid (which supports WNOWAIT) until the child process
363 // has terminated.
364 siginfo_t WaitIdInfo;
365 WaitIdInfo.si_pid = 0;
366 int WaitIdRetVal =
367 waitid(P_PID, pid, &WaitIdInfo, WNOWAIT | WEXITED | options);
368
369 if (WaitIdRetVal == -1 || WaitIdInfo.si_pid == 0)
370 return WaitIdRetVal;
371
372 assert(WaitIdInfo.si_pid == pid);
373
374 // The child has already terminated, so a blocking wait on it is okay in the
375 // absence of indiscriminate `wait` calls from the current process (which
376 // would cause the call here to fail with ECHILD).
377 return ::wait4(pid, status, options & ~WNOHANG, usage);
378}
379#endif
380
382 std::optional<unsigned> SecondsToWait,
383 std::string *ErrMsg,
384 std::optional<ProcessStatistics> *ProcStat,
385 bool Polling) {
386 struct sigaction Act, Old;
387 assert(PI.Pid && "invalid pid to wait on, process not started?");
388
389 int WaitPidOptions = 0;
390 pid_t ChildPid = PI.Pid;
391 bool WaitUntilTerminates = false;
392 if (!SecondsToWait) {
393 WaitUntilTerminates = true;
394 } else {
395 if (*SecondsToWait == 0)
396 WaitPidOptions = WNOHANG;
397
398 // Install a timeout handler. The handler itself does nothing, but the
399 // simple fact of having a handler at all causes the wait below to return
400 // with EINTR, unlike if we used SIG_IGN.
401 memset(&Act, 0, sizeof(Act));
402 Act.sa_handler = TimeOutHandler;
403 sigemptyset(&Act.sa_mask);
404 sigaction(SIGALRM, &Act, &Old);
405 // FIXME The alarm signal may be delivered to another thread.
406 alarm(*SecondsToWait);
407 }
408
409 // Parent process: Wait for the child process to terminate.
410 int status = 0;
411 ProcessInfo WaitResult;
412#ifndef __Fuchsia__
413 rusage Info;
414 if (ProcStat)
415 ProcStat->reset();
416
417 do {
418 WaitResult.Pid = sys::wait4(ChildPid, &status, WaitPidOptions, &Info);
419 } while (WaitUntilTerminates && WaitResult.Pid == -1 && errno == EINTR);
420#endif
421
422 if (WaitResult.Pid != PI.Pid) {
423 if (WaitResult.Pid == 0) {
424 // Non-blocking wait.
425 return WaitResult;
426 } else {
427 if (SecondsToWait && errno == EINTR && !Polling) {
428 // Kill the child.
429 kill(PI.Pid, SIGKILL);
430
431 // Turn off the alarm and restore the signal handler
432 alarm(0);
433 sigaction(SIGALRM, &Old, nullptr);
434
435 // Wait for child to die
436 // FIXME This could grab some other child process out from another
437 // waiting thread and then leave a zombie anyway.
438 if (wait(&status) != ChildPid)
439 MakeErrMsg(ErrMsg, "Child timed out but wouldn't die");
440 else
441 MakeErrMsg(ErrMsg, "Child timed out", 0);
442
443 WaitResult.ReturnCode = -2; // Timeout detected
444 return WaitResult;
445 } else if (errno != EINTR) {
446 MakeErrMsg(ErrMsg, "Error waiting for child process");
447 WaitResult.ReturnCode = -1;
448 return WaitResult;
449 }
450 }
451 }
452
453 // We exited normally without timeout, so turn off the timer.
454 if (SecondsToWait && !WaitUntilTerminates) {
455 alarm(0);
456 sigaction(SIGALRM, &Old, nullptr);
457 }
458
459#ifndef __Fuchsia__
460 if (ProcStat) {
461 std::chrono::microseconds UserT = toDuration(Info.ru_utime);
462 std::chrono::microseconds KernelT = toDuration(Info.ru_stime);
463 uint64_t PeakMemory = 0;
464#if !defined(__HAIKU__) && !defined(__MVS__)
465 PeakMemory = static_cast<uint64_t>(Info.ru_maxrss);
466#endif
467 *ProcStat = ProcessStatistics{UserT + KernelT, UserT, PeakMemory};
468 }
469#endif
470
471 // Return the proper exit status. Detect error conditions
472 // so we can return -1 for them and set ErrMsg informatively.
473 int result = 0;
474 if (WIFEXITED(status)) {
475 result = WEXITSTATUS(status);
476 WaitResult.ReturnCode = result;
477
478 if (result == 127) {
479 if (ErrMsg)
480 *ErrMsg = llvm::sys::StrError(ENOENT);
481 WaitResult.ReturnCode = -1;
482 return WaitResult;
483 }
484 if (result == 126) {
485 if (ErrMsg)
486 *ErrMsg = "Program could not be executed";
487 WaitResult.ReturnCode = -1;
488 return WaitResult;
489 }
490 } else if (WIFSIGNALED(status)) {
491 if (ErrMsg) {
492 *ErrMsg = strsignal(WTERMSIG(status));
493#ifdef WCOREDUMP
494 if (WCOREDUMP(status))
495 *ErrMsg += " (core dumped)";
496#endif
497 }
498 // Return a special value to indicate that the process received an unhandled
499 // signal during execution as opposed to failing to execute.
500 WaitResult.ReturnCode = -2;
501 }
502 return WaitResult;
503}
504
505std::error_code llvm::sys::ChangeStdinMode(fs::OpenFlags Flags) {
506 if (!(Flags & fs::OF_Text))
507 return ChangeStdinToBinary();
508 return std::error_code();
509}
510
511std::error_code llvm::sys::ChangeStdoutMode(fs::OpenFlags Flags) {
512 if (!(Flags & fs::OF_Text))
513 return ChangeStdoutToBinary();
514 return std::error_code();
515}
516
517std::error_code llvm::sys::ChangeStdinToBinary() {
518#ifdef __MVS__
519 return disableAutoConversion(STDIN_FILENO);
520#else
521 // Do nothing, as Unix doesn't differentiate between text and binary.
522 return std::error_code();
523#endif
524}
525
526std::error_code llvm::sys::ChangeStdoutToBinary() {
527 // Do nothing, as Unix doesn't differentiate between text and binary.
528 return std::error_code();
529}
530
531std::error_code
533 WindowsEncodingMethod Encoding /*unused*/) {
534 std::error_code EC;
535 llvm::raw_fd_ostream OS(FileName, EC,
537
538 if (EC)
539 return EC;
540
541 OS << Contents;
542
543 if (OS.has_error())
545
546 return EC;
547}
548
550 ArrayRef<StringRef> Args) {
551 static long ArgMax = sysconf(_SC_ARG_MAX);
552 // POSIX requires that _POSIX_ARG_MAX is 4096, which is the lowest possible
553 // value for ARG_MAX on a POSIX compliant system.
554 static long ArgMin = _POSIX_ARG_MAX;
555
556 // This the same baseline used by xargs.
557 long EffectiveArgMax = 128 * 1024;
558
559 if (EffectiveArgMax > ArgMax)
560 EffectiveArgMax = ArgMax;
561 else if (EffectiveArgMax < ArgMin)
562 EffectiveArgMax = ArgMin;
563
564 // System says no practical limit.
565 if (ArgMax == -1)
566 return true;
567
568 // Conservatively account for space required by environment variables.
569 long HalfArgMax = EffectiveArgMax / 2;
570
571 size_t ArgLength = Program.size() + 1;
572 for (StringRef Arg : Args) {
573 // Ensure that we do not exceed the MAX_ARG_STRLEN constant on Linux, which
574 // does not have a constant unlike what the man pages would have you
575 // believe. Since this limit is pretty high, perform the check
576 // unconditionally rather than trying to be aggressive and limiting it to
577 // Linux only.
578 if (Arg.size() >= (32 * 4096))
579 return false;
580
581 ArgLength += Arg.size() + 1;
582 if (ArgLength > size_t(HalfArgMax)) {
583 return false;
584 }
585 }
586
587 return true;
588}
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
Analysis containing CSE Info
Definition CSEInfo.cpp:27
#define STDIN_FILENO
Definition InitLLVM.cpp:25
#define I(x, y, z)
Definition MD5.cpp:58
static bool Execute(ProcessInfo &PI, StringRef Program, ArrayRef< StringRef > Args, std::optional< ArrayRef< StringRef > > Env, ArrayRef< std::optional< StringRef > > Redirects, unsigned MemoryLimit, std::string *ErrMsg, BitVector *AffinityMask, bool DetachProcess)
Basic Register Allocator
This file contains some functions that are useful when dealing with strings.
static bool MakeErrMsg(std::string *ErrMsg, const std::string &prefix, int errnum=-1)
This function builds an error message into ErrMsg using the prefix string and the Unix error number g...
Definition Unix.h:53
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition ArrayRef.h:41
bool empty() const
empty - Check if the array is empty.
Definition ArrayRef.h:142
Represents either an error or a value T.
Definition ErrorOr.h:56
SmallString - A SmallString is just a SmallVector with methods and accessors that make it work better...
Definition SmallString.h:26
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
StringRef - Represent a constant reference to a string, i.e.
Definition StringRef.h:55
std::string str() const
str - Get the contents as an std::string.
Definition StringRef.h:233
constexpr size_t size() const
size - Get the string size.
Definition StringRef.h:154
constexpr const char * data() const
data - Get a pointer to the start of the string (which may not be null terminated).
Definition StringRef.h:148
Saves strings in the provided stable storage and returns a StringRef with a stable character pointer.
Definition StringSaver.h:22
StringRef save(const char *S)
Definition StringSaver.h:31
A raw_ostream that writes to a file descriptor.
std::vector< std::string > ArgVector
LVOptions & options()
Definition LVOptions.h:448
LLVM_ABI bool can_execute(const Twine &Path)
Can we execute this file?
@ OF_Text
The file should be opened in text mode on platforms like z/OS that make this distinction.
Definition FileSystem.h:767
@ OF_TextWithCRLF
The file should be opened in text mode and use a carriage linefeed '\r '.
Definition FileSystem.h:776
LLVM_ABI std::error_code status(const Twine &path, file_status &result, bool follow=true)
Get file status as if by POSIX stat().
LLVM_ABI void append(SmallVectorImpl< char > &path, const Twine &a, const Twine &b="", const Twine &c="", const Twine &d="")
Append to path.
Definition Path.cpp:456
LLVM_ABI std::error_code ChangeStdoutMode(fs::OpenFlags Flags)
std::chrono::nanoseconds toDuration(FILETIME Time)
LLVM_ABI std::string StrError()
Returns a string representation of the errno value, using whatever thread-safe variant of strerror() ...
Definition Errno.cpp:26
LLVM_ABI std::error_code ChangeStdinMode(fs::OpenFlags Flags)
LLVM_ABI std::error_code ChangeStdinToBinary()
LLVM_ABI bool commandLineFitsWithinSystemLimits(StringRef Program, ArrayRef< StringRef > Args)
Return true if the given arguments fit within system-specific argument length limits.
LLVM_ABI std::error_code writeFileWithEncoding(StringRef FileName, StringRef Contents, WindowsEncodingMethod Encoding=WEM_UTF8)
Saves the UTF8-encoded contents string into the file FileName using a specific encoding.
LLVM_ABI ErrorOr< std::string > findProgramByName(StringRef Name, ArrayRef< StringRef > Paths={})
Find the first executable file Name in Paths.
WindowsEncodingMethod
File encoding options when writing contents that a non-UTF8 tool will read (on Windows systems).
Definition Program.h:173
LLVM_ABI std::error_code ChangeStdoutToBinary()
LLVM_ABI ProcessInfo Wait(const ProcessInfo &PI, std::optional< unsigned > SecondsToWait, std::string *ErrMsg=nullptr, std::optional< ProcessStatistics > *ProcStat=nullptr, bool Polling=false)
This function waits for the process specified by PI to finish.
This is an optimization pass for GlobalISel generic memory operations.
auto size(R &&Range, std::enable_if_t< std::is_base_of< std::random_access_iterator_tag, typename std::iterator_traits< decltype(Range.begin())>::iterator_category >::value, void > *=nullptr)
Get the size of a range.
Definition STLExtras.h:1657
std::error_code make_error_code(BitcodeError E)
LLVM_ABI void SplitString(StringRef Source, SmallVectorImpl< StringRef > &OutFragments, StringRef Delimiters=" \t\n\v\f\r")
SplitString - Split up the specified string according to the specified delimiters,...
@ no_such_file_or_directory
Definition Errc.h:65
@ io_error
Definition Errc.h:58
BumpPtrAllocatorImpl BumpPtrAllocator
The standard BumpPtrAllocator which just uses the default template parameters.
Definition Allocator.h:383
This struct encapsulates information about a process.
Definition Program.h:47
process_t Process
The process identifier.
Definition Program.h:51
int ReturnCode
Platform-dependent process object.
Definition Program.h:54
This struct encapsulates information about a process execution.
Definition Program.h:60