23 #ifndef LLVM_SUPPORT_FORMAT_H
24 #define LLVM_SUPPORT_FORMAT_H
29 #include "llvm/Support/DataTypes.h"
46 virtual int snprint(
char *Buffer,
unsigned BufferSize)
const = 0;
54 unsigned print(
char *Buffer,
unsigned BufferSize)
const {
55 assert(BufferSize &&
"Invalid buffer size!");
62 return BufferSize * 2;
66 if (
unsigned(N) >= BufferSize)
81 template <
typename Arg,
typename...
Args>
83 static_assert(std::is_scalar<Arg>::value,
84 "format can't be used with non fundamental / non pointer type");
89 template <
typename... Ts>
91 std::tuple<Ts...> Vals;
93 template <std::size_t... Is>
94 int snprint_tuple(
char *Buffer,
unsigned BufferSize,
97 return _snprintf(Buffer, BufferSize,
Fmt, std::get<Is>(Vals)...);
99 return snprintf(Buffer, BufferSize,
Fmt, std::get<Is>(Vals)...);
109 int snprint(
char *Buffer,
unsigned BufferSize)
const override {
123 template <
typename... Ts>
133 : Str(S), Width(W), Justify(J) {}
176 : HexValue(HV), DecValue(DV), Width(W), Hex(H), Upper(U),
187 bool Upper =
false) {
188 assert(Width <= 18 &&
"hex width must be <= 18");
200 bool Upper =
false) {
201 assert(Width <= 16 &&
"hex width must be <= 16");
222 uint8_t ByteGroupSize;
229 uint32_t NPL, uint8_t BGS,
bool U,
bool A)
230 : Bytes(B), FirstByteOffset(O), IndentLevel(IL), NumPerLine(NPL),
231 ByteGroupSize(BGS), Upper(U),
ASCII(A) {
233 if (ByteGroupSize > NumPerLine)
234 ByteGroupSize = NumPerLine;
238 inline FormattedBytes
240 uint32_t NumPerLine = 16, uint8_t ByteGroupSize = 4,
241 uint32_t IndentLevel = 0,
bool Upper =
false) {
242 return FormattedBytes(Bytes, IndentLevel, FirstByteOffset, NumPerLine,
243 ByteGroupSize,
Upper,
false);
246 inline FormattedBytes
249 uint32_t NumPerLine = 16, uint8_t ByteGroupSize = 4,
250 uint32_t IndentLevel = 0,
bool Upper =
false) {
251 return FormattedBytes(Bytes, IndentLevel, FirstByteOffset, NumPerLine,
252 ByteGroupSize,
Upper,
true);
FormattedString left_justify(StringRef Str, unsigned Width)
left_justify - append spaces after string so total output is Width characters.
FormattedNumber format_hex(uint64_t N, unsigned Width, bool Upper=false)
format_hex - Output N as a fixed width hexadecimal.
FormattedBytes format_bytes_with_ascii(ArrayRef< uint8_t > Bytes, Optional< uint64_t > FirstByteOffset=None, uint32_t NumPerLine=16, uint8_t ByteGroupSize=4, uint32_t IndentLevel=0, bool Upper=false)
FormattedBytes format_bytes(ArrayRef< uint8_t > Bytes, Optional< uint64_t > FirstByteOffset=None, uint32_t NumPerLine=16, uint8_t ByteGroupSize=4, uint32_t IndentLevel=0, bool Upper=false)
FormattedString center_justify(StringRef Str, unsigned Width)
center_justify - add spaces before and after string so total output is Width characters.
Alias for the common case of a sequence of size_ts.
FormattedString right_justify(StringRef Str, unsigned Width)
right_justify - add spaces before string so total output is Width characters.
format_object< Ts...> format(const char *Fmt, const Ts &...Vals)
These are helper functions used to produce formatted output.
constexpr char Args[]
Key for Kernel::Metadata::mArgs.
Maximum length of the test input libFuzzer tries to guess a good value based on the corpus and reports it always prefer smaller inputs during the corpus shuffle When libFuzzer itself reports a bug this exit code will be used If indicates the maximal total time in seconds to run the fuzzer minimizes the provided crash input Use with tries to cleanse the provided crash input to make it contain fewer original bytes Use with exact_artifact_path to specify the output Experimental Use value profile to guide fuzzing Number of jobs to run If Reload the main corpus every< N > seconds to get new units discovered by other processes disabled generate only ASCII(isprint+isspace) inputs.") FUZZER_FLAG_STRING(artifact_prefix
Creates a compile-time integer sequence for a parameter pack.
FormattedNumber format_decimal(int64_t N, unsigned Width)
format_decimal - Output N as a right justified, fixed-width decimal.
FormattedNumber format_hex_no_prefix(uint64_t N, unsigned Width, bool Upper=false)
format_hex_no_prefix - Output N as a fixed width hexadecimal.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
This class implements an extremely fast bulk output stream that can only output to a stream...
StringRef - Represent a constant reference to a string, i.e.