diff options
author | Arthur Eubanks <aeubanks@google.com> | 2021-10-19 14:50:44 -0700 |
---|---|---|
committer | Arthur Eubanks <aeubanks@google.com> | 2021-10-20 08:58:20 -0700 |
commit | fe66433fe119819a033827610f7eae4cdd8b1470 (patch) | |
tree | 6f7e8d80747a576f30d2ae0468722a92a8eef3fe /clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp | |
parent | eabf11f9ea8d647d78e455664658b4faf8880029 (diff) | |
download | llvm-fe66433fe119819a033827610f7eae4cdd8b1470.zip llvm-fe66433fe119819a033827610f7eae4cdd8b1470.tar.gz llvm-fe66433fe119819a033827610f7eae4cdd8b1470.tar.bz2 |
[clang] Add plugin ActionType to run command line plugin before main action
Currently we have a way to run a plugin if specified on the command line
after the main action, and ways to unconditionally run the plugin before
or after the main action, but no way to run a plugin if specified on the
command line before the main action.
This introduces the missing option.
This is helpful because -clear-ast-before-backend clears the AST before
codegen, while some plugins may want access to the AST.
Reviewed By: dblaikie
Differential Revision: https://reviews.llvm.org/D112096
Diffstat (limited to 'clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp')
-rw-r--r-- | clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp b/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp index dc8409f..8e18f33 100644 --- a/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp +++ b/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())])) |