25 #ifndef LLVM_SUPPORT_PROCESS_H
26 #define LLVM_SUPPORT_PROCESS_H
30 #include "llvm/Config/llvm-config.h"
33 #include "llvm/Support/DataTypes.h"
62 #if defined(LLVM_ON_UNIX)
64 #elif defined(LLVM_ON_WIN32)
67 #error Unsupported operating system.
246 static const char *
OutputColor(
char c,
bool bold,
bool bg);
static const char * ResetColor()
Resets the terminals colors, or returns an escape sequence to do so.
virtual TimeValue get_system_time() const
Get the system time consumed by this process.
static const char * OutputColor(char c, bool bold, bool bg)
static bool StandardErrHasColors()
static bool FileDescriptorHasColors(int fd)
virtual TimeValue get_user_time() const =0
Get the user time consumed by this process.
static bool FileDescriptorIsDisplayed(int fd)
virtual id_type get_id()
Get the operating system specific identifier for this process.
static bool ColorNeedsFlush()
static const char * OutputReverse()
virtual TimeValue get_wall_time() const =0
Get the wall time consumed by this process.
static bool StandardInIsUserInput()
static bool StandardOutIsDisplayed()
static void UseANSIEscapeCodes(bool enable)
static unsigned StandardOutColumns()
static void GetTimeUsage(TimeValue &elapsed, TimeValue &user_time, TimeValue &sys_time)
Generic base class which exposes information about an operating system process.
virtual ~process()
Only specific subclasses of process objects can be destroyed.
virtual TimeValue get_user_time() const
Get the user time consumed by this process.
virtual TimeValue get_system_time() const =0
Get the system time consumed by this process.
pid_t id_type
Operating system specific type to identify a process.
static size_t GetMallocUsage()
Return process memory usage. This static function will return the total amount of memory allocated by...
virtual id_type get_id()=0
Get the operating system specific identifier for this process.
static self_process * get_self()
Get the process object for the current process.
static bool StandardErrIsDisplayed()
static void PreventCoreFiles()
Prevent core file generation.
static unsigned StandardErrColumns()
static bool StandardOutHasColors()
A collection of legacy interfaces for querying information about the current executing process...
The specific class representing the current process.
static unsigned GetRandomNumber()
virtual TimeValue get_wall_time() const
Get the wall time consumed by this process.
static error_code GetArgumentVector(SmallVectorImpl< const char * > &Args, ArrayRef< const char * > ArgsFromMain, SpecificBumpPtrAllocator< char > &ArgAllocator)
size_t page_size() const
Get the virtual memory page size.
static const char * OutputBold(bool bg)
Same as OutputColor, but only enables the bold attribute.
Provides an abstraction for a fixed point in time.
static Optional< std::string > GetEnv(StringRef name)