From eca9caf419d420604ab372ddcab4781e999c1fe4 Mon Sep 17 00:00:00 2001 From: Arthur Eubanks Date: Tue, 4 Jun 2024 20:28:16 +0000 Subject: [PATCH] [LazyCallGraph] Assert in removeDeadFunction() that NodeMap contains function The function should always be known to LazyCallGraph --- llvm/lib/Analysis/LazyCallGraph.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/llvm/lib/Analysis/LazyCallGraph.cpp b/llvm/lib/Analysis/LazyCallGraph.cpp index 473ae75b5d251e..1e5cf84d589b02 100644 --- a/llvm/lib/Analysis/LazyCallGraph.cpp +++ b/llvm/lib/Analysis/LazyCallGraph.cpp @@ -1503,9 +1503,7 @@ void LazyCallGraph::removeDeadFunction(Function &F) { "Must not remove lib functions from the call graph!"); auto NI = NodeMap.find(&F); - if (NI == NodeMap.end()) - // Not in the graph at all! - return; + assert(NI != NodeMap.end() && "Removed function should be known!"); Node &N = *NI->second;