diff options
Diffstat (limited to 'llvm/lib/Transforms/Utils/CallGraphUpdater.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/CallGraphUpdater.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Utils/CallGraphUpdater.cpp b/llvm/lib/Transforms/Utils/CallGraphUpdater.cpp index 8cdf01e..8060e50ab 100644 --- a/llvm/lib/Transforms/Utils/CallGraphUpdater.cpp +++ b/llvm/lib/Transforms/Utils/CallGraphUpdater.cpp @@ -112,8 +112,11 @@ void CallGraphUpdater::removeFunction(Function &DeadFn) { DeadFunctions.push_back(&DeadFn); // For the old call graph we remove the function from the SCC right away. - if (CG && !ReplacedFunctions.count(&DeadFn)) - CGSCC->DeleteNode((*CG)[&DeadFn]); + if (CG && !ReplacedFunctions.count(&DeadFn)) { + CallGraphNode *DeadCGN = (*CG)[&DeadFn]; + DeadCGN->removeAllCalledFunctions(); + CGSCC->DeleteNode(DeadCGN); + } } void CallGraphUpdater::replaceFunctionWith(Function &OldFn, Function &NewFn) { |