From a1bdcedc3879510a874d24c450e07feb170d9cd6 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Wed, 15 Jul 2009 17:29:42 +0000 Subject: Add a Force option to raw_fd_ostream to specify whether opening an existing file is considered an error. Convert several tools to use raw_fd_ostream instead of std::ostream, and to use this new option instead of doing a manual check. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75801 91177308-0d34-0410-b5e6-96231b3b80d8 --- tools/bugpoint/ToolRunner.cpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'tools/bugpoint/ToolRunner.cpp') diff --git a/tools/bugpoint/ToolRunner.cpp b/tools/bugpoint/ToolRunner.cpp index d610676d4d..a5e1e8b8a4 100644 --- a/tools/bugpoint/ToolRunner.cpp +++ b/tools/bugpoint/ToolRunner.cpp @@ -20,7 +20,6 @@ #include "llvm/Support/FileUtilities.h" #include #include -#include using namespace llvm; namespace { @@ -158,7 +157,7 @@ int LLI::ExecuteProgram(const std::string &Bitcode, LLIArgs.push_back(Args[i].c_str()); LLIArgs.push_back(0); - std::cout << "" << std::flush; + outs() << ""; outs().flush(); DEBUG(errs() << "\nAbout to run:\t"; for (unsigned i=0, e = LLIArgs.size()-1; i != e; ++i) errs() << " " << LLIArgs[i]; @@ -312,7 +311,7 @@ GCC::FileType LLC::OutputCode(const std::string &Bitcode, LLCArgs.push_back (Bitcode.c_str()); // This is the input bitcode LLCArgs.push_back (0); - std::cout << "" << std::flush; + outs() << ""; outs().flush(); DEBUG(errs() << "\nAbout to run:\t"; for (unsigned i=0, e = LLCArgs.size()-1; i != e; ++i) errs() << " " << LLCArgs[i]; @@ -429,7 +428,7 @@ int JIT::ExecuteProgram(const std::string &Bitcode, JITArgs.push_back(Args[i].c_str()); JITArgs.push_back(0); - std::cout << "" << std::flush; + outs() << ""; outs().flush(); DEBUG(errs() << "\nAbout to run:\t"; for (unsigned i=0, e = JITArgs.size()-1; i != e; ++i) errs() << " " << JITArgs[i]; @@ -478,7 +477,7 @@ GCC::FileType CBE::OutputCode(const std::string &Bitcode, LLCArgs.push_back (Bitcode.c_str()); // This is the input bitcode LLCArgs.push_back (0); - std::cout << "" << std::flush; + outs() << ""; outs().flush(); DEBUG(errs() << "\nAbout to run:\t"; for (unsigned i=0, e = LLCArgs.size()-1; i != e; ++i) errs() << " " << LLCArgs[i]; @@ -621,7 +620,7 @@ int GCC::ExecuteProgram(const std::string &ProgramFile, #endif GCCArgs.push_back(0); // NULL terminator - std::cout << "" << std::flush; + outs() << ""; outs().flush(); DEBUG(errs() << "\nAbout to run:\t"; for (unsigned i=0, e = GCCArgs.size()-1; i != e; ++i) errs() << " " << GCCArgs[i]; @@ -665,7 +664,7 @@ int GCC::ExecuteProgram(const std::string &ProgramFile, ProgramArgs.push_back(0); // NULL terminator // Now that we have a binary, run it! - std::cout << "" << std::flush; + outs() << ""; outs().flush(); DEBUG(errs() << "\nAbout to run:\t"; for (unsigned i=0, e = ProgramArgs.size()-1; i != e; ++i) errs() << " " << ProgramArgs[i]; @@ -680,7 +679,7 @@ int GCC::ExecuteProgram(const std::string &ProgramFile, sys::Path(InputFile), sys::Path(OutputFile), sys::Path(OutputFile), Timeout, MemoryLimit); } else { - std::cout << "" << std::flush; + outs() << ""; outs().flush(); int RemoteClientStatus = RunProgramWithTimeout(sys::Path(RemoteClientPath), &ProgramArgs[0], sys::Path(InputFile), sys::Path(OutputFile), sys::Path(OutputFile), Timeout, MemoryLimit); @@ -756,7 +755,7 @@ int GCC::MakeSharedObject(const std::string &InputFile, FileType fileType, - std::cout << "" << std::flush; + outs() << ""; outs().flush(); DEBUG(errs() << "\nAbout to run:\t"; for (unsigned i=0, e = GCCArgs.size()-1; i != e; ++i) errs() << " " << GCCArgs[i]; -- cgit v1.2.3