[llvm] eca9caf - [LazyCallGraph] Assert in removeDeadFunction() that NodeMap contains function

Arthur Eubanks via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 4 13:35:50 PDT 2024


Author: Arthur Eubanks
Date: 2024-06-04T20:35:33Z
New Revision: eca9caf419d420604ab372ddcab4781e999c1fe4

URL: https://github.com/llvm/llvm-project/commit/eca9caf419d420604ab372ddcab4781e999c1fe4
DIFF: https://github.com/llvm/llvm-project/commit/eca9caf419d420604ab372ddcab4781e999c1fe4.diff

LOG: [LazyCallGraph] Assert in removeDeadFunction() that NodeMap contains function

The function should always be known to LazyCallGraph

Added: 
    

Modified: 
    llvm/lib/Analysis/LazyCallGraph.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Analysis/LazyCallGraph.cpp b/llvm/lib/Analysis/LazyCallGraph.cpp
index 473ae75b5d251..1e5cf84d589b0 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;
 


        


More information about the llvm-commits mailing list