RegionInfo: Allow to set the parent region of a basic block.
authorTobias Grosser <grosser@fim.uni-passau.de>
Wed, 13 Oct 2010 05:54:07 +0000 (05:54 +0000)
committerTobias Grosser <grosser@fim.uni-passau.de>
Wed, 13 Oct 2010 05:54:07 +0000 (05:54 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116394 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Analysis/RegionInfo.h
lib/Analysis/RegionInfo.cpp

index 7a2670f2c08c27841724071179ee7d5cc7ef27a5..aca13517b57e335b9b5604ee329f547f6fee84e0 100644 (file)
@@ -565,6 +565,12 @@ public:
   /// region containing BB.
   Region *getRegionFor(BasicBlock *BB) const;
 
+  /// @brief  Set the smallest region that surrounds a basic block.
+  ///
+  /// @param BB The basic block surrounded by a region.
+  /// @param R The smallest region that surrounds BB.
+  void setRegionFor(BasicBlock *BB, Region *R);
+
   /// @brief A shortcut for getRegionFor().
   ///
   /// @param BB The basic block.
index 6593f07ff3c4593ed396dc899232f20a215d42c0..99c2eed343d117027f4a324c0812193ac8f65359 100644 (file)
@@ -659,11 +659,14 @@ Region *RegionInfo::getRegionFor(BasicBlock *BB) const {
   return I != BBtoRegion.end() ? I->second : 0;
 }
 
+void RegionInfo::setRegionFor(BasicBlock *BB, Region *R) {
+  BBtoRegion[BB] = R;
+}
+
 Region *RegionInfo::operator[](BasicBlock *BB) const {
   return getRegionFor(BB);
 }
 
-
 BasicBlock *RegionInfo::getMaxRegionExit(BasicBlock *BB) const {
   BasicBlock *Exit = NULL;