@@ -1120,9 +1120,6 @@ pub enum AllocationKind {
1120
1120
///
1121
1121
/// (This trait's design is inspired by, and derives heavily from, the
1122
1122
/// trait of the same name in regalloc.rs.)
1123
- ///
1124
- /// The ids used in [`Block`] and [`VReg`] must start their numbering
1125
- /// at zero and be sequential.
1126
1123
pub trait Function {
1127
1124
// -------------
1128
1125
// CFG traversal
@@ -1131,7 +1128,13 @@ pub trait Function {
1131
1128
/// How many instructions are there?
1132
1129
fn num_insts ( & self ) -> usize ;
1133
1130
1134
- /// How many blocks are there?
1131
+ /// Number of entries to allocate [`Block`] storage for.
1132
+ ///
1133
+ /// The block ids are used as indices into a container, this
1134
+ /// container is allocated with this number of elements. This means
1135
+ /// that the value returned here must be the highest block index in
1136
+ /// the function plus one. The block indices themselves need not be
1137
+ /// consecutive.
1135
1138
fn num_blocks ( & self ) -> usize ;
1136
1139
1137
1140
/// Get the index of the entry block.
@@ -1201,7 +1204,13 @@ pub trait Function {
1201
1204
/// value(s).
1202
1205
fn inst_clobbers ( & self , insn : Inst ) -> PRegSet ;
1203
1206
1204
- /// Get the number of `VReg` in use in this function.
1207
+ /// Number of entries to allocate [`VReg`] storage for.
1208
+ ///
1209
+ /// The VReg ids are used as indices into a container, this
1210
+ /// container is allocated with this number of elements. This
1211
+ /// means that the value returned here must be the highest block
1212
+ /// index in the function plus one. The vreg indices themselves
1213
+ /// need not be consecutive.
1205
1214
fn num_vregs ( & self ) -> usize ;
1206
1215
1207
1216
/// Get the VRegs for which we should generate value-location
0 commit comments