[llvm] r301807 - Remove unnecessary conditions as suggested by clang-tidy. NFC
David Blaikie via llvm-commits
llvm-commits at lists.llvm.org
Mon May 8 11:22:31 PDT 2017
Any chance of using std::unique_ptr instead of manual memory management
here?
On Mon, May 1, 2017 at 9:31 AM Gabor Horvath via llvm-commits <
llvm-commits at lists.llvm.org> wrote:
> Author: xazax
> Date: Mon May 1 11:18:42 2017
> New Revision: 301807
>
> URL: http://llvm.org/viewvc/llvm-project?rev=301807&view=rev
> Log:
> Remove unnecessary conditions as suggested by clang-tidy. NFC
>
> Patch by: Gergely Angeli!
>
> Differential Revision: https://reviews.llvm.org/D31936
>
> Modified:
> llvm/trunk/lib/CodeGen/DFAPacketizer.cpp
> llvm/trunk/lib/Support/SourceMgr.cpp
> llvm/trunk/lib/Target/TargetLoweringObjectFile.cpp
>
> Modified: llvm/trunk/lib/CodeGen/DFAPacketizer.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/DFAPacketizer.cpp?rev=301807&r1=301806&r2=301807&view=diff
>
> ==============================================================================
> --- llvm/trunk/lib/CodeGen/DFAPacketizer.cpp (original)
> +++ llvm/trunk/lib/CodeGen/DFAPacketizer.cpp Mon May 1 11:18:42 2017
> @@ -213,10 +213,8 @@ VLIWPacketizerList::VLIWPacketizerList(M
>
>
> VLIWPacketizerList::~VLIWPacketizerList() {
> - if (VLIWScheduler)
> - delete VLIWScheduler;
> - if (ResourceTracker)
> - delete ResourceTracker;
> + delete VLIWScheduler;
> + delete ResourceTracker;
> }
>
>
>
> Modified: llvm/trunk/lib/Support/SourceMgr.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/SourceMgr.cpp?rev=301807&r1=301806&r2=301807&view=diff
>
> ==============================================================================
> --- llvm/trunk/lib/Support/SourceMgr.cpp (original)
> +++ llvm/trunk/lib/Support/SourceMgr.cpp Mon May 1 11:18:42 2017
> @@ -51,9 +51,7 @@ static LineNoCacheTy *getCache(void *Ptr
> }
>
> SourceMgr::~SourceMgr() {
> - // Delete the line # cache if allocated.
> - if (LineNoCacheTy *Cache = getCache(LineNoCache))
> - delete Cache;
> + delete getCache(LineNoCache);
> }
>
> unsigned SourceMgr::AddIncludeFile(const std::string &Filename,
>
> Modified: llvm/trunk/lib/Target/TargetLoweringObjectFile.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/TargetLoweringObjectFile.cpp?rev=301807&r1=301806&r2=301807&view=diff
>
> ==============================================================================
> --- llvm/trunk/lib/Target/TargetLoweringObjectFile.cpp (original)
> +++ llvm/trunk/lib/Target/TargetLoweringObjectFile.cpp Mon May 1 11:18:42
> 2017
> @@ -44,7 +44,7 @@ void TargetLoweringObjectFile::Initializ
> const TargetMachine &TM) {
> Ctx = &ctx;
> // `Initialize` can be called more than once.
> - if (Mang != nullptr) delete Mang;
> + delete Mang;
> Mang = new Mangler();
> InitMCObjectFileInfo(TM.getTargetTriple(), TM.isPositionIndependent(),
> TM.getCodeModel(), *Ctx);
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170508/7344b12e/attachment.html>
More information about the llvm-commits
mailing list