[Lldb-commits] [PATCH] D71052: [lldb][NFC] Move Address and AddressRange functions out of Stream and let them take raw_ostream

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Dec 5 04:02:04 PST 2019


labath accepted this revision.
labath added a comment.
This revision is now accepted and ready to land.

Let's ship it.



================
Comment at: lldb/source/Utility/Stream.cpp:88
+  std::string f = "{0}0x{2,0+" + size + ":x-}{3}";
+  s << llvm::formatv(f.c_str(), prefix, addr_size * 2, addr, suffix);
 }
----------------
The "formatv" way of doing this would be via something like `formatv("{0}0x{1:x}{2}", prefix, fmt_align(addr, AlignStyle::Right, addr_size*2, '0'), suffix)`, but that's quite a mouthful so I'd probably go for just `s << prefix << format_hex(addr, 2+2*addr_size) << suffix;`


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D71052/new/

https://reviews.llvm.org/D71052





More information about the lldb-commits mailing list