diff options
author | Adrian Prantl <aprantl@apple.com> | 2017-09-13 18:22:59 +0000 |
---|---|---|
committer | Adrian Prantl <aprantl@apple.com> | 2017-09-13 18:22:59 +0000 |
commit | 3dcd122151ee58afc5f7f262c890bbfdbf47b08c (patch) | |
tree | e9bed3a2f0d8cf0b688c8f6a553cab03601181b5 /llvm/lib/Support | |
parent | fb1baef1c0f28a2ad9071843e2b620e2ee30aaf6 (diff) | |
download | bcm5719-llvm-3dcd122151ee58afc5f7f262c890bbfdbf47b08c.tar.gz bcm5719-llvm-3dcd122151ee58afc5f7f262c890bbfdbf47b08c.zip |
llvm-dwarfdump: support dumping UUIDs of Mach-O binaries.
This is a feature supported by Darwin dwarfdump. UUIDs are used to
associate executables with their .dSYM bundles.
llvm-svn: 313165
Diffstat (limited to 'llvm/lib/Support')
-rw-r--r-- | llvm/lib/Support/raw_ostream.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/lib/Support/raw_ostream.cpp b/llvm/lib/Support/raw_ostream.cpp index 6a0f08690e7..c66457ca066 100644 --- a/llvm/lib/Support/raw_ostream.cpp +++ b/llvm/lib/Support/raw_ostream.cpp @@ -139,6 +139,16 @@ raw_ostream &raw_ostream::write_hex(unsigned long long N) { return *this; } +raw_ostream &raw_ostream::write_uuid(const uuid_t UUID) { + for (int Idx = 0; Idx < 16; ++Idx) { + *this << format("%02" PRIX32, UUID[Idx]); + if (Idx == 3 || Idx == 5 || Idx == 7 || Idx == 9) + *this << "-"; + } + return *this; +} + + raw_ostream &raw_ostream::write_escaped(StringRef Str, bool UseHexEscapes) { for (unsigned char c : Str) { |