diff --git a/llvm/include/llvm/Support/GenericDomTree.h b/llvm/include/llvm/Support/GenericDomTree.h --- a/llvm/include/llvm/Support/GenericDomTree.h +++ b/llvm/include/llvm/Support/GenericDomTree.h @@ -480,8 +480,7 @@ DomTreeNodeBase *NodeA = getNode(A); DomTreeNodeBase *NodeB = getNode(B); - - if (!NodeA || !NodeB) return nullptr; + assert(NodeA && NodeB); // Use level information to go up the tree until the levels match. Then // continue going up til we arrive at the same node. @@ -491,7 +490,7 @@ NodeA = NodeA->IDom; } - return NodeA ? NodeA->getBlock() : nullptr; + return NodeA->getBlock(); } const NodeT *findNearestCommonDominator(const NodeT *A,