LLVM 20.0.0git
Classes | Namespaces | Typedefs | Enumerations | Functions | Variables
Program.h File Reference
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Config/llvm-config.h"
#include "llvm/Support/ErrorOr.h"
#include "llvm/Support/FileSystem.h"
#include <chrono>
#include <optional>
#include <system_error>

Go to the source code of this file.

Classes

struct  llvm::sys::ProcessInfo
 This struct encapsulates information about a process. More...
 
struct  llvm::sys::ProcessStatistics
 This struct encapsulates information about a process execution. More...
 

Namespaces

namespace  llvm
 This is an optimization pass for GlobalISel generic memory operations.
 
namespace  llvm::sys
 

Typedefs

typedef ::pid_t llvm::sys::procid_t
 
typedef procid_t llvm::sys::process_t
 

Enumerations

enum  llvm::sys::WindowsEncodingMethod { llvm::sys::WEM_UTF8 , llvm::sys::WEM_CurrentCodePage , llvm::sys::WEM_UTF16 }
 File encoding options when writing contents that a non-UTF8 tool will read (on Windows systems). More...
 

Functions

ErrorOr< std::string > llvm::sys::findProgramByName (StringRef Name, ArrayRef< StringRef > Paths={})
 Find the first executable file Name in Paths.
 
std::error_code llvm::sys::ChangeStdinMode (fs::OpenFlags Flags)
 
std::error_code llvm::sys::ChangeStdoutMode (fs::OpenFlags Flags)
 
std::error_code llvm::sys::ChangeStdinToBinary ()
 
std::error_code llvm::sys::ChangeStdoutToBinary ()
 
int llvm::sys::ExecuteAndWait (StringRef Program, ArrayRef< StringRef > Args, std::optional< ArrayRef< StringRef > > Env=std::nullopt, ArrayRef< std::optional< StringRef > > Redirects={}, unsigned SecondsToWait=0, unsigned MemoryLimit=0, std::string *ErrMsg=nullptr, bool *ExecutionFailed=nullptr, std::optional< ProcessStatistics > *ProcStat=nullptr, BitVector *AffinityMask=nullptr)
 This function executes the program using the arguments provided.
 
ProcessInfo llvm::sys::ExecuteNoWait (StringRef Program, ArrayRef< StringRef > Args, std::optional< ArrayRef< StringRef > > Env, ArrayRef< std::optional< StringRef > > Redirects={}, unsigned MemoryLimit=0, std::string *ErrMsg=nullptr, bool *ExecutionFailed=nullptr, BitVector *AffinityMask=nullptr, bool DetachProcess=false)
 Similar to ExecuteAndWait, but returns immediately.
 
bool llvm::sys::commandLineFitsWithinSystemLimits (StringRef Program, ArrayRef< StringRef > Args)
 Return true if the given arguments fit within system-specific argument length limits.
 
bool llvm::sys::commandLineFitsWithinSystemLimits (StringRef Program, ArrayRef< const char * > Args)
 Return true if the given arguments fit within system-specific argument length limits.
 
std::error_code llvm::sys::writeFileWithEncoding (StringRef FileName, StringRef Contents, WindowsEncodingMethod Encoding=WEM_UTF8)
 Saves the UTF8-encoded contents string into the file FileName using a specific encoding.
 
ProcessInfo llvm::sys::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.
 
void llvm::sys::printArg (llvm::raw_ostream &OS, StringRef Arg, bool Quote)
 Print a command argument, and optionally quote it.
 

Variables

const char llvm::sys::EnvPathSeparator = ':'
 This is the OS-specific separator for PATH like environment variables: