Lock invalidations of the call graph during COWArrayOpt.

We already preserve the call graph, so we should not allow it to be
invalidated.

Swift SVN r27012
This commit is contained in:
Mark Lacey
2015-04-05 04:53:47 +00:00
parent fb87132f72
commit a57bfed2d1

View File

@@ -1757,7 +1757,8 @@ class SwiftArrayOptPass : public SILFunctionTransform {
DominanceAnalysis *DA = PM->getAnalysis<DominanceAnalysis>();
SILLoopAnalysis *LA = PM->getAnalysis<SILLoopAnalysis>();
SILLoopInfo *LI = LA->getLoopInfo(getFunction());
CallGraph *CG = PM->getAnalysis<CallGraphAnalysis>()->getCallGraphOrNull();
CallGraphAnalysis *CGA = PM->getAnalysis<CallGraphAnalysis>();
CallGraph *CG = CGA->getCallGraphOrNull();
bool HasChanged = false;
@@ -1804,7 +1805,9 @@ class SwiftArrayOptPass : public SILFunctionTransform {
if (HasChanged) {
// We preserve the dominator tree. Let's invalidate everything else.
DA->lockInvalidation();
CGA->lockInvalidation();
invalidateAnalysis(SILAnalysis::PreserveKind::Nothing);
CGA->unlockInvalidation();
DA->unlockInvalidation();
}
}