diff options
author | Andrew Lenharth <andrewl@lenharth.org> | 2006-01-26 18:37:21 +0000 |
---|---|---|
committer | Andrew Lenharth <andrewl@lenharth.org> | 2006-01-26 18:37:21 +0000 |
commit | 67e0189faa07765f8fd754edd781270c916bad07 (patch) | |
tree | 107094d4132484fa89b216e9df717cc199e0f3aa /llvm/tools/bugpoint/OptimizerDriver.cpp | |
parent | bb4c9c0bd712666ba0a8f80522851c35d1913c29 (diff) | |
download | bcm5719-llvm-67e0189faa07765f8fd754edd781270c916bad07.tar.gz bcm5719-llvm-67e0189faa07765f8fd754edd781270c916bad07.zip |
Pass plugins on to children when optimizing.
llvm-svn: 25650
Diffstat (limited to 'llvm/tools/bugpoint/OptimizerDriver.cpp')
-rw-r--r-- | llvm/tools/bugpoint/OptimizerDriver.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/llvm/tools/bugpoint/OptimizerDriver.cpp b/llvm/tools/bugpoint/OptimizerDriver.cpp index bad68d1f0a8..7cfc4fb4994 100644 --- a/llvm/tools/bugpoint/OptimizerDriver.cpp +++ b/llvm/tools/bugpoint/OptimizerDriver.cpp @@ -30,6 +30,10 @@ #include "llvm/System/Path.h" #include "llvm/System/Program.h" #include "llvm/Config/alloca.h" + +#define DONT_GET_PLUGIN_LOADER_OPTION +#include "llvm/Support/PluginLoader.h" + #include <fstream> using namespace llvm; @@ -149,13 +153,18 @@ bool BugDriver::runPasses(const std::vector<const PassInfo*> &Passes, // setup the child process' arguments const char** args = (const char**) - alloca(sizeof(const char*)*(Passes.size()+10)); + alloca(sizeof(const char*) * + (Passes.size()+10+2*PluginLoader::getNumPlugins())); int n = 0; args[n++] = ToolName.c_str(); args[n++] = "-as-child"; args[n++] = "-child-output"; args[n++] = OutputFilename.c_str(); std::vector<std::string> pass_args; + for (unsigned i = 0, e = PluginLoader::getNumPlugins(); i != e; ++i) { + pass_args.push_back( std::string("-load")); + pass_args.push_back( PluginLoader::getPlugin(i)); + } for (std::vector<const PassInfo*>::const_iterator I = Passes.begin(), E = Passes.end(); I != E; ++I ) pass_args.push_back( std::string("-") + (*I)->getPassArgument() ); |