Cranelift: Remove the LowerCtx trait (#4697)
The trait had only one implementation: the `Lower` struct. It is easier to just use that directly, and not introduce unnecessary layers of generics and abstractions. Once upon a time, there was hope that we would have other implementations of the `LowerCtx` trait, that did things like lower CLIF to SMTLIB for verification. However, this is not practical these days given the way that the trait has evolved over time, and our verification efforts are focused on ISLE now anyways, and we're actually making some progress on that front (much more than anyone ever did on a second `LowerCtx` trait implementation!)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
//! A place to park MachInst::Inst fragments which are common across multiple architectures.
|
||||
|
||||
use super::{LowerCtx, VCodeInst};
|
||||
use super::{Lower, VCodeInst};
|
||||
use crate::ir::{self, Inst as IRInst};
|
||||
use smallvec::SmallVec;
|
||||
|
||||
@@ -24,17 +24,14 @@ pub(crate) struct InsnOutput {
|
||||
pub(crate) output: usize,
|
||||
}
|
||||
|
||||
pub(crate) fn insn_inputs<I: VCodeInst, C: LowerCtx<I = I>>(
|
||||
ctx: &C,
|
||||
insn: IRInst,
|
||||
) -> SmallVec<[InsnInput; 4]> {
|
||||
pub(crate) fn insn_inputs<I: VCodeInst>(ctx: &Lower<I>, insn: IRInst) -> SmallVec<[InsnInput; 4]> {
|
||||
(0..ctx.num_inputs(insn))
|
||||
.map(|i| InsnInput { insn, input: i })
|
||||
.collect()
|
||||
}
|
||||
|
||||
pub(crate) fn insn_outputs<I: VCodeInst, C: LowerCtx<I = I>>(
|
||||
ctx: &C,
|
||||
pub(crate) fn insn_outputs<I: VCodeInst>(
|
||||
ctx: &Lower<I>,
|
||||
insn: IRInst,
|
||||
) -> SmallVec<[InsnOutput; 4]> {
|
||||
(0..ctx.num_outputs(insn))
|
||||
|
||||
Reference in New Issue
Block a user