24 #ifndef LLVM_SUPPORT_PROCESS_H 25 #define LLVM_SUPPORT_PROCESS_H 32 #include <system_error> 35 template <
typename T>
class ArrayRef;
81 std::chrono::nanoseconds &user_time,
82 std::chrono::nanoseconds &sys_time);
189 static const char *
OutputColor(
char c,
bool bold,
bool bg);
209 static void Exit(
int RetCode);
This class represents lattice values for constants.
static const char * ResetColor()
Resets the terminals colors, or returns an escape sequence to do so.
static const char * OutputColor(char c, bool bold, bool bg)
This function returns the colorcode escape sequences.
static bool StandardErrHasColors()
This function determines whether the terminal connected to standard error supports colors...
static bool FileDescriptorHasColors(int fd)
This function determines if the given file descriptor is displayd and supports colors.
static bool AreCoreFilesPrevented()
true if PreventCoreFiles has been called, false otherwise.
static bool FileDescriptorIsDisplayed(int fd)
This function determines if the given file descriptor is connected to a "tty" or "console" window...
This file defines the MallocAllocator and BumpPtrAllocator interfaces.
static std::error_code FixupStandardFileDescriptors()
static bool ColorNeedsFlush()
Whether changing colors requires the output to be flushed.
static const char * OutputReverse()
This function returns the escape sequence to reverse forground and background colors.
Tagged union holding either a T or a Error.
static LLVM_ATTRIBUTE_NORETURN void Exit(int RetCode)
Equivalent to ::exit(), except when running inside a CrashRecoveryContext.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
static unsigned getPageSizeEstimate()
Get the process's estimated page size.
static bool StandardInIsUserInput()
This function determines if the standard input is connected directly to a user's input (keyboard prob...
static bool StandardOutIsDisplayed()
This function determines if the standard output is connected to a "tty" or "console" window...
static void UseANSIEscapeCodes(bool enable)
Enables or disables whether ANSI escape sequences are used to output colors.
static unsigned StandardOutColumns()
This function determines the number of columns in the window if standard output is connected to a "tt...
static Optional< std::string > FindInEnvPath(StringRef EnvName, StringRef FileName, ArrayRef< std::string > IgnoreList)
This function searches for an existing file in the list of directories in a PATH like environment var...
void consumeError(Error Err)
Consume a Error without doing anything.
static size_t GetMallocUsage()
Return process memory usage.
static bool StandardErrIsDisplayed()
This function determines if the standard error is connected to a "tty" or "console" window...
static void PreventCoreFiles()
This function makes the necessary calls to the operating system to prevent core files or any other ki...
#define LLVM_ATTRIBUTE_NORETURN
static unsigned StandardErrColumns()
This function determines the number of columns in the window if standard error is connected to a "tty...
static bool StandardOutHasColors()
This function determines whether the terminal connected to standard output supports colors...
A collection of legacy interfaces for querying information about the current executing process...
static unsigned GetRandomNumber()
Get the result of a process wide random number generator.
static void GetTimeUsage(TimePoint<> &elapsed, std::chrono::nanoseconds &user_time, std::chrono::nanoseconds &sys_time)
This static function will set user_time to the amount of CPU time spent in user (non-kernel) mode and...
static cl::opt< int > PageSize("imp-null-check-page-size", cl::desc("The page size of the target in bytes"), cl::init(4096), cl::Hidden)
static const char * OutputBold(bool bg)
Same as OutputColor, but only enables the bold attribute.
static Expected< unsigned > getPageSize()
Get the process's page size.
static std::error_code SafelyCloseFileDescriptor(int FD)
StringRef - Represent a constant reference to a string, i.e.
static Optional< std::string > GetEnv(StringRef name)
std::chrono::time_point< std::chrono::system_clock, D > TimePoint
A time point on the system clock.