From ec31a302b7ae0e3f999be3bac28d55f52c6e2393 Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Sat, 19 Jul 2014 01:05:11 +0000 Subject: [PATCH] Remove uses of the redundant ".reset(nullptr)" of unique_ptr, in favor of ".reset()" It's also possible to just write "= nullptr", but there's some question of whether that's as readable, so I leave it up to authors to pick which they prefer for now. If we want to discuss standardizing on one or the other, we can do that at some point in the future. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213438 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Analysis/IPA/CallGraph.cpp | 2 +- lib/CodeGen/RegAllocBasic.cpp | 2 +- lib/CodeGen/RegAllocGreedy.cpp | 2 +- lib/Support/FileOutputBuffer.cpp | 2 +- utils/TableGen/DAGISelMatcherOpt.cpp | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/Analysis/IPA/CallGraph.cpp b/lib/Analysis/IPA/CallGraph.cpp index caec2534691..dfabb0ad063 100644 --- a/lib/Analysis/IPA/CallGraph.cpp +++ b/lib/Analysis/IPA/CallGraph.cpp @@ -267,7 +267,7 @@ INITIALIZE_PASS(CallGraphWrapperPass, "basiccg", "CallGraph Construction", char CallGraphWrapperPass::ID = 0; -void CallGraphWrapperPass::releaseMemory() { G.reset(nullptr); } +void CallGraphWrapperPass::releaseMemory() { G.reset(); } void CallGraphWrapperPass::print(raw_ostream &OS, const Module *) const { if (!G) { diff --git a/lib/CodeGen/RegAllocBasic.cpp b/lib/CodeGen/RegAllocBasic.cpp index b722098c5c7..6bc678e8521 100644 --- a/lib/CodeGen/RegAllocBasic.cpp +++ b/lib/CodeGen/RegAllocBasic.cpp @@ -157,7 +157,7 @@ void RABasic::getAnalysisUsage(AnalysisUsage &AU) const { } void RABasic::releaseMemory() { - SpillerInstance.reset(nullptr); + SpillerInstance.reset(); } diff --git a/lib/CodeGen/RegAllocGreedy.cpp b/lib/CodeGen/RegAllocGreedy.cpp index 901b993eea8..dee990c2eb5 100644 --- a/lib/CodeGen/RegAllocGreedy.cpp +++ b/lib/CodeGen/RegAllocGreedy.cpp @@ -486,7 +486,7 @@ void RAGreedy::LRE_DidCloneVirtReg(unsigned New, unsigned Old) { } void RAGreedy::releaseMemory() { - SpillerInstance.reset(nullptr); + SpillerInstance.reset(); ExtraRegInfo.clear(); GlobalCand.clear(); } diff --git a/lib/Support/FileOutputBuffer.cpp b/lib/Support/FileOutputBuffer.cpp index 2e740ca0451..94bcdc58a80 100644 --- a/lib/Support/FileOutputBuffer.cpp +++ b/lib/Support/FileOutputBuffer.cpp @@ -87,7 +87,7 @@ FileOutputBuffer::create(StringRef FilePath, size_t Size, std::error_code FileOutputBuffer::commit(int64_t NewSmallerSize) { // Unmap buffer, letting OS flush dirty pages to file on disk. - Region.reset(nullptr); + Region.reset(); // If requested, resize file as part of commit. if ( NewSmallerSize != -1 ) { diff --git a/utils/TableGen/DAGISelMatcherOpt.cpp b/utils/TableGen/DAGISelMatcherOpt.cpp index 0b117eb37c9..da6a9577a77 100644 --- a/utils/TableGen/DAGISelMatcherOpt.cpp +++ b/utils/TableGen/DAGISelMatcherOpt.cpp @@ -400,7 +400,7 @@ static void FactorNodes(std::unique_ptr &MatcherPtr) { } if (NewOptionsToMatch.empty()) { - MatcherPtr.reset(nullptr); + MatcherPtr.reset(); return; }