aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp
diff options
context:
space:
mode:
authorArthur Eubanks <aeubanks@google.com>2021-10-19 14:50:44 -0700
committerArthur Eubanks <aeubanks@google.com>2021-10-20 08:58:20 -0700
commitfe66433fe119819a033827610f7eae4cdd8b1470 (patch)
tree6f7e8d80747a576f30d2ae0468722a92a8eef3fe /clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp
parenteabf11f9ea8d647d78e455664658b4faf8880029 (diff)
downloadllvm-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.cpp2
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())]))