mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-22 13:29:44 +00:00
Add SlotIndexes::getMBBRange() to get the range of a basic block in a single
lookup. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121893 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
3928d13808
commit
e69b4ab829
@ -545,18 +545,22 @@ namespace llvm {
|
|||||||
return nextNonNull;
|
return nextNonNull;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns the first index in the given basic block.
|
/// Return the (start,end) range of the given basic block.
|
||||||
SlotIndex getMBBStartIdx(const MachineBasicBlock *mbb) const {
|
const std::pair<SlotIndex, SlotIndex> &
|
||||||
|
getMBBRange(const MachineBasicBlock *mbb) const {
|
||||||
MBB2IdxMap::const_iterator itr = mbb2IdxMap.find(mbb);
|
MBB2IdxMap::const_iterator itr = mbb2IdxMap.find(mbb);
|
||||||
assert(itr != mbb2IdxMap.end() && "MBB not found in maps.");
|
assert(itr != mbb2IdxMap.end() && "MBB not found in maps.");
|
||||||
return itr->second.first;
|
return itr->second;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Returns the first index in the given basic block.
|
||||||
|
SlotIndex getMBBStartIdx(const MachineBasicBlock *mbb) const {
|
||||||
|
return getMBBRange(mbb).first;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns the last index in the given basic block.
|
/// Returns the last index in the given basic block.
|
||||||
SlotIndex getMBBEndIdx(const MachineBasicBlock *mbb) const {
|
SlotIndex getMBBEndIdx(const MachineBasicBlock *mbb) const {
|
||||||
MBB2IdxMap::const_iterator itr = mbb2IdxMap.find(mbb);
|
return getMBBRange(mbb).second;
|
||||||
assert(itr != mbb2IdxMap.end() && "MBB not found in maps.");
|
|
||||||
return itr->second.second;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns the basic block which the given index falls in.
|
/// Returns the basic block which the given index falls in.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user