Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove dead code #4300

Merged
merged 1 commit into from
Dec 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion crates/cli-support/src/js/binding.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1246,7 +1246,6 @@ fn instruction(

Instruction::CachedStringLoad {
owned,
optional: _,
mem,
free,
table,
Expand Down
3 changes: 1 addition & 2 deletions crates/cli-support/src/wit/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1205,7 +1205,7 @@ impl<'a> Context<'a> {
kind: AdapterJsImportKind,
) -> Result<AdapterId, Error> {
let import = self.module.imports.get(import);
let (import_module, import_name) = (import.module.clone(), import.name.clone());
let import_name = import.name.clone();
let import_id = import.id();
let core_id = match import.kind {
walrus::ImportKind::Function(f) => f,
Expand Down Expand Up @@ -1242,7 +1242,6 @@ impl<'a> Context<'a> {
ret.input,
vec![],
AdapterKind::Import {
module: import_module,
name: import_name,
kind,
},
Expand Down
11 changes: 5 additions & 6 deletions crates/cli-support/src/wit/outgoing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ impl InstructionBuilder<'_, '_> {
Descriptor::Ref(d) => self.outgoing_ref(false, d)?,
Descriptor::RefMut(d) => self.outgoing_ref(true, d)?,

Descriptor::CachedString => self.cached_string(false, true)?,
Descriptor::CachedString => self.cached_string(true)?,

Descriptor::String => {
// fetch the ptr/length ...
Expand Down Expand Up @@ -193,7 +193,7 @@ impl InstructionBuilder<'_, '_> {
&[AdapterType::NamedExternref(name.clone())],
);
}
Descriptor::CachedString => self.cached_string(false, false)?,
Descriptor::CachedString => self.cached_string(false)?,

Descriptor::String => {
self.instruction(
Expand Down Expand Up @@ -335,7 +335,7 @@ impl InstructionBuilder<'_, '_> {
Descriptor::Ref(d) => self.outgoing_option_ref(false, d)?,
Descriptor::RefMut(d) => self.outgoing_option_ref(true, d)?,

Descriptor::CachedString => self.cached_string(true, true)?,
Descriptor::CachedString => self.cached_string(true)?,

Descriptor::String | Descriptor::Vector(_) => {
let kind = arg.vector_kind().ok_or_else(|| {
Expand Down Expand Up @@ -525,7 +525,7 @@ impl InstructionBuilder<'_, '_> {
&[AdapterType::NamedExternref(name.clone()).option()],
);
}
Descriptor::CachedString => self.cached_string(true, false)?,
Descriptor::CachedString => self.cached_string(false)?,
Descriptor::String | Descriptor::Slice(_) => {
let kind = arg.vector_kind().ok_or_else(|| {
format_err!(
Expand Down Expand Up @@ -574,14 +574,13 @@ impl InstructionBuilder<'_, '_> {
self.instruction(&[AdapterType::I64], instr, &[output]);
}

fn cached_string(&mut self, optional: bool, owned: bool) -> Result<(), Error> {
fn cached_string(&mut self, owned: bool) -> Result<(), Error> {
let mem = self.cx.memory()?;
let free = self.cx.free()?;
self.instruction(
&[AdapterType::I32, AdapterType::I32],
Instruction::CachedStringLoad {
owned,
optional,
mem,
free,
table: None,
Expand Down
4 changes: 0 additions & 4 deletions crates/cli-support/src/wit/standard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ pub enum AdapterKind {
instructions: Vec<InstructionData>,
},
Import {
#[allow(dead_code)]
module: String,
name: String,
kind: AdapterJsImportKind,
},
Expand Down Expand Up @@ -314,8 +312,6 @@ pub enum Instruction {
/// pops ptr/length i32, loads string from cache
CachedStringLoad {
owned: bool,
#[allow(dead_code)]
optional: bool,
mem: walrus::MemoryId,
free: walrus::FunctionId,
/// If we're in reference-types mode, the externref table ID to get the cached string from.
Expand Down
Loading