13 #ifndef LLVM_SUPPORT_PROGRAM_H 14 #define LLVM_SUPPORT_PROGRAM_H 19 #include "llvm/Config/llvm-config.h" 21 #include <system_error> 28 #if defined(LLVM_ON_UNIX) 30 #elif defined (_WIN32) 31 const char EnvPathSeparator =
';';
106 unsigned SecondsToWait = 0,
111 unsigned MemoryLimit = 0,
115 std::string *ErrMsg =
nullptr,
119 bool *ExecutionFailed =
nullptr);
129 unsigned MemoryLimit = 0,
130 std::string *ErrMsg =
nullptr,
131 bool *ExecutionFailed =
nullptr);
186 unsigned SecondsToWait,
190 bool WaitUntilTerminates,
192 std::string *ErrMsg =
nullptr Represents either an error or a value T.
This class represents lattice values for constants.
ProcessInfo ExecuteNoWait(StringRef Program, ArrayRef< StringRef > Args, Optional< ArrayRef< StringRef >> Env, ArrayRef< Optional< StringRef >> Redirects={}, unsigned MemoryLimit=0, std::string *ErrMsg=nullptr, bool *ExecutionFailed=nullptr)
Similar to ExecuteAndWait, but returns immediately.
amdgpu Simplify well known AMD library false FunctionCallee Value const Twine & Name
std::error_code ChangeStdoutToBinary()
ErrorOr< std::string > findProgramByName(StringRef Name, ArrayRef< StringRef > Paths={})
Find the first executable file Name in Paths.
UTF-8 is the LLVM native encoding, being the same as "do not perform encoding conversion"...
int ExecuteAndWait(StringRef Program, ArrayRef< StringRef > Args, Optional< ArrayRef< StringRef >> Env=None, ArrayRef< Optional< StringRef >> Redirects={}, unsigned SecondsToWait=0, unsigned MemoryLimit=0, std::string *ErrMsg=nullptr, bool *ExecutionFailed=nullptr)
This function executes the program using the arguments provided.
const char EnvPathSeparator
This is the OS-specific separator for PATH like environment variables:
process_t Process
The process identifier.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
bool commandLineFitsWithinSystemLimits(StringRef Program, ArrayRef< StringRef > Args)
Return true if the given arguments fit within system-specific argument length limits.
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.
WindowsEncodingMethod
File encoding options when writing contents that a non-UTF8 tool will read (on Windows systems)...
int ReturnCode
Platform-dependent process object.
std::error_code ChangeStdinToBinary()
This struct encapsulates information about a process.
Provides ErrorOr<T> smart pointer.
StringRef - Represent a constant reference to a string, i.e.
ProcessInfo Wait(const ProcessInfo &PI, unsigned SecondsToWait, bool WaitUntilTerminates, std::string *ErrMsg=nullptr)
This function waits for the process specified by PI to finish.
constexpr char Args[]
Key for Kernel::Metadata::mArgs.