Use own class for storing the RejectLogs

Use a container class to store the reject logs. Delegating most calls to
the internal std::map and add a few convenient shortcuts (e.g.,
hasErrors()).

llvm-svn: 211780
diff --git a/polly/lib/Analysis/ScopDetection.cpp b/polly/lib/Analysis/ScopDetection.cpp
index d63db25..be147cc 100644
--- a/polly/lib/Analysis/ScopDetection.cpp
+++ b/polly/lib/Analysis/ScopDetection.cpp
@@ -707,12 +707,8 @@
   bool RegionIsValid = isValidRegion(Context);
   bool HasErrors = !RegionIsValid || Context.Log.size() > 0;
 
-  if (PollyTrackFailures && HasErrors) {
-    // std::map::insert does not replace.
-    std::pair<reject_iterator, bool> InsertedValue =
-        RejectLogs.insert(std::make_pair(&R, Context.Log));
-    assert(InsertedValue.second && "Two logs generated for the same Region.");
-  }
+  if (PollyTrackFailures && HasErrors)
+    RejectLogs.insert(std::make_pair(&R, Context.Log));
 
   return RegionIsValid;
 }