[PATCH] Teach llvm::format_hex() to support formatting without a prefix '0x'

Reid Kleckner rnk at google.com
Fri Jan 23 13:38:23 PST 2015


================
Comment at: include/llvm/Support/Format.h:278-279
@@ -275,1 +277,4 @@
+///   OS << format_hex(255, 2, true, false) => FF
+inline FormattedNumber format_hex(uint64_t N, unsigned Width,
+                                  bool Upper = false, bool HexPrefix = true) {
   assert(Width <= 18 && "hex width must be <= 18");
----------------
I'd rather have a special purpose helper than a second default value bool. format_hex_noprefix? format_noprefix_hex? format_hex_bytes?

http://reviews.llvm.org/D7151

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list