- cout << "\n*** You can reproduce the problem with: ";
- cout << "opt " << Filename << " ";
- cout << getPassesString(PassesToRun) << "\n";
-}
-
-int BugDriver::runPassesAsChild(const std::vector<const PassInfo*> &Passes) {
-
- std::ios::openmode io_mode = std::ios::out | std::ios::trunc |
- std::ios::binary;
- std::ofstream OutFile(ChildOutput.c_str(), io_mode);
- if (!OutFile.good()) {
- cerr << "Error opening bytecode file: " << ChildOutput << "\n";
- return 1;
- }
-
- PassManager PM;
- // Make sure that the appropriate target data is always used...
- PM.add(new TargetData(Program));
-
- for (unsigned i = 0, e = Passes.size(); i != e; ++i) {
- if (Passes[i]->getNormalCtor())
- PM.add(Passes[i]->getNormalCtor()());
- else
- cerr << "Cannot create pass yet: " << Passes[i]->getPassName() << "\n";
+ outs() << "\n*** You can reproduce the problem with: ";
+ if (UseValgrind) outs() << "valgrind ";
+ outs() << "opt " << Filename;
+ for (unsigned i = 0, e = PluginLoader::getNumPlugins(); i != e; ++i) {
+ outs() << " -load " << PluginLoader::getPlugin(i);