[PATCH] D31719: [RegionInfo] Fix dangling references created by moving RegionInfo objects

Michael Kruse via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 6 05:03:04 PDT 2017


Meinersbur added inline comments.


================
Comment at: include/llvm/Analysis/RegionInfo.h:896-903
+  RegionInfo(RegionInfo &&Arg) : Base(std::move(static_cast<Base &>(Arg))) {
+    updateRegionTree(*this, TopLevelRegion);
+  }
   RegionInfo &operator=(RegionInfo &&RHS) {
     Base::operator=(std::move(static_cast<Base &>(RHS)));
+    updateRegionTree(*this, TopLevelRegion);
     return *this;
----------------
Would it be feasible to remove the move-ctors and instead force users to allocate RegionInfo on the heap?


https://reviews.llvm.org/D31719





More information about the llvm-commits mailing list