@@ -345,7 +345,6 @@ class CallGraph {
345
345
friend struct OrderedCallGraph ;
346
346
#endif
347
347
348
- friend class CallGraphEditor ;
349
348
friend class CallGraphLinkerEditor ;
350
349
351
350
CallGraph (SILModule *M, bool completeModule);
@@ -514,87 +513,6 @@ class CallGraph {
514
513
void computeBottomUpFunctionOrder ();
515
514
};
516
515
517
- class CallGraphEditor {
518
- CallGraph *CG;
519
- public:
520
- CallGraphEditor (CallGraph *CG) : CG(CG) {}
521
-
522
- void replaceApplyWithNew (FullApplySite Old, FullApplySite New);
523
- void replaceApplyWithCallSites (FullApplySite Old,
524
- llvm::SmallVectorImpl<SILInstruction *> &NewCallSites);
525
-
526
- // / Detaches the call graph node from function \p Old and attaches it to
527
- // / function \a New.
528
- void moveNodeToNewFunction (SILFunction *Old, SILFunction *New);
529
-
530
- // / Removes all callee edges from function.
531
- void removeAllCalleeEdgesFrom (SILFunction *F);
532
-
533
- // / Removes all caller edges from function.
534
- void removeAllCallerEdgesFrom (SILFunction *F);
535
-
536
- // / Creates a new node for function \p F and adds callee edges for all
537
- // / call sites in the function.
538
- void addNewFunction (SILFunction *F) {
539
- if (CG && !CG->tryGetCallGraphNode (F)) {
540
- CG->addCallGraphNode (F);
541
- CG->addEdges (F);
542
- }
543
- }
544
-
545
- // / Removes the call graph node of function \p F. The node may have any
546
- // / adjacent caller or callee edges.
547
- void removeCallGraphNode (SILFunction *F) {
548
- if (CG)
549
- CG->removeNode (CG->getCallGraphNode (F));
550
- }
551
-
552
- // / Removes edges for the instruction \p I.
553
- void removeEdgesForInstruction (SILInstruction *I) {
554
- if (CG)
555
- CG->removeEdgesForInstruction (I);
556
- }
557
-
558
- // / Checks which function(s) are called by instruction \p I and adds
559
- // / edges to the call graph for it.
560
- void addEdgesForInstruction (SILInstruction *I) {
561
- if (CG)
562
- CG->addEdgesForInstruction (I);
563
- }
564
-
565
- // / Update uses of a changed apply site which is not a full apply
566
- // / site. If a use is a full apply site, its call graph edge is
567
- // / updated.
568
- void updatePartialApplyUses (ApplySite AI);
569
-
570
- void addEdgesForFunction (SILFunction *F) {
571
- if (CG)
572
- CG->addEdges (F);
573
- }
574
-
575
- void removeEdgeIfPresent (SILInstruction *I) {
576
- if (CG)
577
- if (auto *Edge = CG->tryGetCallGraphEdge (I))
578
- CG->removeEdgeFromFunction (Edge, I->getFunction ());
579
- }
580
-
581
- // / Drops all references in function and removes the references to
582
- // / instructions in the function from the call graph.
583
- void dropAllReferences (SILFunction *F) {
584
- F->dropAllReferences ();
585
-
586
- if (CG) {
587
- removeAllCalleeEdgesFrom (F);
588
- removeAllCallerEdgesFrom (F);
589
- CG->removeFunctionFromCalleeSets (F);
590
- }
591
- }
592
-
593
- // / Erase the function from the module and any references to it from
594
- // / the call graph.
595
- void eraseFunction (SILFunction *F);
596
- };
597
-
598
516
class CallGraphLinkerEditor {
599
517
CallGraph *CG;
600
518
0 commit comments