From bf52210e25e2c19203d9e2663d80befb405d385b Mon Sep 17 00:00:00 2001 From: Arthur Eubanks Date: Mon, 13 Dec 2021 13:59:47 -0800 Subject: [PATCH] [NFC][LazyCallGraph] Remove check in removeDeadFunction() if graph is empty If we're in removeDeadFunction(), we should have already constructed the call graph. Differential Revision: https://reviews.llvm.org/D115676 --- llvm/lib/Analysis/LazyCallGraph.cpp | 7 ------- 1 file changed, 7 deletions(-) diff --git a/llvm/lib/Analysis/LazyCallGraph.cpp b/llvm/lib/Analysis/LazyCallGraph.cpp index d3e1aa7c8d9a..ecac2d204f25 100644 --- a/llvm/lib/Analysis/LazyCallGraph.cpp +++ b/llvm/lib/Analysis/LazyCallGraph.cpp @@ -1522,13 +1522,6 @@ void LazyCallGraph::removeDeadFunction(Function &F) { // Remove this from the entry edges if present. EntryEdges.removeEdgeInternal(N); - if (SCCMap.empty()) { - // No SCCs have been formed, so removing this is fine and there is nothing - // else necessary at this point but clearing out the node. - N.clear(); - return; - } - // Cannot remove a function which has yet to be visited in the DFS walk, so // if we have a node at all then we must have an SCC and RefSCC. auto CI = SCCMap.find(&N);