[PATCH] D90930: [lib/Support/YAMLTraits] - Don't print leading zeroes when dumping Hex8/Hex16/Hex32 types.

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 6 05:51:34 PST 2020


jhenderson added a comment.

I think it would be a good idea to get llvm-xray and dsymutil developers to give their opinion on this change. From the obj2yaml side of things, it looks fine to me, but the use-cases are different for the other tools.



================
Comment at: llvm/lib/Support/YAMLTraits.cpp:1049
 void ScalarTraits<Hex8>::output(const Hex8 &Val, void *, raw_ostream &Out) {
-  uint8_t Num = Val;
-  Out << format("0x%02X", Num);
+  Out << format("0x%X", (uint8_t)Val);
 }
----------------
I'm assuming these formats are printf format strings, in which case you should be using the PRIX8/PRIX16/PRIX32/PRIX64 macros, I think.


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

https://reviews.llvm.org/D90930



More information about the llvm-commits mailing list