Avoid using NO_INST in the parser.

This was only used for the comment rewrite mechanism, and we can just
predict the next allocated instruction number instead. See the other
uses of next_key() for gather_comments().
This commit is contained in:
Jakob Stoklund Olesen
2017-01-19 14:49:55 -08:00
parent bdc0f53c91
commit 1389a51c7a
2 changed files with 11 additions and 19 deletions

View File

@@ -301,6 +301,14 @@ impl DataFlowGraph {
self.insts.push(data)
}
/// Get the instruction reference that will be assigned to the next instruction created by
/// `make_inst`.
///
/// This is only really useful to the parser.
pub fn next_inst(&self) -> Inst {
self.insts.next_key()
}
/// Create result values for an instruction that produces multiple results.
///
/// Instructions that produce 0 or 1 result values only need to be created with `make_inst`. If