[lld] [llvm] [llvm-readobj][COFF] Consistent PDBGUID Formatting (PR #94256)

Reid Kleckner via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 4 07:20:01 PDT 2024


================
@@ -793,7 +794,10 @@ void COFFDumper::printCOFFDebugDirectory() {
       DictScope PDBScope(W, "PDBInfo");
       W.printHex("PDBSignature", DebugInfo->Signature.CVSignature);
       if (DebugInfo->Signature.CVSignature == OMF::Signature::PDB70) {
-        W.printBinary("PDBGUID", ArrayRef(DebugInfo->PDB70.Signature));
+        SmallString<38> FormattedGUIDStr;
+        raw_svector_ostream OS(FormattedGUIDStr);
----------------
rnk wrote:

I see. I think I'm not really worried about temp strings and buffering, and more trying to code golf this to something compact. Maybe the best form is:
```
  W.printString("PDBGUID", formatv("{0}", fmt_guid(...)));
```

Does that work?

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


More information about the llvm-commits mailing list