[llvm-commits] [llvm] r116394 - in /llvm/trunk: include/llvm/Analysis/RegionInfo.h lib/Analysis/RegionInfo.cpp
Tobias Grosser
grosser at fim.uni-passau.de
Tue Oct 12 22:54:07 PDT 2010
Author: grosser
Date: Wed Oct 13 00:54:07 2010
New Revision: 116394
URL: http://llvm.org/viewvc/llvm-project?rev=116394&view=rev
Log:
RegionInfo: Allow to set the parent region of a basic block.
Modified:
llvm/trunk/include/llvm/Analysis/RegionInfo.h
llvm/trunk/lib/Analysis/RegionInfo.cpp
Modified: llvm/trunk/include/llvm/Analysis/RegionInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/RegionInfo.h?rev=116394&r1=116393&r2=116394&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Analysis/RegionInfo.h (original)
+++ llvm/trunk/include/llvm/Analysis/RegionInfo.h Wed Oct 13 00:54:07 2010
@@ -565,6 +565,12 @@
/// 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.
Modified: llvm/trunk/lib/Analysis/RegionInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/RegionInfo.cpp?rev=116394&r1=116393&r2=116394&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/RegionInfo.cpp (original)
+++ llvm/trunk/lib/Analysis/RegionInfo.cpp Wed Oct 13 00:54:07 2010
@@ -659,11 +659,14 @@
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;
More information about the llvm-commits
mailing list