Skip to content

[Macros] PluginRegistry vends 'LoadedLibraryPlugin' instead of 'void *' #64845

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

Merged
merged 3 commits into from
Apr 12, 2023

Conversation

rintaro
Copy link
Member

@rintaro rintaro commented Apr 2, 2023

LoadedLibraryPlugin is currently just a wrapper of void pointer from dlopen. This will be convenient for abstracting platform specific dynamic library handling.

Also update LoadedCompierPlugin making it a llvm::PointerUnion

@rintaro
Copy link
Member Author

rintaro commented Apr 2, 2023

@swift-ci Please smoke test

@@ -367,33 +364,28 @@ loadExecutablePluginByName(ASTContext &ctx, Identifier moduleName) {
LoadedCompilerPlugin
CompilerPluginLoadRequest::evaluate(Evaluator &evaluator, ASTContext *ctx,
Identifier moduleName) const {
auto fs = ctx->SourceMgr.getFileSystem();
auto &searchPathOpts = ctx->SearchPathOpts;
auto *registry = ctx->getPluginRegistry();
Copy link
Member Author

@rintaro rintaro Apr 2, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated changes but these variables weren't used. I should have removed these in d8c8574

@rintaro rintaro requested review from bnbarham and removed request for xedin, slavapestov and hborla April 2, 2023 05:20
@rintaro rintaro force-pushed the macros-loadedlibraryplugin branch 2 times, most recently from 990d527 to 70d2964 Compare April 2, 2023 06:21
@rintaro
Copy link
Member Author

rintaro commented Apr 2, 2023

@swift-ci Please smoke test

@rintaro rintaro force-pushed the macros-loadedlibraryplugin branch from 70d2964 to 8b9895a Compare April 3, 2023 04:18
@rintaro
Copy link
Member Author

rintaro commented Apr 3, 2023

@swift-ci Please smoke test

LoadedPluginLibraries.insert({path, lib});
return lib;

storage = std::unique_ptr<LoadedLibraryPlugin>(new LoadedLibraryPlugin(lib));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can use make_unique here FWIW. But if there's no other changes I'm fine with getting this in so you don't have to re-run tests.

rintaro added 3 commits April 11, 2023 14:59
`LoadedLibraryPlugin` is currently just a wrapper of `void` pointer from
`dlopen`. This will be convenient for abstracting platform specific
dynamic linrary handling.
@rintaro rintaro force-pushed the macros-loadedlibraryplugin branch from 8b9895a to 90e1558 Compare April 11, 2023 22:02
@rintaro
Copy link
Member Author

rintaro commented Apr 11, 2023

@swift-ci Please smoke test

@rintaro rintaro merged commit 347e565 into swiftlang:main Apr 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants