LLVM API Documentation
A collection of legacy interfaces for querying information about the current executing process. More...
#include <Process.h>
Static Public Member Functions | |
| static size_t | GetMallocUsage () |
| Return process memory usage. This static function will return the total amount of memory allocated by the process. This only counts the memory allocated via the malloc, calloc and realloc functions and includes any "free" holes in the allocated space. | |
| static void | GetTimeUsage (TimeValue &elapsed, TimeValue &user_time, TimeValue &sys_time) |
| static int | GetCurrentUserId () |
| static int | GetCurrentGroupId () |
| static void | PreventCoreFiles () |
| Prevent core file generation. | |
| static bool | StandardInIsUserInput () |
| static bool | StandardOutIsDisplayed () |
| static bool | StandardErrIsDisplayed () |
| static bool | FileDescriptorIsDisplayed (int fd) |
| static bool | FileDescriptorHasColors (int fd) |
| static unsigned | StandardOutColumns () |
| static unsigned | StandardErrColumns () |
| static bool | StandardOutHasColors () |
| static bool | StandardErrHasColors () |
| static bool | ColorNeedsFlush () |
| static const char * | OutputColor (char c, bool bold, bool bg) |
| static const char * | OutputBold (bool bg) |
| Same as OutputColor, but only enables the bold attribute. | |
| static const char * | OutputReverse () |
| static const char * | ResetColor () |
| Resets the terminals colors, or returns an escape sequence to do so. | |
| static unsigned | GetRandomNumber () |
A collection of legacy interfaces for querying information about the current executing process.
| static bool llvm::sys::Process::ColorNeedsFlush | ( | ) | [static] |
Whether changing colors requires the output to be flushed. This is needed on systems that don't support escape sequences for changing colors.
Referenced by llvm::raw_fd_ostream::changeColor(), llvm::raw_fd_ostream::resetColor(), and llvm::raw_fd_ostream::reverseColor().
| static bool llvm::sys::Process::FileDescriptorHasColors | ( | int | fd | ) | [static] |
This function determines if the given file descriptor is displayd and supports colors.
Referenced by llvm::raw_fd_ostream::has_colors().
| static bool llvm::sys::Process::FileDescriptorIsDisplayed | ( | int | fd | ) | [static] |
This function determines if the given file descriptor is connected to a "tty" or "console" window. That is, the output would be displayed to the user rather than being put on a pipe or stored in a file.
Referenced by llvm::raw_fd_ostream::is_displayed().
| static int llvm::sys::Process::GetCurrentGroupId | ( | ) | [static] |
This static function will return the process' current group id number. Not all operating systems support this feature. Where it is not supported, the function should return 65536 as the value.
Referenced by llvm::ArchiveMember::ArchiveMember(), and llvm::Archive::writeSymbolTable().
| static int llvm::sys::Process::GetCurrentUserId | ( | ) | [static] |
This static function will return the process' current user id number. Not all operating systems support this feature. Where it is not supported, the function should return 65536 as the value.
Referenced by llvm::ArchiveMember::ArchiveMember(), and llvm::Archive::writeSymbolTable().
| static size_t llvm::sys::Process::GetMallocUsage | ( | ) | [static] |
Return process memory usage. This static function will return the total amount of memory allocated by the process. This only counts the memory allocated via the malloc, calloc and realloc functions and includes any "free" holes in the allocated space.
Referenced by getMemUsage().
| static unsigned llvm::sys::Process::GetRandomNumber | ( | ) | [static] |
Get the result of a process wide random number generator. The generator will be automatically seeded in non-deterministic fashion.
| static void llvm::sys::Process::GetTimeUsage | ( | TimeValue & | elapsed, |
| TimeValue & | user_time, | ||
| TimeValue & | sys_time | ||
| ) | [static] |
This static function will set user_time to the amount of CPU time spent in user (non-kernel) mode and sys_time to the amount of CPU time spent in system (kernel) mode. If the operating system does not support collection of these metrics, a zero TimeValue will be for both values.
| elapsed | Returns the TimeValue::now() giving current time |
| user_time | Returns the current amount of user time for the process |
| sys_time | Returns the current amount of system time for the process |
Referenced by llvm::TimeRecord::getCurrentTime().
| static const char* llvm::sys::Process::OutputBold | ( | bool | bg | ) | [static] |
Same as OutputColor, but only enables the bold attribute.
Referenced by llvm::raw_fd_ostream::changeColor().
This function returns the colorcode escape sequences. If ColorNeedsFlush() is true then this function will change the colors and return an empty escape sequence. In that case it is the responsibility of the client to flush the output stream prior to calling this function.
Referenced by llvm::raw_fd_ostream::changeColor().
| static const char* llvm::sys::Process::OutputReverse | ( | ) | [static] |
This function returns the escape sequence to reverse forground and background colors.
Referenced by llvm::raw_fd_ostream::reverseColor().
| static void llvm::sys::Process::PreventCoreFiles | ( | ) | [static] |
Prevent core file generation.
This function makes the necessary calls to the operating system to prevent core files or any other kind of large memory dumps that can occur when a program fails.
| static const char* llvm::sys::Process::ResetColor | ( | ) | [static] |
Resets the terminals colors, or returns an escape sequence to do so.
Referenced by llvm::raw_fd_ostream::resetColor().
| static unsigned llvm::sys::Process::StandardErrColumns | ( | ) | [static] |
This function determines the number of columns in the window if standard error is connected to a "tty" or "console" window. If standard error is not connected to a tty or console, or if the number of columns cannot be determined, this routine returns zero.
| static bool llvm::sys::Process::StandardErrHasColors | ( | ) | [static] |
This function determines whether the terminal connected to standard error supports colors. If standard error is not connected to a terminal, this function returns false.
| static bool llvm::sys::Process::StandardErrIsDisplayed | ( | ) | [static] |
This function determines if the standard error is connected to a "tty" or "console" window. That is, the output would be displayed to the user rather than being put on a pipe or stored in a file.
| static bool llvm::sys::Process::StandardInIsUserInput | ( | ) | [static] |
This function determines if the standard input is connected directly to a user's input (keyboard probably), rather than coming from a file or pipe.
| static unsigned llvm::sys::Process::StandardOutColumns | ( | ) | [static] |
This function determines the number of columns in the window if standard output is connected to a "tty" or "console" window. If standard output is not connected to a tty or console, or if the number of columns cannot be determined, this routine returns zero.
| static bool llvm::sys::Process::StandardOutHasColors | ( | ) | [static] |
This function determines whether the terminal connected to standard output supports colors. If standard output is not connected to a terminal, this function returns false.
| static bool llvm::sys::Process::StandardOutIsDisplayed | ( | ) | [static] |
This function determines if the standard output is connected to a "tty" or "console" window. That is, the output would be displayed to the user rather than being put on a pipe or stored in a file.