From: Sanjoy Das Date: Thu, 12 Nov 2015 20:51:49 +0000 (+0000) Subject: [ImplicitNulls] Fix wrapping by breaking up a condition, NFC X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=13036d4421ad57e5b1d9ea98e31b9a67a56dd7fe;p=oota-llvm.git [ImplicitNulls] Fix wrapping by breaking up a condition, NFC git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252947 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/ImplicitNullChecks.cpp b/lib/CodeGen/ImplicitNullChecks.cpp index 8e24c860c05..dbfdbe9d6a6 100644 --- a/lib/CodeGen/ImplicitNullChecks.cpp +++ b/lib/CodeGen/ImplicitNullChecks.cpp @@ -225,10 +225,10 @@ bool ImplicitNullChecks::analyzeBlockForNullChecks( MachineBasicBlock &MBB, SmallVectorImpl &NullCheckList) { typedef TargetInstrInfo::MachineBranchPredicate MachineBranchPredicate; - MDNode *BranchMD = - MBB.getBasicBlock() - ? MBB.getBasicBlock()->getTerminator()->getMetadata(LLVMContext::MD_make_implicit) - : nullptr; + MDNode *BranchMD = nullptr; + if (auto *BB = MBB.getBasicBlock()) + BranchMD = BB->getTerminator()->getMetadata(LLVMContext::MD_make_implicit); + if (!BranchMD) return false;