File tree Expand file tree Collapse file tree 2 files changed +5
-19
lines changed Expand file tree Collapse file tree 2 files changed +5
-19
lines changed Original file line number Diff line number Diff line change @@ -1086,7 +1086,10 @@ class LazyCallGraph {
10861086 // / other new functions.
10871087 // /
10881088 // / Mark the original function as referencing all new functions.
1089- // / Mark all new functions as referencing each other.
1089+ // /
1090+ // / The CG must be updated following the use of this helper, for example with
1091+ // / updateCGAndAnalysisManagerForCGSCCPass(), to ensure the RefSCCs and SCCs
1092+ // / are correct.
10901093 void addSplitRefRecursiveFunctions (Function &OriginalFunction,
10911094 ArrayRef<Function *> NewFunctions);
10921095
Original file line number Diff line number Diff line change @@ -1733,23 +1733,6 @@ void LazyCallGraph::addSplitRefRecursiveFunctions(
17331733 }
17341734 }
17351735
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-
17531736 RefSCC *NewRC;
17541737 if (ExistsRefToOriginalRefSCC) {
17551738 // If there is any edge from any new function to any function in the
@@ -1793,7 +1776,7 @@ void LazyCallGraph::addSplitRefRecursiveFunctions(
17931776 if (F1 == F2)
17941777 continue ;
17951778 Node &N2 = get (*F2);
1796- assert (N1->lookup (N2) &&
1779+ assert (! N1->lookup (N2) ||
17971780 (!N1->lookup (N2)->isCall () &&
17981781 " Edges between new functions must be ref edges" ));
17991782 }
You can’t perform that action at this time.
0 commit comments