diff --git a/cranelift/codegen/src/lib.rs b/cranelift/codegen/src/lib.rs index 331c8f81b7..2f7d4d268b 100644 --- a/cranelift/codegen/src/lib.rs +++ b/cranelift/codegen/src/lib.rs @@ -77,7 +77,6 @@ pub mod flowgraph; pub mod ir; pub mod isa; pub mod loop_analysis; -pub mod machinst; pub mod print_errors; pub mod settings; pub mod timing; @@ -85,6 +84,7 @@ pub mod verifier; pub mod write; pub use crate::entity::packed_option; +pub use crate::machinst::buffer::MachSrcLoc; mod abi; mod bitset; @@ -98,6 +98,7 @@ mod iterators; mod legalizer; mod licm; mod log; +mod machinst; mod nan_canonicalization; mod partition_slice; mod postopt; diff --git a/cranelift/codegen/src/machinst/blockorder.rs b/cranelift/codegen/src/machinst/blockorder.rs index 1052d83858..ff82204c82 100644 --- a/cranelift/codegen/src/machinst/blockorder.rs +++ b/cranelift/codegen/src/machinst/blockorder.rs @@ -420,25 +420,11 @@ impl BlockLoweringOrder { &self.lowered_order[..] } - /// Get the successors for a lowered block, by index in `lowered_order()`'s - /// returned slice. Each successsor is paired with the edge-instruction - /// (branch) corresponding to this edge. - pub fn succs(&self, block: BlockIndex) -> &[(Inst, LoweredBlock)] { - let range = self.lowered_succ_ranges[block as usize]; - &self.lowered_succs[range.0..range.1] - } - /// Get the successor indices for a lowered block. pub fn succ_indices(&self, block: BlockIndex) -> &[(Inst, BlockIndex)] { let range = self.lowered_succ_ranges[block as usize]; &self.lowered_succ_indices[range.0..range.1] } - - /// Get the lowered block index containing a CLIF block, if any. (May not be - /// present if the original CLIF block was unreachable.) - pub fn lowered_block_for_bb(&self, bb: Block) -> Option { - self.orig_map[bb] - } } #[cfg(test)] diff --git a/cranelift/codegen/src/machinst/vcode.rs b/cranelift/codegen/src/machinst/vcode.rs index c27f1e00ee..bd3bfbab85 100644 --- a/cranelift/codegen/src/machinst/vcode.rs +++ b/cranelift/codegen/src/machinst/vcode.rs @@ -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; /// 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 VCodeBuilder { } } - /// 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 VCodeBuilder { } } - /// 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 VCode { 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 VCode { 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() diff --git a/crates/cranelift/src/lib.rs b/crates/cranelift/src/lib.rs index 33be7e5e22..4261b8c886 100644 --- a/crates/cranelift/src/lib.rs +++ b/crates/cranelift/src/lib.rs @@ -91,8 +91,8 @@ use crate::func_environ::{get_func_name, FuncEnvironment}; use cranelift_codegen::ir::{self, ExternalName}; use cranelift_codegen::isa::{CallConv, TargetIsa}; -use cranelift_codegen::machinst::buffer::MachSrcLoc; use cranelift_codegen::print_errors::pretty_error; +use cranelift_codegen::MachSrcLoc; use cranelift_codegen::{binemit, isa, Context}; use cranelift_wasm::{DefinedFuncIndex, FuncIndex, FuncTranslator, SignatureIndex, WasmType}; use std::convert::TryFrom;