New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Duplicate JITDylib in the Search Order #41282
Comments
|
For now the JITDylib names are only used for debugging output (I don't have any plans to use them for anything else yet, either), but I think it would be reasonable to add this restriction. It would be an API contract though, so this should be verified by an assertion, rather than returning a runtime error. I would be inclined to add another method to ExecutionSession: /// Returns the JITDylib with the given name, or nullptr if no such dylib exists. For now that could be implemented as a linear search through the JITDylibs list. Then createJITDylib could be written as: JITDylib &createJITDylib(StringRef Name) { |
Good point. I agree that the API may enforce unique dylib names and it should be checked with assertions. In case of createJITDylib(), though, the name must be considered user input (see lli's -jd param as an example). We may deduplicate here, so that subsequent code can relay on uniqueness (and use assertions). |
Good point. I think the answer is to document the contract and adds checks to lli. I have done this in r361322. Praveen -- if you're happy with the fix please mark this as RESOLVED/FIXED. :) |
Closing note: |
Extended Description
Currently, ORC allows to have a same name for multiple JITDylibs. Well, this can be confusing for clients creating JITDylibs and populating code in it. For a single ExecutionSession instance we should have JITDylib names. Possible solution is have a check in ExecutionSession::createJITDylib method, and return a Expected<JITDylib&>.
Is multiple JITDylibs with same names serve a purpose? Is it a bug or feature?
Thanks
The text was updated successfully, but these errors were encountered: