LLVM: include/llvm/Support/Process.h Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24#ifndef LLVM_SUPPORT_PROCESS_H
25#define LLVM_SUPPORT_PROCESS_H
26
32#include
33#include <system_error>
34
35namespace llvm {
36template class ArrayRef;
38
39namespace sys {
40
41
42
43
45public:
47
48
50
51
52
53
54
55
57
58
59
60
61
65 else {
67 return 4096;
68 }
69 }
70
71
72
73
74
75
77
78
79
80
81
82
83
84
85
87 std::chrono::nanoseconds &user_time,
88 std::chrono::nanoseconds &sys_time);
89
90
91
92
93
95
96
98
99
100
102
103
104
105
106
107
108
109 LLVM_ABI static std::optionalstd::string
113
114 LLVM_ABI static std::optionalstd::string
117
118
119
120
121
123
124
125
126
127
128
129
130
132
133
134
135
137
138
139
140
142
143
144
145
147
148
149
150
152
153
154
156
157
158
159
160
161
163
164
165
166
167
168
170
171
172
173
175
176
177
178
180
181
182
183
184
186
187
188
189
191
192
193
194
195
196
198
199
201
202
203
205
206
208
209
210
212
213
214
215
216
217 [[noreturn]] LLVM_ABI static void Exit(int RetCode, bool NoCleanup = false);
218
219private:
220 [[noreturn]] static void ExitNoCleanup(int RetCode);
221};
222
223}
224}
225
226#endif
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)
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Tagged union holding either a T or a Error.
StringRef - Represent a constant reference to a string, i.e.
A collection of legacy interfaces for querying information about the current executing process.
Definition Process.h:44
static LLVM_ABI void UseANSIEscapeCodes(bool enable)
Enables or disables whether ANSI escape sequences are used to output colors.
static LLVM_ABI std::error_code SafelyCloseFileDescriptor(int FD)
static LLVM_ABI 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 LLVM_ABI std::error_code FixupStandardFileDescriptors()
static LLVM_ABI Pid getProcessId()
Get the process's identifier.
static LLVM_ABI size_t GetMallocUsage()
Return process memory usage.
static LLVM_ABI bool ColorNeedsFlush()
Whether changing colors requires the output to be flushed.
static LLVM_ABI std::optional< std::string > FindInEnvPath(StringRef EnvName, StringRef FileName, ArrayRef< std::string > IgnoreList, char Separator=EnvPathSeparator)
This function searches for an existing file in the list of directories in a PATH like environment var...
static LLVM_ABI void Exit(int RetCode, bool NoCleanup=false)
Equivalent to exit(), except when running inside a CrashRecoveryContext.
static LLVM_ABI const char * ResetColor()
Resets the terminals colors, or returns an escape sequence to do so.
static LLVM_ABI unsigned GetRandomNumber()
Get the result of a process wide random number generator.
static LLVM_ABI bool FileDescriptorIsDisplayed(int fd)
This function determines if the given file descriptor is connected to a "tty" or "console" window.
static LLVM_ABI Expected< unsigned > getPageSize()
Get the process's page size.
static LLVM_ABI const char * OutputColor(char c, bool bold, bool bg)
This function returns the colorcode escape sequences.
static LLVM_ABI const char * OutputBold(bool bg)
Same as OutputColor, but only enables the bold attribute.
static unsigned getPageSizeEstimate()
Get the process's estimated page size.
Definition Process.h:62
static LLVM_ABI unsigned StandardErrColumns()
This function determines the number of columns in the window if standard error is connected to a "tty...
static LLVM_ABI bool AreCoreFilesPrevented()
true if PreventCoreFiles has been called, false otherwise.
static LLVM_ABI std::optional< std::string > GetEnv(StringRef name)
static LLVM_ABI bool FileDescriptorHasColors(int fd)
This function determines if the given file descriptor is displayd and supports colors.
static LLVM_ABI bool StandardInIsUserInput()
This function determines if the standard input is connected directly to a user's input (keyboard prob...
static LLVM_ABI void PreventCoreFiles()
This function makes the necessary calls to the operating system to prevent core files or any other ki...
static LLVM_ABI bool StandardErrHasColors()
This function determines whether the terminal connected to standard error supports colors.
static LLVM_ABI const char * OutputReverse()
This function returns the escape sequence to reverse forground and background colors.
static LLVM_ABI bool StandardErrIsDisplayed()
This function determines if the standard error is connected to a "tty" or "console" window.
static LLVM_ABI bool StandardOutHasColors()
This function determines whether the terminal connected to standard output supports colors.
static LLVM_ABI unsigned StandardOutColumns()
This function determines the number of columns in the window if standard output is connected to a "tt...
static LLVM_ABI bool StandardOutIsDisplayed()
This function determines if the standard output is connected to a "tty" or "console" window.
int32_t Pid
Definition Process.h:46
std::chrono::time_point< std::chrono::system_clock, D > TimePoint
A time point on the system clock.
const char EnvPathSeparator
This is the OS-specific separator for PATH like environment variables:
This is an optimization pass for GlobalISel generic memory operations.
void consumeError(Error Err)
Consume a Error without doing anything.