aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2010-06-16 16:59:23 +0000
committerDaniel Dunbar <daniel@zuster.org>2010-06-16 16:59:23 +0000
commit3177aae51a21f61ab483c52f97124bdb707da7f1 (patch)
treec0dcd4ec9cd85fe30d7f3f2a55386f8aa0a4686d /tools
parent7ccecb72cb8e0a77139526bd090cf8c68ba178cd (diff)
Frontend: Allow passing -cc1 level arguments to plugins. Patch by Troy Straszheim!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106113 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rw-r--r--tools/driver/cc1_main.cpp16
1 files changed, 5 insertions, 11 deletions
diff --git a/tools/driver/cc1_main.cpp b/tools/driver/cc1_main.cpp
index c4c1bd9e8b..841e40abfc 100644
--- a/tools/driver/cc1_main.cpp
+++ b/tools/driver/cc1_main.cpp
@@ -85,21 +85,15 @@ static FrontendAction *CreateFrontendBaseAction(CompilerInstance &CI) {
case ParseSyntaxOnly: return new SyntaxOnlyAction();
case PluginAction: {
- if (CI.getFrontendOpts().ActionName == "help") {
- llvm::errs() << "clang -cc1 plugins:\n";
- for (FrontendPluginRegistry::iterator it =
- FrontendPluginRegistry::begin(),
- ie = FrontendPluginRegistry::end();
- it != ie; ++it)
- llvm::errs() << " " << it->getName() << " - " << it->getDesc() << "\n";
- return 0;
- }
for (FrontendPluginRegistry::iterator it =
FrontendPluginRegistry::begin(), ie = FrontendPluginRegistry::end();
it != ie; ++it) {
- if (it->getName() == CI.getFrontendOpts().ActionName)
- return it->instantiate();
+ if (it->getName() == CI.getFrontendOpts().ActionName) {
+ PluginASTAction* plugin = it->instantiate();
+ plugin->ParseArgs(CI.getFrontendOpts().PluginArgs);
+ return plugin;
+ }
}
CI.getDiagnostics().Report(diag::err_fe_invalid_plugin_name)