RegionInfo: Allow to set the parent region of a basic block.
llvm-svn: 116394
This commit is contained in:
parent
f7cfb2212c
commit
8352ce5f8d
|
@ -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.
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue