[PATCH] D35284: Support: Add llvm::format_memory to convert number of bytes to human readable string.

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 11 18:00:21 PDT 2017


ruiu added a comment.

You can use SI prefixes (i.e. K/M/G/T/etc.) with other units than M, so combining the two and call it FormattedMemory doesn't sound like a good idea. In addition to that, SI prefixes are not correct as they represents powers of 10 instead of powers of 2.

How about adding FormattedBinaryPrefix class which prints out Ki/Mi/Gi/...  for 2^10/2^20/2^30/.... ? For Ki/Mi/Gi, see https://en.wikipedia.org/wiki/Binary_prefix.


https://reviews.llvm.org/D35284





More information about the llvm-commits mailing list