diff options
| author | Gabor Horvath <xazax.hun@gmail.com> | 2017-05-01 16:18:42 +0000 |
|---|---|---|
| committer | Gabor Horvath <xazax.hun@gmail.com> | 2017-05-01 16:18:42 +0000 |
| commit | 43b72d538f9f76afd38a59423e587083801125e8 (patch) | |
| tree | ec031c25421027a201c3dbcdb6a2058554fdf13d /llvm/lib | |
| parent | 6b1b630a984bbb3c5f1fcc01d02770d98ebb6d6a (diff) | |
| download | bcm5719-llvm-43b72d538f9f76afd38a59423e587083801125e8.tar.gz bcm5719-llvm-43b72d538f9f76afd38a59423e587083801125e8.zip | |
Remove unnecessary conditions as suggested by clang-tidy. NFC
Patch by: Gergely Angeli!
Differential Revision: https://reviews.llvm.org/D31936
llvm-svn: 301807
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/CodeGen/DFAPacketizer.cpp | 6 | ||||
| -rw-r--r-- | llvm/lib/Support/SourceMgr.cpp | 4 | ||||
| -rw-r--r-- | llvm/lib/Target/TargetLoweringObjectFile.cpp | 2 |
3 files changed, 4 insertions, 8 deletions
diff --git a/llvm/lib/CodeGen/DFAPacketizer.cpp b/llvm/lib/CodeGen/DFAPacketizer.cpp index 7b1b2d64fcc..65f58e5686e 100644 --- a/llvm/lib/CodeGen/DFAPacketizer.cpp +++ b/llvm/lib/CodeGen/DFAPacketizer.cpp @@ -213,10 +213,8 @@ VLIWPacketizerList::VLIWPacketizerList(MachineFunction &mf, VLIWPacketizerList::~VLIWPacketizerList() { - if (VLIWScheduler) - delete VLIWScheduler; - if (ResourceTracker) - delete ResourceTracker; + delete VLIWScheduler; + delete ResourceTracker; } diff --git a/llvm/lib/Support/SourceMgr.cpp b/llvm/lib/Support/SourceMgr.cpp index ca2391c10ff..5199fad7d9e 100644 --- a/llvm/lib/Support/SourceMgr.cpp +++ b/llvm/lib/Support/SourceMgr.cpp @@ -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, diff --git a/llvm/lib/Target/TargetLoweringObjectFile.cpp b/llvm/lib/Target/TargetLoweringObjectFile.cpp index 50272fda56d..91cc97e38b3 100644 --- a/llvm/lib/Target/TargetLoweringObjectFile.cpp +++ b/llvm/lib/Target/TargetLoweringObjectFile.cpp @@ -44,7 +44,7 @@ void TargetLoweringObjectFile::Initialize(MCContext &ctx, 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); |

