This is an archive of the discontinued LLVM Phabricator instance.

[Binary] Add iterator to the OffloadBinary string maps
ClosedPublic

Authored by jhuber6 on Jun 14 2022, 12:39 PM.

Details

Summary

The offload binary contains internally a string map of all the key and
value pairs identified in the binary itself. Normally users query these
values from the getString function, but this makes it difficult to
identify which strings are availible. This patch adds a simple const
iterator range to the offload binary allowing users to iterate through
the strings.

Diff Detail

Event Timeline

jhuber6 created this revision.Jun 14 2022, 12:39 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 14 2022, 12:39 PM
jhuber6 requested review of this revision.Jun 14 2022, 12:39 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 14 2022, 12:39 PM
tra added inline comments.Jun 14 2022, 1:45 PM
llvm/include/llvm/Object/OffloadBinary.h
62–63

Should these be public?

65–66

Do we need these? They are not public and are used in just one place where we could just use StringData.begin()/end() directly.

jhuber6 updated this revision to Diff 436914.Jun 14 2022, 1:48 PM

addressing comments.

tra accepted this revision.Jun 14 2022, 1:58 PM
This revision is now accepted and ready to land.Jun 14 2022, 1:58 PM
This revision was landed with ongoing or failed builds.Jun 15 2022, 9:24 AM
This revision was automatically updated to reflect the committed changes.