Remove unused code in machinst

This commit is contained in:
Benjamin Bouvier
2021-04-14 11:51:41 +02:00
parent aa5d837428
commit 91c65d739f
4 changed files with 3 additions and 48 deletions

View File

@@ -41,8 +41,6 @@ use std::string::String;
pub type InsnIndex = u32;
/// Index referring to a basic block in VCode.
pub type BlockIndex = u32;
/// Range of an instructions in VCode.
pub type InsnRange = core::ops::Range<InsnIndex>;
/// VCodeInst wraps all requirements for a MachInst to be in VCode: it must be
/// a `MachInst` and it must be able to emit itself at least to a `SizeCodeSink`.
@@ -207,11 +205,6 @@ impl<I: VCodeInst> VCodeBuilder<I> {
}
}
/// Are there any reference-typed values at all among the vregs?
pub fn have_ref_values(&self) -> bool {
self.vcode.have_ref_values()
}
/// Set the current block as the entry block.
pub fn set_entry(&mut self, block: BlockIndex) {
self.vcode.entry = block;
@@ -264,11 +257,6 @@ impl<I: VCodeInst> VCodeBuilder<I> {
}
}
/// Get the current source location.
pub fn get_srcloc(&self) -> SourceLoc {
self.cur_srcloc
}
/// Set the current source location.
pub fn set_srcloc(&mut self, srcloc: SourceLoc) {
self.cur_srcloc = srcloc;
@@ -344,16 +332,6 @@ impl<I: VCodeInst> VCode<I> {
self.vreg_types[vreg.get_index()]
}
/// Are there any reference-typed values at all among the vregs?
pub fn have_ref_values(&self) -> bool {
self.have_ref_values
}
/// Get the entry block.
pub fn entry(&self) -> BlockIndex {
self.entry
}
/// Get the number of blocks. Block indices will be in the range `0 ..
/// (self.num_blocks() - 1)`.
pub fn num_blocks(&self) -> usize {
@@ -365,11 +343,6 @@ impl<I: VCodeInst> VCode<I> {
self.abi.frame_size()
}
/// Inbound stack-args size.
pub fn stack_args_size(&self) -> u32 {
self.abi.stack_args_size()
}
/// Get the successors for a block.
pub fn succs(&self, block: BlockIndex) -> &[BlockIx] {
let (start, end) = self.block_succ_range[block as usize];
@@ -886,11 +859,6 @@ impl VCodeConstants {
}
}
/// Retrieve a byte slice for the given [VCodeConstant], if available.
pub fn get(&self, constant: VCodeConstant) -> Option<&[u8]> {
self.constants.get(constant).map(|d| d.as_slice())
}
/// Return the number of constants inserted.
pub fn len(&self) -> usize {
self.constants.len()