ScopDetection: Update DetectionContextMap accordingly
When verifying if a scop is still valid we rerun all analysis, but did not
update DetectionContextMap. This change ensures that information, e.g. about
non-affine regions, is correctly updated
llvm-svn: 251227
diff --git a/polly/lib/Analysis/ScopDetection.cpp b/polly/lib/Analysis/ScopDetection.cpp
index f0b5df1..79461c8 100644
--- a/polly/lib/Analysis/ScopDetection.cpp
+++ b/polly/lib/Analysis/ScopDetection.cpp
@@ -254,7 +254,11 @@
return false;
if (Verify) {
- DetectionContext Context(const_cast<Region &>(R), *AA, false /*verifying*/);
+ DetectionContextMap.erase(&R);
+ const auto &It = DetectionContextMap.insert(
+ std::make_pair(&R, DetectionContext(const_cast<Region &>(R), *AA,
+ false /*verifying*/)));
+ DetectionContext &Context = It.first->second;
return isValidRegion(Context);
}