From 573faecacf5277b338f27c541c93c364ff284304 Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Fri, 25 Apr 2014 04:24:47 +0000 Subject: [C++] Use 'nullptr'. Tools edition. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207176 91177308-0d34-0410-b5e6-96231b3b80d8 --- tools/bugpoint/ToolRunner.cpp | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'tools/bugpoint/ToolRunner.cpp') diff --git a/tools/bugpoint/ToolRunner.cpp b/tools/bugpoint/ToolRunner.cpp index e1c995f519..c481b03e2b 100644 --- a/tools/bugpoint/ToolRunner.cpp +++ b/tools/bugpoint/ToolRunner.cpp @@ -62,7 +62,7 @@ static int RunProgramWithTimeout(StringRef ProgramPath, StringRef StdErrFile, unsigned NumSeconds = 0, unsigned MemoryLimit = 0, - std::string *ErrMsg = 0) { + std::string *ErrMsg = nullptr) { const StringRef *Redirects[3] = { &StdInFile, &StdOutFile, &StdErrFile }; #if 0 // For debug purposes @@ -74,7 +74,7 @@ static int RunProgramWithTimeout(StringRef ProgramPath, } #endif - return sys::ExecuteAndWait(ProgramPath, Args, 0, Redirects, + return sys::ExecuteAndWait(ProgramPath, Args, nullptr, Redirects, NumSeconds, MemoryLimit, ErrMsg); } @@ -103,7 +103,7 @@ static int RunProgramRemotelyWithTimeout(StringRef RemoteClientPath, #endif // Run the program remotely with the remote client - int ReturnCode = sys::ExecuteAndWait(RemoteClientPath, Args, 0, + int ReturnCode = sys::ExecuteAndWait(RemoteClientPath, Args, nullptr, Redirects, NumSeconds, MemoryLimit); // Has the remote client fail? @@ -219,7 +219,7 @@ int LLI::ExecuteProgram(const std::string &Bitcode, // Add optional parameters to the running program from Argv for (unsigned i=0, e = Args.size(); i != e; ++i) LLIArgs.push_back(Args[i].c_str()); - LLIArgs.push_back(0); + LLIArgs.push_back(nullptr); outs() << ""; outs().flush(); DEBUG(errs() << "\nAbout to run:\t"; @@ -277,7 +277,7 @@ AbstractInterpreter *AbstractInterpreter::createLLI(const char *Argv0, } Message = "Cannot find `lli' in executable directory!\n"; - return 0; + return nullptr; } //===---------------------------------------------------------------------===// @@ -328,7 +328,7 @@ void CustomCompiler::compileProgram(const std::string &Bitcode, for (std::size_t i = 0; i < CompilerArgs.size(); ++i) ProgramArgs.push_back(CompilerArgs.at(i).c_str()); ProgramArgs.push_back(Bitcode.c_str()); - ProgramArgs.push_back(0); + ProgramArgs.push_back(nullptr); // Add optional parameters to the running program from Argv for (unsigned i = 0, e = CompilerArgs.size(); i != e; ++i) @@ -385,7 +385,7 @@ int CustomExecutor::ExecuteProgram(const std::string &Bitcode, for (std::size_t i = 0; i < ExecutorArgs.size(); ++i) ProgramArgs.push_back(ExecutorArgs.at(i).c_str()); ProgramArgs.push_back(Bitcode.c_str()); - ProgramArgs.push_back(0); + ProgramArgs.push_back(nullptr); // Add optional parameters to the running program from Argv for (unsigned i = 0, e = Args.size(); i != e; ++i) @@ -448,7 +448,7 @@ AbstractInterpreter *AbstractInterpreter::createCustomCompiler( std::vector Args; lexCommand(Message, CompileCommandLine, CmdPath, Args); if (CmdPath.empty()) - return 0; + return nullptr; return new CustomCompiler(CmdPath, Args); } @@ -464,7 +464,7 @@ AbstractInterpreter *AbstractInterpreter::createCustomExecutor( std::vector Args; lexCommand(Message, ExecCommandLine, CmdPath, Args); if (CmdPath.empty()) - return 0; + return nullptr; return new CustomExecutor(CmdPath, Args); } @@ -499,7 +499,7 @@ GCC::FileType LLC::OutputCode(const std::string &Bitcode, if (UseIntegratedAssembler) LLCArgs.push_back("-filetype=obj"); - LLCArgs.push_back (0); + LLCArgs.push_back (nullptr); outs() << (UseIntegratedAssembler ? "" : ""); outs().flush(); @@ -559,7 +559,7 @@ LLC *AbstractInterpreter::createLLC(const char *Argv0, PrependMainExecutablePath("llc", Argv0, (void *)(intptr_t) & createLLC); if (LLCPath.empty()) { Message = "Cannot find `llc' in executable directory!\n"; - return 0; + return nullptr; } GCC *gcc = GCC::create(Message, GCCBinary, GCCArgs); @@ -625,7 +625,7 @@ int JIT::ExecuteProgram(const std::string &Bitcode, // Add optional parameters to the running program from Argv for (unsigned i=0, e = Args.size(); i != e; ++i) JITArgs.push_back(Args[i].c_str()); - JITArgs.push_back(0); + JITArgs.push_back(nullptr); outs() << ""; outs().flush(); DEBUG(errs() << "\nAbout to run:\t"; @@ -651,7 +651,7 @@ AbstractInterpreter *AbstractInterpreter::createJIT(const char *Argv0, } Message = "Cannot find `lli' in executable directory!\n"; - return 0; + return nullptr; } //===---------------------------------------------------------------------===// @@ -737,7 +737,7 @@ int GCC::ExecuteProgram(const std::string &ProgramFile, #endif if (TargetTriple.getArch() == Triple::sparc) GCCArgs.push_back("-mcpu=v9"); - GCCArgs.push_back(0); // NULL terminator + GCCArgs.push_back(nullptr); // NULL terminator outs() << ""; outs().flush(); DEBUG(errs() << "\nAbout to run:\t"; @@ -786,7 +786,7 @@ int GCC::ExecuteProgram(const std::string &ProgramFile, // Add optional parameters to the running program from Argv for (unsigned i = 0, e = Args.size(); i != e; ++i) ProgramArgs.push_back(Args[i].c_str()); - ProgramArgs.push_back(0); // NULL terminator + ProgramArgs.push_back(nullptr); // NULL terminator // Now that we have a binary, run it! outs() << ""; outs().flush(); @@ -885,7 +885,7 @@ int GCC::MakeSharedObject(const std::string &InputFile, FileType fileType, // command line, so this should be safe. for (unsigned i = 0, e = ArgsForGCC.size(); i != e; ++i) GCCArgs.push_back(ArgsForGCC[i].c_str()); - GCCArgs.push_back(0); // NULL terminator + GCCArgs.push_back(nullptr); // NULL terminator @@ -910,7 +910,7 @@ GCC *GCC::create(std::string &Message, std::string GCCPath = sys::FindProgramByName(GCCBinary); if (GCCPath.empty()) { Message = "Cannot find `"+ GCCBinary +"' in PATH!\n"; - return 0; + return nullptr; } std::string RemoteClientPath; -- cgit v1.2.3