12#include "llvm/ADT/StringRef.h"
13#include "llvm/Support/Format.h"
14#include "llvm/Support/RandomNumberGenerator.h"
31 return (count - 10) % 6 == 0;
44 llvm::sys::swapByteOrder(debug_info.
Uuid.
Data1);
45 llvm::sys::swapByteOrder(debug_info.
Uuid.
Data2);
46 llvm::sys::swapByteOrder(debug_info.
Uuid.
Data3);
47 llvm::sys::swapByteOrder(debug_info.
Age);
49 *
this =
UUID(&debug_info,
sizeof(debug_info));
56 llvm::raw_string_ostream os(result);
58 for (
auto B : llvm::enumerate(
GetBytes())) {
62 os << llvm::format_hex_no_prefix(
B.value(), 2,
true);
72 if (ch >=
'a' && ch <=
'f')
81 while (p.size() >= 2) {
82 if (isxdigit(p[0]) && isxdigit(p[1])) {
86 uuid_bytes.push_back((hi_nibble << 4) + lo_nibble);
90 }
else if (p.front() ==
'-') {
102 llvm::StringRef p = str;
107 llvm::SmallVector<uint8_t, 20> bytes;
112 if (!rest.empty() || bytes.empty())
120 llvm::SmallVector<uint8_t, 20> bytes(num_bytes);
121 auto ec = llvm::getRandomBytes(bytes.data(), bytes.size());
125 auto seed = std::chrono::steady_clock::now().time_since_epoch().count();
126 std::independent_bits_engine<std::default_random_engine, CHAR_BIT,
129 std::generate(bytes.begin(), bytes.end(), std::ref(engine));
static bool separate(size_t count)
static int xdigit_to_int(char ch)
A stream class that can stream formatted output to a file.
size_t PutCString(llvm::StringRef cstr)
Output a C string to the stream.
bool SetFromStringRef(llvm::StringRef str)
void Dump(Stream &s) const
llvm::ArrayRef< uint8_t > GetBytes() const
static UUID Generate(uint32_t num_bytes=16)
Create a random UUID.
std::string GetAsString(llvm::StringRef separator="-") const
static llvm::StringRef DecodeUUIDBytesFromString(llvm::StringRef str, llvm::SmallVectorImpl< uint8_t > &uuid_bytes)
Decode as many UUID bytes as possible from the C string cstr.
A class that represents a running process on the host machine.
llvm::support::ulittle16_t Data2
llvm::support::ulittle32_t Data1
llvm::support::ulittle16_t Data3
struct lldb_private::UUID::CvRecordPdb70::@031031370151201011001273071037042037235035311007 Uuid
llvm::support::ulittle32_t Age