MachineBasicBlocks to an arbitrary type.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16068
91177308-0d34-0410-b5e6-
96231b3b80d8
}
};
+// 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)