ScopInfo: Add function to invalidate ScopArrayInfo object
authorTobias Grosser <tobias@grosser.es>
Sat, 27 Feb 2016 06:04:40 +0000 (06:04 +0000)
committerTobias Grosser <tobias@grosser.es>
Sat, 27 Feb 2016 06:04:40 +0000 (06:04 +0000)
In case the underlying basepointer of a ScopArrayInfo object is moved to another
module while the scop is still processed is it necessary to free dependent
ScopArrayInfo objects as they might otherwise be looked accidentally when a
new llvm basepointer value is reassigned the very same memory location as the
llvm value that has been moved earlier.

This function is not yet used in Polly itself, but is useful for external users.

llvm-svn: 262113

polly/include/polly/ScopInfo.h

index 0bcc87c..e298b96 100644 (file)
@@ -1931,6 +1931,14 @@ public:
   const ScopArrayInfo *getScopArrayInfo(Value *BasePtr,
                                         ScopArrayInfo::MemoryKind Kind);
 
+  /// @brief Invalidate ScopArrayInfo object for base address.
+  ///
+  /// @param BasePtr The base pointer of the ScopArrayInfo object to invalidate.
+  /// @param Kind    The Kind of the ScopArrayInfo object.
+  void invalidateScopArrayInfo(Value *BasePtr, ScopArrayInfo::MemoryKind Kind) {
+    ScopArrayInfoMap.erase(std::make_pair(BasePtr, Kind));
+  }
+
   void setContext(isl_set *NewContext);
 
   /// @brief Align the parameters in the statement to the scop context