Deleted Added
full compact
ToolRunner.cpp (221337) ToolRunner.cpp (223013)
1//===-- ToolRunner.cpp ----------------------------------------------------===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//

--- 840 unchanged lines hidden (view full) ---

849 errs() << " " << ProgramArgs[i];
850 errs() << "\n";
851 );
852
853 FileRemover OutputBinaryRemover(OutputBinary.str(), !SaveTemps);
854
855 if (RemoteClientPath.isEmpty()) {
856 DEBUG(errs() << "<run locally>");
1//===-- ToolRunner.cpp ----------------------------------------------------===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//

--- 840 unchanged lines hidden (view full) ---

849 errs() << " " << ProgramArgs[i];
850 errs() << "\n";
851 );
852
853 FileRemover OutputBinaryRemover(OutputBinary.str(), !SaveTemps);
854
855 if (RemoteClientPath.isEmpty()) {
856 DEBUG(errs() << "<run locally>");
857 return RunProgramWithTimeout(OutputBinary, &ProgramArgs[0],
857 int ExitCode = RunProgramWithTimeout(OutputBinary, &ProgramArgs[0],
858 sys::Path(InputFile), sys::Path(OutputFile), sys::Path(OutputFile),
859 Timeout, MemoryLimit, Error);
858 sys::Path(InputFile), sys::Path(OutputFile), sys::Path(OutputFile),
859 Timeout, MemoryLimit, Error);
860 // Treat a signal (usually SIGSEGV) or timeout as part of the program output
861 // so that crash-causing miscompilation is handled seamlessly.
862 if (ExitCode < -1) {
863 std::ofstream outFile(OutputFile.c_str(), std::ios_base::app);
864 outFile << *Error << '\n';
865 outFile.close();
866 Error->clear();
867 }
868 return ExitCode;
860 } else {
861 outs() << "<run remotely>"; outs().flush();
862 return RunProgramRemotelyWithTimeout(sys::Path(RemoteClientPath),
863 &ProgramArgs[0], sys::Path(InputFile), sys::Path(OutputFile),
864 sys::Path(OutputFile), Timeout, MemoryLimit);
865 }
866}
867

--- 101 unchanged lines hidden ---
869 } else {
870 outs() << "<run remotely>"; outs().flush();
871 return RunProgramRemotelyWithTimeout(sys::Path(RemoteClientPath),
872 &ProgramArgs[0], sys::Path(InputFile), sys::Path(OutputFile),
873 sys::Path(OutputFile), Timeout, MemoryLimit);
874 }
875}
876

--- 101 unchanged lines hidden ---