mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Do not build the call graph just to maintain it.
Before this commit, passes that were attempting to maintain the call graph would actually build it if it wasn't already valid, just for the sake of maintaining it. Now we only maintain it if we already had a valid call graph built. Swift SVN r26873
This commit is contained in:
@@ -400,14 +400,15 @@ ApplyInst *swift::ArraySemanticsCall::hoistOrCopy(SILInstruction *InsertBefore,
|
||||
} // End switch.
|
||||
}
|
||||
|
||||
void swift::ArraySemanticsCall::removeCall(CallGraph &CG) {
|
||||
void swift::ArraySemanticsCall::removeCall(CallGraph *CG) {
|
||||
if (getSelfParameterConvention(SemanticsCall) ==
|
||||
ParameterConvention::Direct_Owned)
|
||||
SILBuilderWithScope<1>(SemanticsCall)
|
||||
.createReleaseValue(SemanticsCall->getLoc(), getSelf());
|
||||
|
||||
// Invalidate any information in the callgraph.
|
||||
CG.removeEdgesForApply(SemanticsCall, true/*Ignore Missing*/);
|
||||
if (CG)
|
||||
CG->removeEdgesForApply(SemanticsCall, true/*Ignore Missing*/);
|
||||
|
||||
SemanticsCall->eraseFromParent();
|
||||
SemanticsCall = nullptr;
|
||||
|
||||
Reference in New Issue
Block a user