[C++11] Use 'nullptr'. Tooling edition.

llvm-svn: 209192
This commit is contained in:
Craig Topper
2014-05-20 04:51:16 +00:00
parent 2554294321
commit ccbc35edc2
4 changed files with 30 additions and 29 deletions

View File

@@ -52,7 +52,7 @@ CompilationDatabase::loadFromDirectory(StringRef BuildDirectory,
ErrorStream << It->getName() << ": " << DatabaseErrorMessage << "\n";
}
ErrorMessage = ErrorStream.str();
return NULL;
return nullptr;
}
static CompilationDatabase *
@@ -76,7 +76,7 @@ findCompilationDatabaseFromDirectory(StringRef Directory,
Directory = llvm::sys::path::parent_path(Directory);
}
ErrorMessage = ErrorStream.str();
return NULL;
return nullptr;
}
CompilationDatabase *
@@ -151,7 +151,7 @@ private:
// options.
class UnusedInputDiagConsumer : public DiagnosticConsumer {
public:
UnusedInputDiagConsumer() : Other(0) {}
UnusedInputDiagConsumer() : Other(nullptr) {}
// Useful for debugging, chain diagnostics to another consumer after
// recording for our own purposes.
@@ -290,13 +290,13 @@ FixedCompilationDatabase::loadFromCommandLine(int &Argc,
Twine Directory) {
const char **DoubleDash = std::find(Argv, Argv + Argc, StringRef("--"));
if (DoubleDash == Argv + Argc)
return NULL;
return nullptr;
std::vector<const char *> CommandLine(DoubleDash + 1, Argv + Argc);
Argc = DoubleDash - Argv;
std::vector<std::string> StrippedArgs;
if (!stripPositionalArgs(CommandLine, StrippedArgs))
return 0;
return nullptr;
return new FixedCompilationDatabase(Directory, StrippedArgs);
}