mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Add CallGraphEditor helper class and use it in the inliner.
Swift SVN r27008
This commit is contained in:
@@ -523,6 +523,23 @@ void CallGraph::verify() const {
|
||||
#endif
|
||||
}
|
||||
|
||||
void CallGraphEditor::replaceApplyWithNew(FullApplySite Old,
|
||||
FullApplySite New) {
|
||||
if (auto *Edge = CG.getCallGraphEdge(Old))
|
||||
CG.removeEdge(Edge);
|
||||
|
||||
CG.addEdgesForApply(New);
|
||||
}
|
||||
|
||||
void CallGraphEditor::replaceApplyWithNew(FullApplySite Old,
|
||||
llvm::SmallVectorImpl<FullApplySite> &NewApplies) {
|
||||
if (auto *Edge = CG.getCallGraphEdge(Old))
|
||||
CG.removeEdge(Edge);
|
||||
|
||||
for (auto NewApply : NewApplies)
|
||||
CG.addEdgesForApply(NewApply);
|
||||
}
|
||||
|
||||
void CallGraphAnalysis::verify() const {
|
||||
#ifndef NDEBUG
|
||||
// If we don't have a callgraph, return.
|
||||
|
||||
Reference in New Issue
Block a user