Turn the analysis invalidation code into an early exit. NFC.

Swift SVN r26450
This commit is contained in:
Nadav Rotem
2015-03-23 21:19:04 +00:00
parent d78b376d07
commit da92b6f81b
4 changed files with 46 additions and 46 deletions

View File

@@ -99,16 +99,16 @@ public:
}
virtual void invalidate(SILAnalysis::PreserveKind K) {
if (!(K & PreserveKind::Branches)) {
FunctionToPOTMap.clear();
}
if (K & PreserveKind::Branches) return;
FunctionToPOTMap.clear();
}
virtual void invalidate(SILFunction* F, SILAnalysis::PreserveKind K) {
if (!(K & PreserveKind::Branches)) {
// Invalidate just this one function. We will lazily recompute it.
FunctionToPOTMap[F].IsInvalidated = true;
}
if (K & PreserveKind::Branches) return;
// Invalidate just this one function. We will lazily recompute it.
FunctionToPOTMap[F].IsInvalidated = true;
}
};