diff options
author | Vassil Vassilev <v.g.vassilev@gmail.com> | 2021-09-25 17:30:49 +0000 |
---|---|---|
committer | Vassil Vassilev <v.g.vassilev@gmail.com> | 2021-10-05 05:20:30 +0000 |
commit | 81fb640f83b6a5d099f9124739ab3049be79ea56 (patch) | |
tree | 9e830839e801eb10d7c6422bfd14a26f677aa69e /clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp | |
parent | 65c284a7be0311f62873be9eecdff120de12e094 (diff) | |
download | llvm-81fb640f83b6a5d099f9124739ab3049be79ea56.zip llvm-81fb640f83b6a5d099f9124739ab3049be79ea56.tar.gz llvm-81fb640f83b6a5d099f9124739ab3049be79ea56.tar.bz2 |
[clang-repl] Allow loading of plugins in clang-repl.
Differential revision: https://reviews.llvm.org/D110484
Diffstat (limited to 'clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp')
-rw-r--r-- | clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp | 19 |
1 files changed, 1 insertions, 18 deletions
diff --git a/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp b/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp index b95851e..dc8409f 100644 --- a/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp +++ b/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp @@ -203,24 +203,7 @@ bool ExecuteCompilerInvocation(CompilerInstance *Clang) { return true; } - // Load any requested plugins. - for (const std::string &Path : Clang->getFrontendOpts().Plugins) { - std::string Error; - if (llvm::sys::DynamicLibrary::LoadLibraryPermanently(Path.c_str(), &Error)) - Clang->getDiagnostics().Report(diag::err_fe_unable_to_load_plugin) - << Path << Error; - } - - // Check if any of the loaded plugins replaces the main AST action - for (const FrontendPluginRegistry::entry &Plugin : - FrontendPluginRegistry::entries()) { - std::unique_ptr<PluginASTAction> P(Plugin.instantiate()); - if (P->getActionType() == PluginASTAction::ReplaceAction) { - Clang->getFrontendOpts().ProgramAction = clang::frontend::PluginAction; - Clang->getFrontendOpts().ActionName = Plugin.getName().str(); - break; - } - } + Clang->LoadRequestedPlugins(); // Honor -mllvm. // |