OSDN Git Service

[LCG] When removing a dead function and clearing out the data
authorChandler Carruth <chandlerc@gmail.com>
Sat, 5 Aug 2017 03:37:39 +0000 (03:37 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Sat, 5 Aug 2017 03:37:39 +0000 (03:37 +0000)
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

index b64129b..7d38dd9 100644 (file)
@@ -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.