1 #include "llvm/Support/ScopedPrinter.h"
3 #include "llvm/Support/Format.h"
6 using namespace llvm::support;
10 raw_ostream &operator<<(raw_ostream &OS, const HexNumber &Value) {
11 OS << "0x" << to_hexString(Value.Value);
15 const std::string to_hexString(uint64_t Value, bool UpperCase) {
17 llvm::raw_string_ostream stream(number);
18 stream << format_hex_no_prefix(Value, 1, UpperCase);
22 void ScopedPrinter::printBinaryImpl(StringRef Label, StringRef Str,
23 ArrayRef<uint8_t> Data, bool Block,
24 uint32_t StartOffset) {
34 OS << format_bytes_with_ascii(Data, StartOffset, 16, 4,
35 (IndentLevel + 1) * 2, true)
39 startLine() << Label << ":";
42 OS << " (" << format_bytes(Data, None, Data.size(), 1, 0, true) << ")\n";