mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-14 11:32:34 +00:00
Add MachineBasicBlock2IndexFunctor. This is useful for densemaps from
MachineBasicBlocks to an arbitrary type. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16068 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
fc093bd081
commit
6177d3f448
@ -220,6 +220,16 @@ private: // Methods used to maintain doubly linked list of blocks...
|
||||
}
|
||||
};
|
||||
|
||||
// This is useful when building DenseMaps keyed on MachineBasicBlocks
|
||||
struct MachineBasicBlock2IndexFunctor
|
||||
: std::unary_function<const MachineBasicBlock*, unsigned> {
|
||||
unsigned operator()(const MachineBasicBlock* MBB) const {
|
||||
assert(MBB->getNumber() != -1 &&
|
||||
"MachineBasicBlock does not belong to a MachineFunction");
|
||||
return MBB->getNumber();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
//===--------------------------------------------------------------------===//
|
||||
// GraphTraits specializations for machine basic block graphs (machine-CFGs)
|
||||
|
Loading…
Reference in New Issue
Block a user