This is an archive of the discontinued LLVM Phabricator instance.

Ensuring unique names for JITDylib's
ClosedPublic

Authored by pree-jackie on May 20 2019, 6:41 AM.

Details

Summary

Asserting the multiple JITDylib's with same name are not added to the Execution Session. Adding a method to get pointers to JITDylibs in ExecutionSession.
Fixes PR41937

Diff Detail

Event Timeline

pree-jackie created this revision.May 20 2019, 6:41 AM
pree-jackie edited the summary of this revision. (Show Details)May 20 2019, 6:48 AM

Wrapping the getJITDylibByName by runSessionLocked Interface to make thread safe creation of JITDylibs

pree-jackie added a comment.EditedMay 20 2019, 8:28 AM

I have squashed two commits into one. Whether I have to send the squashed diff?

Yeah -- this seems to be missing the header side of the patch. You should be able to use the "update diff" option to create a new diff (still attached to this revision) with both sides of the change.

Updated Diff file

lhames accepted this revision.May 20 2019, 6:58 PM

Looks good to me.

This revision is now accepted and ready to land.May 20 2019, 6:58 PM

Oh -- I missed that this was passing the name as a std::string by value. This will result in unnecessary string copies. In general for a case like this you would use an llvm::StringRef -- It's a lightweight string reference type. I'll switch to that before committing.

This revision was automatically updated to reflect the committed changes.

Thanks :)
Then we can change parameter type of createJITDylib to StringRef instead of std::string.