ISLE: Re-implement ValueSlice (#3784)

The current definition of `ValueSlice` is not usable, since any call to
a constructor returning a `ValueSlice` will extend the mutable borrow
on the context taken by the constructor call, with the result that it
cannot be passed to any other constructor ever.

Re-implement `ValueSlice` as a pair of a `ValueList` identifer plus an
offset into the list.  This type can simply be copied without requiring
a borrow on the context.
This commit is contained in:
Ulrich Weigand
2022-02-25 00:24:40 +01:00
committed by GitHub
parent 07d615d3f7
commit b064e60087
9 changed files with 157 additions and 110 deletions

View File

@@ -699,6 +699,11 @@ impl DataFlowGraph {
self.results[inst].as_slice(&self.value_lists)
}
/// Return all the results of an instruction as ValueList.
pub fn inst_results_list(&self, inst: Inst) -> ValueList {
self.results[inst]
}
/// Get the call signature of a direct or indirect call instruction.
/// Returns `None` if `inst` is not a call instruction.
pub fn call_signature(&self, inst: Inst) -> Option<SigRef> {