This is an archive of the discontinued LLVM Phabricator instance.

[IRReader] Expose getLazyIRModule
ClosedPublic

Authored by scott.linder on Jan 2 2019, 9:14 AM.

Details

Summary

Currently there is no way to lazy-load an in-memory IR module without first writing it to disk. This patch just exposes the existing implementation of getLazyIRModule.

This is effectively a revert of rL212364; I don't have all of the context for the original change, but I don't see why this function can't be exposed now, especially with the stronger type signature it currently has.

Diff Detail

Repository
rL LLVM

Event Timeline

scott.linder created this revision.Jan 2 2019, 9:14 AM

Rebase and ping

I'm not sure if this is intentionally kept private but this looks harmless to me. Would be good to get an okay from someone more familiar with the interfaces.

tejohnson accepted this revision.Feb 11 2019, 10:37 AM

The original change predates my involvement with LLVM, but it sounds like the only reason was just cleanup since it wasn't used elsewhere. I don't see any issue with adding this interface (similar to how we have exposed both parseIR and parseIRFile).

LGTM with a request below.

include/llvm/IRReader/IRReader.h
35 ↗(On Diff #182364)

Please add a comment that this takes ownership of the Buffer. That is one important change since the original modification that made this static.

This revision is now accepted and ready to land.Feb 11 2019, 10:37 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptFeb 11 2019, 2:01 PM