From 9468df99c11654eda2b53c62d9444578a6daee3f Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Sat, 5 Aug 2017 03:37:39 +0000 Subject: [PATCH] [LCG] When removing a dead function and clearing out the data structures, actually null out the graph pointers as well. We won't ever update these, and we certainly shouldn't be calling any methods on them, so it seems good to defensively nuke them. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310164 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Analysis/LazyCallGraph.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/Analysis/LazyCallGraph.cpp b/lib/Analysis/LazyCallGraph.cpp index b64129b33dc..7d38dd945ab 100644 --- a/lib/Analysis/LazyCallGraph.cpp +++ b/lib/Analysis/LazyCallGraph.cpp @@ -1672,8 +1672,10 @@ void LazyCallGraph::removeDeadFunction(Function &F) { // Finally clear out all the data structures from the node down through the // components. N.clear(); + N.G = nullptr; C.clear(); RC.clear(); + RC.G = nullptr; // Nothing to delete as all the objects are allocated in stable bump pointer // allocators. -- 2.50.1