[llvm] r252947 - [ImplicitNulls] Fix wrapping by breaking up a condition, NFC
Sanjoy Das via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 12 12:51:49 PST 2015
Author: sanjoy
Date: Thu Nov 12 14:51:49 2015
New Revision: 252947
URL: http://llvm.org/viewvc/llvm-project?rev=252947&view=rev
Log:
[ImplicitNulls] Fix wrapping by breaking up a condition, NFC
Modified:
llvm/trunk/lib/CodeGen/ImplicitNullChecks.cpp
Modified: llvm/trunk/lib/CodeGen/ImplicitNullChecks.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/ImplicitNullChecks.cpp?rev=252947&r1=252946&r2=252947&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/ImplicitNullChecks.cpp (original)
+++ llvm/trunk/lib/CodeGen/ImplicitNullChecks.cpp Thu Nov 12 14:51:49 2015
@@ -225,10 +225,10 @@ bool ImplicitNullChecks::analyzeBlockFor
MachineBasicBlock &MBB, SmallVectorImpl<NullCheck> &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;
More information about the llvm-commits
mailing list