diff options
author | Nick Lewycky <nicholas@mxc.ca> | 2007-11-14 06:47:06 +0000 |
---|---|---|
committer | Nick Lewycky <nicholas@mxc.ca> | 2007-11-14 06:47:06 +0000 |
commit | 43e736db4de7378b461f6602c58fa5127dacb81b (patch) | |
tree | ef75560e2e1562553eae17c28b034bd7b3e64f4d /tools/bugpoint/OptimizerDriver.cpp | |
parent | 6d79e88da922791ae36b92259f4d9d90cac8578f (diff) | |
download | external_llvm-43e736db4de7378b461f6602c58fa5127dacb81b.zip external_llvm-43e736db4de7378b461f6602c58fa5127dacb81b.tar.gz external_llvm-43e736db4de7378b461f6602c58fa5127dacb81b.tar.bz2 |
Allow the block extractor take to take a list of basic blocks to not extract
from a file containing Function/BasicBlock pairings. This is not safe against
anonymous or abnormally-named Funcs or BBs.
Make bugpoint use this interface to pass the BBs list to the child bugpoint.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44101 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/bugpoint/OptimizerDriver.cpp')
-rw-r--r-- | tools/bugpoint/OptimizerDriver.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/tools/bugpoint/OptimizerDriver.cpp b/tools/bugpoint/OptimizerDriver.cpp index a3ce42e..9a0725a 100644 --- a/tools/bugpoint/OptimizerDriver.cpp +++ b/tools/bugpoint/OptimizerDriver.cpp @@ -124,7 +124,8 @@ int BugDriver::runPassesAsChild(const std::vector<const PassInfo*> &Passes) { /// bool BugDriver::runPasses(const std::vector<const PassInfo*> &Passes, std::string &OutputFilename, bool DeleteOutput, - bool Quiet) const { + bool Quiet, unsigned NumExtraArgs, + const char * const *ExtraArgs) const { // setup the output file name cout << std::flush; sys::Path uniqueFilename("bugpoint-output.bc"); @@ -156,7 +157,7 @@ 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()+13+2*PluginLoader::getNumPlugins())); + (Passes.size()+13+2*PluginLoader::getNumPlugins()+NumExtraArgs)); int n = 0; sys::Path tool = sys::Program::FindProgramByName(ToolName); if (UseValgrind) { @@ -182,6 +183,8 @@ bool BugDriver::runPasses(const std::vector<const PassInfo*> &Passes, E = pass_args.end(); I != E; ++I ) args[n++] = I->c_str(); args[n++] = inputFilename.c_str(); + for (unsigned i = 0; i < NumExtraArgs; ++i) + args[n++] = *ExtraArgs; args[n++] = 0; sys::Path prog; @@ -225,10 +228,12 @@ bool BugDriver::runPasses(const std::vector<const PassInfo*> &Passes, /// failure. Module *BugDriver::runPassesOn(Module *M, const std::vector<const PassInfo*> &Passes, - bool AutoDebugCrashes) { + bool AutoDebugCrashes, unsigned NumExtraArgs, + const char * const *ExtraArgs) { Module *OldProgram = swapProgramIn(M); std::string BitcodeResult; - if (runPasses(Passes, BitcodeResult, false/*delete*/, true/*quiet*/)) { + if (runPasses(Passes, BitcodeResult, false/*delete*/, true/*quiet*/, + NumExtraArgs, ExtraArgs)) { if (AutoDebugCrashes) { cerr << " Error running this sequence of passes" << " on the input program!\n"; |