@@ -1720,6 +1720,7 @@ void LazyCallGraph::addSplitRefRecursiveFunctions(
17201720 for (Function *NewFunction : NewFunctions) {
17211721 Node &NewN = initNode (*NewFunction);
17221722
1723+ // Make the original function reference each new function
17231724 OriginalN->insertEdgeInternal (NewN, Edge::Kind::Ref);
17241725
17251726 // Check if there is any edge from any new function back to any function in
@@ -1732,6 +1733,23 @@ void LazyCallGraph::addSplitRefRecursiveFunctions(
17321733 }
17331734 }
17341735
1736+ for (Function *NewFunction : NewFunctions) {
1737+ Node &NewN = get (*NewFunction);
1738+ for (Function *OtherNewFunction : NewFunctions) {
1739+ if (NewFunction == OtherNewFunction)
1740+ continue ;
1741+
1742+ Node &OtherNewN = get (*OtherNewFunction);
1743+
1744+ // Don't add an edge if one already exists.
1745+ if (NewN->lookup (OtherNewN))
1746+ continue ;
1747+
1748+ // Make the new function reference each other new function
1749+ NewN->insertEdgeInternal (OtherNewN, Edge::Kind::Ref);
1750+ }
1751+ }
1752+
17351753 RefSCC *NewRC;
17361754 if (ExistsRefToOriginalRefSCC) {
17371755 // If there is any edge from any new function to any function in the
@@ -1775,7 +1793,7 @@ void LazyCallGraph::addSplitRefRecursiveFunctions(
17751793 if (F1 == F2)
17761794 continue ;
17771795 Node &N2 = get (*F2);
1778- assert (! N1->lookup (N2) ||
1796+ assert (N1->lookup (N2) &&
17791797 (!N1->lookup (N2)->isCall () &&
17801798 " Edges between new functions must be ref edges" ));
17811799 }
0 commit comments