]> granicus.if.org Git - llvm/commitdiff
BranchFolding - IsBetterFallthrough - assert non-null pointers. NFCI.
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Sat, 5 Oct 2019 13:20:30 +0000 (13:20 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Sat, 5 Oct 2019 13:20:30 +0000 (13:20 +0000)
Silences static analyzer null dereference warnings.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373823 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/BranchFolding.cpp

index 6c997a73023bca9c53bb3581e578317b067130dd..b0d1599a5ebcf2f53dbc357f65d915649a1adae5 100644 (file)
@@ -1307,6 +1307,8 @@ static bool IsBranchOnlyBlock(MachineBasicBlock *MBB) {
 /// result in infinite loops.
 static bool IsBetterFallthrough(MachineBasicBlock *MBB1,
                                 MachineBasicBlock *MBB2) {
+  assert(MBB1 && MBB2 && "Unknown MachineBasicBlock");
+
   // Right now, we use a simple heuristic.  If MBB2 ends with a call, and
   // MBB1 doesn't, we prefer to fall through into MBB1.  This allows us to
   // optimize branches that branch to either a return block or an assert block