diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2022-03-20 11:40:34 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2022-05-14 11:43:05 +0000 |
commit | 349cc55c9796c4596a5b9904cd3281af295f878f (patch) | |
tree | 410c5a785075730a35f1272ca6a7adf72222ad03 /contrib/llvm-project/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp | |
parent | cb2ae6163174b90e999326ecec3699ee093a5d43 (diff) | |
parent | c0981da47d5696fe36474fcf86b4ce03ae3ff818 (diff) |
Diffstat (limited to 'contrib/llvm-project/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp')
-rw-r--r-- | contrib/llvm-project/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp | 21 |
1 files changed, 2 insertions, 19 deletions
diff --git a/contrib/llvm-project/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp b/contrib/llvm-project/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp index b95851e380d2..8e18f33af0cb 100644 --- a/contrib/llvm-project/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp +++ b/contrib/llvm-project/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp @@ -79,7 +79,7 @@ CreateFrontendBaseAction(CompilerInstance &CI) { if (Plugin.getName() == CI.getFrontendOpts().ActionName) { std::unique_ptr<PluginASTAction> P(Plugin.instantiate()); if ((P->getActionType() != PluginASTAction::ReplaceAction && - P->getActionType() != PluginASTAction::Cmdline) || + P->getActionType() != PluginASTAction::CmdlineAfterMainAction) || !P->ParseArgs( CI, CI.getFrontendOpts().PluginArgs[std::string(Plugin.getName())])) @@ -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. // |