diff options
author | Craig Topper <craig.topper@gmail.com> | 2014-05-20 04:51:16 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@gmail.com> | 2014-05-20 04:51:16 +0000 |
commit | ccbc35edc230838df330e4fad1023e016f267e2b (patch) | |
tree | 866a8b0e3c16c4b120382de109686f52af7bf268 /clang/lib/Tooling/Tooling.cpp | |
parent | 255429432153a5e1d9f3db7af5b0f6ba9ae0f485 (diff) | |
download | bcm5719-llvm-ccbc35edc230838df330e4fad1023e016f267e2b.tar.gz bcm5719-llvm-ccbc35edc230838df330e4fad1023e016f267e2b.zip |
[C++11] Use 'nullptr'. Tooling edition.
llvm-svn: 209192
Diffstat (limited to 'clang/lib/Tooling/Tooling.cpp')
-rw-r--r-- | clang/lib/Tooling/Tooling.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/clang/lib/Tooling/Tooling.cpp b/clang/lib/Tooling/Tooling.cpp index 3fe0c838701..35e3eb4af22 100644 --- a/clang/lib/Tooling/Tooling.cpp +++ b/clang/lib/Tooling/Tooling.cpp @@ -75,7 +75,7 @@ static const llvm::opt::ArgStringList *getCC1Arguments( Jobs.Print(error_stream, "; ", true); Diagnostics->Report(clang::diag::err_fe_expected_compiler_job) << error_stream.str(); - return NULL; + return nullptr; } // The one job we find should be to invoke clang again. @@ -83,7 +83,7 @@ static const llvm::opt::ArgStringList *getCC1Arguments( cast<clang::driver::Command>(*Jobs.begin()); if (StringRef(Cmd->getCreator().getName()) != "clang") { Diagnostics->Report(clang::diag::err_fe_expected_clang_command); - return NULL; + return nullptr; } return &Cmd->getArguments(); @@ -171,7 +171,7 @@ ToolInvocation::ToolInvocation(std::vector<std::string> CommandLine, Action(Action), OwnsAction(false), Files(Files), - DiagConsumer(NULL) {} + DiagConsumer(nullptr) {} ToolInvocation::ToolInvocation(std::vector<std::string> CommandLine, FrontendAction *FAction, FileManager *Files) @@ -179,7 +179,7 @@ ToolInvocation::ToolInvocation(std::vector<std::string> CommandLine, Action(new SingleFrontendActionFactory(FAction)), OwnsAction(true), Files(Files), - DiagConsumer(NULL) {} + DiagConsumer(nullptr) {} ToolInvocation::~ToolInvocation() { if (OwnsAction) @@ -216,7 +216,7 @@ bool ToolInvocation::run() { Driver->BuildCompilation(llvm::makeArrayRef(Argv))); const llvm::opt::ArgStringList *const CC1Args = getCC1Arguments( &Diagnostics, Compilation.get()); - if (CC1Args == NULL) { + if (!CC1Args) { return false; } std::unique_ptr<clang::CompilerInvocation> Invocation( @@ -271,7 +271,7 @@ bool FrontendActionFactory::runInvocation(CompilerInvocation *Invocation, ClangTool::ClangTool(const CompilationDatabase &Compilations, ArrayRef<std::string> SourcePaths) - : Files(new FileManager(FileSystemOptions())), DiagConsumer(NULL) { + : Files(new FileManager(FileSystemOptions())), DiagConsumer(nullptr) { ArgsAdjusters.push_back(new ClangStripOutputAdjuster()); ArgsAdjusters.push_back(new ClangSyntaxOnlyAdjuster()); for (const auto &SourcePath : SourcePaths) { @@ -410,13 +410,14 @@ buildASTFromCodeWithArgs(const Twine &Code, std::vector<std::unique_ptr<ASTUnit>> ASTs; ASTBuilderAction Action(ASTs); - ToolInvocation Invocation(getSyntaxOnlyToolArgs(Args, FileNameRef), &Action, 0); + ToolInvocation Invocation(getSyntaxOnlyToolArgs(Args, FileNameRef), &Action, + nullptr); SmallString<1024> CodeStorage; Invocation.mapVirtualFile(FileNameRef, Code.toNullTerminatedStringRef(CodeStorage)); if (!Invocation.run()) - return 0; + return nullptr; assert(ASTs.size() == 1); return std::move(ASTs[0]); |