There are sure to be many places where a buffer of bytes need to be dumped in LLVM. This change allows users to quickly dump a buffer of bytes with optional offset prefix and ASCII display:
Example output for raw hex bytes:
55 48 89 e5 48 81 ec 70 04 00 00 48 8d 05 10 02
00 00 4c 8d 05 fd 01 00 00 4c 8b 0d d0 02 00 00
Example output for raw hex bytes with ASCII:
55 48 89 e5 48 81 ec 70 04 00 00 48 8d 05 10 02 UH.?H.?p...H....
00 00 4c 8d 05 fd 01 00 00 4c 8b 0d d0 02 00 00 ..L..?...L..?...
Example output for raw hex bytes with ASCII and offsets/addresses:
0x100000d10: 55 48 89 e5 48 81 ec 70 04 00 00 48 8d 05 10 02 UH.?H.?p...H....
0x100000d20: 00 00 4c 8d 05 fd 01 00 00 4c 8b 0d d0 02 00 00 ..L..?...L..?...
Added unit tests as well.
This wasn't clear to me until I read the code in raw_ostream that this is the "starting offset" for the offset to print in the margin. I thought it was about indention.