14 #ifndef LLVM_SUPPORT_PROGRAM_H 15 #define LLVM_SUPPORT_PROGRAM_H 20 #include "llvm/Config/llvm-config.h" 22 #include <system_error> 29 #if defined(LLVM_ON_UNIX) 31 #elif defined (_WIN32) 32 const char EnvPathSeparator =
';';
107 unsigned SecondsToWait = 0,
112 unsigned MemoryLimit = 0,
116 std::string *ErrMsg =
nullptr,
120 bool *ExecutionFailed =
nullptr);
130 unsigned MemoryLimit = 0,
131 std::string *ErrMsg =
nullptr,
132 bool *ExecutionFailed =
nullptr);
187 unsigned SecondsToWait,
191 bool WaitUntilTerminates,
193 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.
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:
amdgpu Simplify well known AMD library false Value Value const Twine & Name
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.