This is an archive of the discontinued LLVM Phabricator instance.

UUID: Add support for arbitrary-sized module IDs
ClosedPublic

Authored by labath on Jun 27 2018, 5:08 AM.

Details

Summary

The data structure is optimized for the case where the UUID size is <=
20 bytes (standard length emitted by the GNU linkers), but larger sizes
are also possible.

I've modified the string conversion function to support the new sizes as
well. For standard UUIDs it maintains the traditional formatting
(4-2-2-2-6). If a UUID is shorter, we just cut this sequence short, and
for longer UUIDs it will just repeat the last 6-byte block as long as
necessary.

I've also modified ObjectFileELF to take advantage of the new UUIDs and
avoid manually padding the UUID to 16 bytes. While there, I also made
sure the computed UUID does not depend on host endianness.

Event Timeline

labath created this revision.Jun 27 2018, 5:08 AM
clayborg added inline comments.Jun 27 2018, 7:27 AM
source/Interpreter/OptionValueUUID.cpp
80

Probably should have a return value that indicates success or not. What if the user enters "aab". The string must have an event number of hex digits.

labath added inline comments.Jun 28 2018, 7:39 AM
source/Interpreter/OptionValueUUID.cpp
80

The function returns the unparsed portion of the string (so empty string means success), but this code wasn't checking it for some reason.

I've added a check for that.

labath updated this revision to Diff 153321.Jun 28 2018, 7:40 AM

Add a check to the tab-completion function.

clayborg accepted this revision.Jun 28 2018, 9:27 AM
This revision is now accepted and ready to land.Jun 28 2018, 9:27 AM
This revision was automatically updated to reflect the committed changes.