[passes] Replace the old invalidation lattice with a new invalidation scheme.

The old invalidation lattice was incorrect because changes to control flow could cause changes to the
call graph, so we've decided to change the way passes invalidate analysis.  In the new scheme, the lattice
is replaced with a list of traits that passes preserve or invalidate. The current traits are Calls and Branches.
Now, passes report which traits they preserve, which is the opposite of the previous implementation where
passes needed to report what they invalidate.

Node: I tried to limit the changes in this commit to mechanical changes to ease the review. I will cleanup some
of the code in a following commit.

Swift SVN r26449
This commit is contained in:
Nadav Rotem
2015-03-23 21:18:58 +00:00
parent 5b91651107
commit d78b376d07
49 changed files with 113 additions and 113 deletions

View File

@@ -46,8 +46,8 @@ public:
return S->getKind() == AnalysisKind::LoopInfo;
}
virtual void invalidate(InvalidationKind K) {
if (K >= InvalidationKind::CFG) {
virtual void invalidate(SILAnalysis::PreserveKind K) {
if (!(K & PreserveKind::Branches)) {
for (auto LI : LoopInfos)
delete LI.second;
@@ -56,8 +56,8 @@ public:
}
}
virtual void invalidate(SILFunction* F, InvalidationKind K) {
if (K >= InvalidationKind::CFG) {
virtual void invalidate(SILFunction* F, SILAnalysis::PreserveKind K) {
if (!(K & PreserveKind::Branches)) {
if (LoopInfos.count(F)) {
delete LoopInfos[F];
LoopInfos.erase(F);