Remove unnecessary conditions as suggested by clang-tidy. NFC

Patch by: Gergely Angeli!

Differential Revision: https://reviews.llvm.org/D31936


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301807 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Gabor Horvath 2017-05-01 16:18:42 +00:00
parent 4e5c5db786
commit 4d5ff6d8d6
3 changed files with 4 additions and 8 deletions

View File

@ -213,10 +213,8 @@ VLIWPacketizerList::VLIWPacketizerList(MachineFunction &mf,
VLIWPacketizerList::~VLIWPacketizerList() {
if (VLIWScheduler)
delete VLIWScheduler;
if (ResourceTracker)
delete ResourceTracker;
delete VLIWScheduler;
delete ResourceTracker;
}

View File

@ -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,

View File

@ -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);