This is an archive of the discontinued LLVM Phabricator instance.

[codeview] Fix YAML for LF_TYPESERVER2 by hoisting PDB_UniqueId
ClosedPublic

Authored by rnk on Jul 17 2017, 10:44 AM.

Details

Summary

We were treating the GUIDs in TypeServer2Record as strings, and the
non-ASCII bytes in the GUID would not round-trip through YAML.

We already had the PDB_UniqueId type portably represent a Windows GUID,
but we need to hoist that up to the DebugInfo/CodeView library so that
we can use it in the TypeServer2Record as well as in PDB parsing code.

Event Timeline

rnk created this revision.Jul 17 2017, 10:44 AM
rnk updated this revision to Diff 106934.Jul 17 2017, 1:39 PM
  • rebase on type server removal
ruiu added a subscriber: ruiu.Jul 17 2017, 3:37 PM
ruiu added inline comments.
lld/COFF/PDB.cpp
518

Is WindowsGuid an appropriate name for this data strucutre? This is just a GUID and not really an Windows-variant.

rnk added inline comments.Jul 17 2017, 4:40 PM
lld/COFF/PDB.cpp
518

This was an attempt to distinguish it from llvm::GlobalValue::GUID, which is a 64-bit integer, but sure, we can call it GUID.

rnk updated this revision to Diff 106978.Jul 17 2017, 4:43 PM
  • Rename WindowsGuid to GUID
ruiu added a comment.Jul 17 2017, 4:45 PM

How about UUID, which seems to be used as a synonym to GUID? (https://en.wikipedia.org/wiki/Universally_unique_identifier)

rnk added a comment.Jul 17 2017, 4:48 PM
In D35495#812153, @ruiu wrote:

How about UUID, which seems to be used as a synonym to GUID? (https://en.wikipedia.org/wiki/Universally_unique_identifier)

I think I prefer GUID to better match windows.h.

ruiu accepted this revision.Jul 17 2017, 4:52 PM

LGTM

llvm/lib/ObjectYAML/CodeViewYAMLTypes.cpp
163–166

nit: you can use post-++ here

This revision is now accepted and ready to land.Jul 17 2017, 4:52 PM
This revision was automatically updated to reflect the committed changes.