From 9f0c21c1e0e3bc9fc3b8a1f785db8440146a891c Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Sat, 5 Jan 2019 01:10:20 +0000 Subject: Move -add-plugin validation after -load was executed. Moves the code added in r350340 around a bit, to hopefully make the existing plugin tests pass when clang is built with examples enabled. llvm-svn: 350451 --- clang/lib/Frontend/CompilerInvocation.cpp | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) (limited to 'clang/lib/Frontend/CompilerInvocation.cpp') diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index 00083bd..04105f0 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -1666,20 +1666,7 @@ static InputKind ParseFrontendArgs(FrontendOptions &Opts, ArgList &Args, Opts.ProgramAction = frontend::PluginAction; Opts.ActionName = A->getValue(); } - for (const std::string &Arg : Args.getAllArgValues(OPT_add_plugin)) { - bool Found = false; - for (FrontendPluginRegistry::iterator it = FrontendPluginRegistry::begin(), - ie = FrontendPluginRegistry::end(); - it != ie; ++it) { - if (it->getName() == Arg) - Found = true; - } - if (!Found) { - Diags.Report(diag::err_fe_invalid_plugin_name) << Arg; - continue; - } - Opts.AddPluginActions.push_back(Arg); - } + Opts.AddPluginActions = Args.getAllArgValues(OPT_add_plugin); for (const auto *AA : Args.filtered(OPT_plugin_arg)) Opts.PluginArgs[AA->getValue(0)].emplace_back(AA->getValue(1)); -- cgit v1.1