summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/BranchFolding.cpp
diff options
context:
space:
mode:
authorSimon Pilgrim <llvm-dev@redking.me.uk>2019-10-05 13:20:30 +0000
committerSimon Pilgrim <llvm-dev@redking.me.uk>2019-10-05 13:20:30 +0000
commitf609c0a303e4e20356d565d2bd4ecec76ed7ca7e (patch)
tree54c0bb7502a67c26b1d40fafd979fd372eeaa7f5 /llvm/lib/CodeGen/BranchFolding.cpp
parent375a84bb75a8d00ad1af4c679b8bc42553ef66e1 (diff)
downloadbcm5719-llvm-f609c0a303e4e20356d565d2bd4ecec76ed7ca7e.tar.gz
bcm5719-llvm-f609c0a303e4e20356d565d2bd4ecec76ed7ca7e.zip
BranchFolding - IsBetterFallthrough - assert non-null pointers. NFCI.
Silences static analyzer null dereference warnings. llvm-svn: 373823
Diffstat (limited to 'llvm/lib/CodeGen/BranchFolding.cpp')
-rw-r--r--llvm/lib/CodeGen/BranchFolding.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/BranchFolding.cpp b/llvm/lib/CodeGen/BranchFolding.cpp
index 6c997a73023..b0d1599a5eb 100644
--- a/llvm/lib/CodeGen/BranchFolding.cpp
+++ b/llvm/lib/CodeGen/BranchFolding.cpp
@@ -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
OpenPOWER on IntegriCloud