Lines Matching +full:valgrind +full:- +full:out
1 //===- OptimizerDriver.cpp - Allow BugPoint to run passes safely ----------===//
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
15 //===----------------------------------------------------------------------===//
42 "preserve-bc-uselistorder",
43 cl::desc("Preserve use-list order when writing LLVM bitcode."),
47 OptCmd("opt-command", cl::init(""),
53 static bool writeProgramToFileAux(ToolOutputFile &Out, const Module &M) {
54 WriteBitcodeToFile(M, Out.os(), PreserveBitcodeUseListOrder);
55 Out.os().close();
56 if (!Out.os().has_error()) {
57 Out.keep();
65 ToolOutputFile Out(Filename, FD);
66 return writeProgramToFileAux(Out, M);
82 ToolOutputFile Out(Filename, EC, sys::fs::OF_None);
84 return writeProgramToFileAux(Out, M);
89 /// "bugpoint-ID.bc".
93 // telling the user how to reproduce it: opt -foo blah.bc
95 std::string Filename = OutputPrefix + "-" + ID + ".bc";
106 outs() << "valgrind ";
109 outs() << " -load " << PluginLoader::getPlugin(i);
115 "silence-passes",
118 static cl::list<std::string> OptArgs("opt-args", cl::Positional,
122 /// runPasses - Run the specified passes on Program, outputting a bitcode file
138 OutputPrefix + "-output-%%%%%%%.bc", UniqueFilename);
148 sys::fs::TempFile::create(OutputPrefix + "-input-%%%%%%%.bc");
156 raw_fd_ostream OS(Temp->FD, /*shouldClose*/ false);
161 errs() << "Error writing bitcode file: " << Temp->TmpName << "\n";
185 if (ErrorOr<std::string> Path = sys::findProgramByName("valgrind"))
192 errs() << "Cannot find `valgrind' in PATH!\n";
199 Args.push_back("valgrind");
200 Args.push_back("--error-exitcode=1");
201 Args.push_back("-q");
210 Args.push_back("-bugpoint-enable-legacy-pm");
211 Args.push_back("-disable-symbolication");
212 Args.push_back("-o");
216 pass_args.push_back(std::string("-load"));
222 pass_args.push_back(std::string("-") + (*I));
227 Args.push_back(Temp->TmpName);
231 for (unsigned i = 0, e = Args.size() - 1; i != e; ++i) errs()
258 if (result == -1)