diff options
author | Mikhail Glushenkov <foldr@codedgers.com> | 2010-11-03 16:14:07 +0000 |
---|---|---|
committer | Mikhail Glushenkov <foldr@codedgers.com> | 2010-11-03 16:14:07 +0000 |
commit | 544fba13628e022cd3c5be8bbb22b81f0f6b0fa3 (patch) | |
tree | 6cf7ed4dcb1c9a667073cc2ec9416cfe19be96d9 /tools | |
parent | 391f5bce046e229a8d52faf317a7ab980aff0dbb (diff) |
80-col violations, trailing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118173 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rw-r--r-- | tools/bugpoint/OptimizerDriver.cpp | 8 | ||||
-rw-r--r-- | tools/bugpoint/ToolRunner.cpp | 45 |
2 files changed, 27 insertions, 26 deletions
diff --git a/tools/bugpoint/OptimizerDriver.cpp b/tools/bugpoint/OptimizerDriver.cpp index 178b1ff3ed..d28ce79877 100644 --- a/tools/bugpoint/OptimizerDriver.cpp +++ b/tools/bugpoint/OptimizerDriver.cpp @@ -126,12 +126,12 @@ bool BugDriver::runPasses(Module *Program, << ErrMsg << "\n"; return(1); } - + std::string ErrInfo; tool_output_file InFile(inputFilename.c_str(), ErrInfo, raw_fd_ostream::F_Binary); - - + + if (!ErrInfo.empty()) { errs() << "Error opening bitcode file: " << inputFilename.str() << "\n"; return 1; @@ -195,7 +195,7 @@ bool BugDriver::runPasses(Module *Program, prog = sys::Program::FindProgramByName("valgrind"); else prog = tool; - + // Redirect stdout and stderr to nowhere if SilencePasses is given sys::Path Nowhere; const sys::Path *Redirects[3] = {0, &Nowhere, &Nowhere}; diff --git a/tools/bugpoint/ToolRunner.cpp b/tools/bugpoint/ToolRunner.cpp index 8d4935b558..83b358be55 100644 --- a/tools/bugpoint/ToolRunner.cpp +++ b/tools/bugpoint/ToolRunner.cpp @@ -141,7 +141,7 @@ static std::string ProcessFailure(sys::Path ProgPath, const char** Args, for (const char **Arg = Args; *Arg; ++Arg) OS << " " << *Arg; OS << "\n"; - + // Rerun the compiler, capturing any error messages to print them. sys::Path ErrorFilename("bugpoint.program_error_messages"); std::string ErrMsg; @@ -206,7 +206,8 @@ int LLI::ExecuteProgram(const std::string &Bitcode, LLIArgs.push_back(LLIPath.c_str()); LLIArgs.push_back("-force-interpreter=true"); - for (std::vector<std::string>::const_iterator i = SharedLibs.begin(), e = SharedLibs.end(); i != e; ++i) { + for (std::vector<std::string>::const_iterator i = SharedLibs.begin(), + e = SharedLibs.end(); i != e; ++i) { LLIArgs.push_back("-load"); LLIArgs.push_back((*i).c_str()); } @@ -251,7 +252,7 @@ AbstractInterpreter *AbstractInterpreter::createLLI(const char *Argv0, // Custom execution command implementation of AbstractIntepreter interface // // Allows using a custom command for executing the bitcode, thus allows, -// for example, to invoke a cross compiler for code generation followed by +// for example, to invoke a cross compiler for code generation followed by // a simulator that executes the generated binary. namespace { class CustomExecutor : public AbstractInterpreter { @@ -299,7 +300,7 @@ int CustomExecutor::ExecuteProgram(const std::string &Bitcode, return RunProgramWithTimeout( sys::Path(ExecutionCommand), - &ProgramArgs[0], sys::Path(InputFile), sys::Path(OutputFile), + &ProgramArgs[0], sys::Path(InputFile), sys::Path(OutputFile), sys::Path(OutputFile), Timeout, MemoryLimit); } @@ -317,14 +318,14 @@ AbstractInterpreter *AbstractInterpreter::createCustom( // defining a full command line as the command instead of just the // executed program. We cannot just pass the whole string after the command // as a single argument because then program sees only a single - // command line argument (with spaces in it: "foo bar" instead + // command line argument (with spaces in it: "foo bar" instead // of "foo" and "bar"). - // code borrowed from: + // code borrowed from: // http://oopweb.com/CPP/Documents/CPPHOWTO/Volume/C++Programming-HOWTO-7.html - std::string::size_type lastPos = + std::string::size_type lastPos = ExecCommandLine.find_first_not_of(delimiters, 0); - std::string::size_type pos = + std::string::size_type pos = ExecCommandLine.find_first_of(delimiters, lastPos); while (std::string::npos != pos || std::string::npos != lastPos) { @@ -341,8 +342,8 @@ AbstractInterpreter *AbstractInterpreter::createCustom( std::string CmdPath = sys::Program::FindProgramByName(Command).str(); if (CmdPath.empty()) { - Message = - std::string("Cannot find '") + Command + + Message = + std::string("Cannot find '") + Command + "' in PATH!\n"; return 0; } @@ -355,7 +356,7 @@ AbstractInterpreter *AbstractInterpreter::createCustom( //===----------------------------------------------------------------------===// // LLC Implementation of AbstractIntepreter interface // -GCC::FileType LLC::OutputCode(const std::string &Bitcode, +GCC::FileType LLC::OutputCode(const std::string &Bitcode, sys::Path &OutputAsmFile, std::string &Error, unsigned Timeout, unsigned MemoryLimit) { const char *Suffix = (UseIntegratedAssembler ? ".llc.o" : ".llc.s"); @@ -376,10 +377,10 @@ GCC::FileType LLC::OutputCode(const std::string &Bitcode, LLCArgs.push_back("-o"); LLCArgs.push_back(OutputAsmFile.c_str()); // Output to the Asm file LLCArgs.push_back(Bitcode.c_str()); // This is the input bitcode - + if (UseIntegratedAssembler) LLCArgs.push_back("-filetype=obj"); - + LLCArgs.push_back (0); outs() << (UseIntegratedAssembler ? "<llc-ia>" : "<llc>"); @@ -394,7 +395,7 @@ GCC::FileType LLC::OutputCode(const std::string &Bitcode, Timeout, MemoryLimit)) Error = ProcessFailure(sys::Path(LLCPath), &LLCArgs[0], Timeout, MemoryLimit); - return UseIntegratedAssembler ? GCC::ObjectFile : GCC::AsmFile; + return UseIntegratedAssembler ? GCC::ObjectFile : GCC::AsmFile; } void LLC::compileProgram(const std::string &Bitcode, std::string *Error, @@ -474,7 +475,7 @@ namespace { const std::vector<std::string> &GCCArgs = std::vector<std::string>(), const std::vector<std::string> &SharedLibs = - std::vector<std::string>(), + std::vector<std::string>(), unsigned Timeout = 0, unsigned MemoryLimit = 0); }; @@ -677,9 +678,9 @@ int GCC::ExecuteProgram(const std::string &ProgramFile, GCCArgs.push_back("-force_cpusubtype_ALL"); } } - + GCCArgs.push_back(ProgramFile.c_str()); // Specify the input filename. - + GCCArgs.push_back("-x"); GCCArgs.push_back("none"); GCCArgs.push_back("-o"); @@ -793,7 +794,7 @@ int GCC::MakeSharedObject(const std::string &InputFile, FileType fileType, OutputFile = uniqueFilename.str(); std::vector<const char*> GCCArgs; - + GCCArgs.push_back(GCCPath.c_str()); if (TargetTriple.getArch() == Triple::x86) @@ -816,7 +817,7 @@ int GCC::MakeSharedObject(const std::string &InputFile, FileType fileType, GCCArgs.push_back("-G"); // Compile a shared library, `-G' for Sparc else if (TargetTriple.getOS() == Triple::Darwin) { // link all source files into a single module in data segment, rather than - // generating blocks. dynamic_lookup requires that you set + // generating blocks. dynamic_lookup requires that you set // MACOSX_DEPLOYMENT_TARGET=10.3 in your env. FIXME: it would be better for // bugpoint to just pass that in the environment of GCC. GCCArgs.push_back("-single_module"); @@ -837,8 +838,8 @@ int GCC::MakeSharedObject(const std::string &InputFile, FileType fileType, GCCArgs.push_back(OutputFile.c_str()); // Output to the right filename. GCCArgs.push_back("-O2"); // Optimize the program a bit. - - + + // Add any arguments intended for GCC. We locate them here because this is // most likely -L and -l options that need to come before other libraries but // after the source. Other options won't be sensitive to placement on the @@ -847,7 +848,7 @@ int GCC::MakeSharedObject(const std::string &InputFile, FileType fileType, GCCArgs.push_back(ArgsForGCC[i].c_str()); GCCArgs.push_back(0); // NULL terminator - + outs() << "<gcc>"; outs().flush(); DEBUG(errs() << "\nAbout to run:\t"; |