mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-11-01 15:11:24 +00:00
RegionInfo: Allow to update exit and entry of a region.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116396 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
9649390e1f
commit
4bcc0228dc
@ -257,6 +257,18 @@ public:
|
|||||||
/// @return The entry BasicBlock of the region.
|
/// @return The entry BasicBlock of the region.
|
||||||
BasicBlock *getEntry() const { return RegionNode::getEntry(); }
|
BasicBlock *getEntry() const { return RegionNode::getEntry(); }
|
||||||
|
|
||||||
|
/// @brief Replace the entry basic block of the region with the new basic
|
||||||
|
/// block.
|
||||||
|
///
|
||||||
|
/// @param BB The new entry basic block of the region.
|
||||||
|
void replaceEntry(BasicBlock *BB);
|
||||||
|
|
||||||
|
/// @brief Replace the exit basic block of the region with the new basic
|
||||||
|
/// block.
|
||||||
|
///
|
||||||
|
/// @param BB The new exit basic block of the region.
|
||||||
|
void replaceExit(BasicBlock *BB);
|
||||||
|
|
||||||
/// @brief Get the exit BasicBlock of the Region.
|
/// @brief Get the exit BasicBlock of the Region.
|
||||||
/// @return The exit BasicBlock of the Region, NULL if this is the TopLevel
|
/// @return The exit BasicBlock of the Region, NULL if this is the TopLevel
|
||||||
/// Region.
|
/// Region.
|
||||||
|
@ -72,6 +72,15 @@ Region::~Region() {
|
|||||||
delete *I;
|
delete *I;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Region::replaceEntry(BasicBlock *BB) {
|
||||||
|
entry.setPointer(BB);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Region::replaceExit(BasicBlock *BB) {
|
||||||
|
assert(exit && "No exit to replace!");
|
||||||
|
exit = BB;
|
||||||
|
}
|
||||||
|
|
||||||
bool Region::contains(const BasicBlock *B) const {
|
bool Region::contains(const BasicBlock *B) const {
|
||||||
BasicBlock *BB = const_cast<BasicBlock*>(B);
|
BasicBlock *BB = const_cast<BasicBlock*>(B);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user