From 1ad45020ec8518a5c9bea7ec1007798a456bff56 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Fri, 13 Jun 2014 03:07:50 +0000 Subject: Remove 'using std::error_code' from tools. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210876 91177308-0d34-0410-b5e6-96231b3b80d8 --- tools/bugpoint/ExecutionDriver.cpp | 7 +++---- tools/bugpoint/ExtractFunction.cpp | 3 +-- tools/bugpoint/Miscompilation.cpp | 9 ++++----- tools/bugpoint/OptimizerDriver.cpp | 3 +-- tools/bugpoint/ToolRunner.cpp | 9 ++++----- 5 files changed, 13 insertions(+), 18 deletions(-) (limited to 'tools/bugpoint') diff --git a/tools/bugpoint/ExecutionDriver.cpp b/tools/bugpoint/ExecutionDriver.cpp index b41a4b0334..25813b34e6 100644 --- a/tools/bugpoint/ExecutionDriver.cpp +++ b/tools/bugpoint/ExecutionDriver.cpp @@ -22,7 +22,6 @@ #include using namespace llvm; -using std::error_code; namespace { // OutputType - Allow the user to specify the way code should be run, to test @@ -268,7 +267,7 @@ void BugDriver::compileProgram(Module *M, std::string *Error) const { // Emit the program to a bitcode file... SmallString<128> BitcodeFile; int BitcodeFD; - error_code EC = sys::fs::createUniqueFile( + std::error_code EC = sys::fs::createUniqueFile( OutputPrefix + "-test-program-%%%%%%%.bc", BitcodeFD, BitcodeFile); if (EC) { errs() << ToolName << ": Error making unique filename: " << EC.message() @@ -306,7 +305,7 @@ std::string BugDriver::executeProgram(const Module *Program, // Emit the program to a bitcode file... SmallString<128> UniqueFilename; int UniqueFD; - error_code EC = sys::fs::createUniqueFile( + std::error_code EC = sys::fs::createUniqueFile( OutputPrefix + "-test-program-%%%%%%%.bc", UniqueFD, UniqueFilename); if (EC) { errs() << ToolName << ": Error making unique filename: " @@ -332,7 +331,7 @@ std::string BugDriver::executeProgram(const Module *Program, // Check to see if this is a valid output filename... SmallString<128> UniqueFile; - error_code EC = sys::fs::createUniqueFile(OutputFile, UniqueFile); + std::error_code EC = sys::fs::createUniqueFile(OutputFile, UniqueFile); if (EC) { errs() << ToolName << ": Error making unique filename: " << EC.message() << "\n"; diff --git a/tools/bugpoint/ExtractFunction.cpp b/tools/bugpoint/ExtractFunction.cpp index a257840b6e..4fb68566ac 100644 --- a/tools/bugpoint/ExtractFunction.cpp +++ b/tools/bugpoint/ExtractFunction.cpp @@ -33,7 +33,6 @@ #include "llvm/Transforms/Utils/CodeExtractor.h" #include using namespace llvm; -using std::error_code; #define DEBUG_TYPE "bugpoint" @@ -367,7 +366,7 @@ Module *BugDriver::ExtractMappedBlocksFromModule(const Module *M) { SmallString<128> Filename; int FD; - error_code EC = sys::fs::createUniqueFile( + std::error_code EC = sys::fs::createUniqueFile( OutputPrefix + "-extractblocks%%%%%%%", FD, Filename); if (EC) { outs() << "*** Basic Block extraction failed!\n"; diff --git a/tools/bugpoint/Miscompilation.cpp b/tools/bugpoint/Miscompilation.cpp index 5143fa1f03..3f1f84ef62 100644 --- a/tools/bugpoint/Miscompilation.cpp +++ b/tools/bugpoint/Miscompilation.cpp @@ -27,7 +27,6 @@ #include "llvm/Support/FileUtilities.h" #include "llvm/Transforms/Utils/Cloning.h" using namespace llvm; -using std::error_code; namespace llvm { extern cl::opt OutputPrefix; @@ -965,8 +964,8 @@ static bool TestCodeGenerator(BugDriver &BD, Module *Test, Module *Safe, SmallString<128> TestModuleBC; int TestModuleFD; - error_code EC = sys::fs::createTemporaryFile("bugpoint.test", "bc", - TestModuleFD, TestModuleBC); + std::error_code EC = sys::fs::createTemporaryFile("bugpoint.test", "bc", + TestModuleFD, TestModuleBC); if (EC) { errs() << BD.getToolName() << "Error making unique filename: " << EC.message() << "\n"; @@ -1059,8 +1058,8 @@ bool BugDriver::debugCodeGenerator(std::string *Error) { SmallString<128> TestModuleBC; int TestModuleFD; - error_code EC = sys::fs::createTemporaryFile("bugpoint.test", "bc", - TestModuleFD, TestModuleBC); + std::error_code EC = sys::fs::createTemporaryFile("bugpoint.test", "bc", + TestModuleFD, TestModuleBC); if (EC) { errs() << getToolName() << "Error making unique filename: " << EC.message() << "\n"; diff --git a/tools/bugpoint/OptimizerDriver.cpp b/tools/bugpoint/OptimizerDriver.cpp index 85790b0c63..d452fd94c0 100644 --- a/tools/bugpoint/OptimizerDriver.cpp +++ b/tools/bugpoint/OptimizerDriver.cpp @@ -35,7 +35,6 @@ #include using namespace llvm; -using std::error_code; #define DEBUG_TYPE "bugpoint" @@ -130,7 +129,7 @@ bool BugDriver::runPasses(Module *Program, // setup the output file name outs().flush(); SmallString<128> UniqueFilename; - error_code EC = sys::fs::createUniqueFile( + std::error_code EC = sys::fs::createUniqueFile( OutputPrefix + "-output-%%%%%%%.bc", UniqueFilename); if (EC) { errs() << getToolName() << ": Error making unique filename: " diff --git a/tools/bugpoint/ToolRunner.cpp b/tools/bugpoint/ToolRunner.cpp index ec120bb0b2..4a2401b530 100644 --- a/tools/bugpoint/ToolRunner.cpp +++ b/tools/bugpoint/ToolRunner.cpp @@ -22,7 +22,6 @@ #include #include using namespace llvm; -using std::error_code; #define DEBUG_TYPE "toolrunner" @@ -143,7 +142,7 @@ static std::string ProcessFailure(StringRef ProgPath, const char** Args, // Rerun the compiler, capturing any error messages to print them. SmallString<128> ErrorFilename; int ErrorFD; - error_code EC = sys::fs::createTemporaryFile( + std::error_code EC = sys::fs::createTemporaryFile( "bugpoint.program_error_messages", "", ErrorFD, ErrorFilename); if (EC) { errs() << "Error making unique filename: " << EC.message() << "\n"; @@ -479,7 +478,7 @@ GCC::FileType LLC::OutputCode(const std::string &Bitcode, const char *Suffix = (UseIntegratedAssembler ? ".llc.o" : ".llc.s"); SmallString<128> UniqueFile; - error_code EC = + std::error_code EC = sys::fs::createUniqueFile(Bitcode + "-%%%%%%%" + Suffix, UniqueFile); if (EC) { errs() << "Error making unique filename: " << EC.message() << "\n"; @@ -716,7 +715,7 @@ int GCC::ExecuteProgram(const std::string &ProgramFile, GCCArgs.push_back("-o"); SmallString<128> OutputBinary; - error_code EC = + std::error_code EC = sys::fs::createUniqueFile(ProgramFile + "-%%%%%%%.gcc.exe", OutputBinary); if (EC) { errs() << "Error making unique filename: " << EC.message() << "\n"; @@ -826,7 +825,7 @@ int GCC::MakeSharedObject(const std::string &InputFile, FileType fileType, const std::vector &ArgsForGCC, std::string &Error) { SmallString<128> UniqueFilename; - error_code EC = sys::fs::createUniqueFile( + std::error_code EC = sys::fs::createUniqueFile( InputFile + "-%%%%%%%" + LTDL_SHLIB_EXT, UniqueFilename); if (EC) { errs() << "Error making unique filename: " << EC.message() << "\n"; -- cgit v1.2.3