[llvm] [Support][ScopedPrinter] Emit valid JSON in printHex<ulittle16_t> (PR #200071)

Shawn Zhong via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 10 21:01:47 PDT 2026


================
@@ -549,7 +549,7 @@ template <>
 inline void
 ScopedPrinter::printHex<support::ulittle16_t>(StringRef Label,
                                               support::ulittle16_t Value) {
-  startLine() << Label << ": " << hex(Value) << "\n";
+  printHexImpl(Label, hex(static_cast<uint16_t>(Value)));
----------------
ShawnZhong wrote:

After review, I think the specialization is redundant. It was introduced in https://github.com/llvm/llvm-project/commit/72e2ba7abb17a5d509df45451c546b9ac5de743f, and its body is identical to the generic printHex from the beginning. 

https://github.com/llvm/llvm-project/pull/200071


More information about the llvm-commits mailing list