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:
@@ -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> {
|
||||
|
||||
Reference in New Issue
Block a user