This is an archive of the discontinued LLVM Phabricator instance.

AsmParser: Extend the API to make the mappings from the numbers in the source to unnamed global values accessible to the library users.
ClosedPublic

Authored by arphaman on Jun 18 2015, 2:59 PM.

Details

Summary

This patch creates a new SlotMapping struct in the AsmParser library which can be passed into the publicly accessible parsing functions in order to extract the data structures that map from numbers to global values and metadata nodes.

This patch would be useful for MIR serialization, as it would allow the MIR parser to lookup global values by their number and metadata nodes by their number.

Diff Detail

Repository
rL LLVM

Event Timeline

arphaman updated this revision to Diff 27965.Jun 18 2015, 2:59 PM
arphaman retitled this revision from to AsmParser: Extend the API to make the mappings from the numbers in the source to unnamed global values accessible to the library users..
arphaman updated this object.
arphaman edited the test plan for this revision. (Show Details)
arphaman added reviewers: dexonsmith, bob.wilson, bogner.
arphaman set the repository for this revision to rL LLVM.
arphaman added a subscriber: Unknown Object (MLST).
arphaman updated this revision to Diff 28177.Jun 22 2015, 5:07 PM

Update the patch with Duncan's fixes.

I also decided to use std::move to move the mappings from LLParser to SlotMapping as the SlotMapping class is initialized after parsing and validation, and thus there's no need to copy the mappings.

This revision was automatically updated to reflect the committed changes.