1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 03:33:20 +01:00

RegionInfo: Allow to set the parent region of a basic block.

llvm-svn: 116394
This commit is contained in:
Tobias Grosser 2010-10-13 05:54:07 +00:00
parent 16d5617ec3
commit a2b5df5a6d
2 changed files with 10 additions and 1 deletions

View 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.

View 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;