Move the wasmtime crate directories form lib/* to wasmtime-*.
This follows a similar change to Cranelift made here: https://github.com/CraneStation/cranelift/pull/660
This commit is contained in:
24
wasmtime-obj/src/table.rs
Normal file
24
wasmtime-obj/src/table.rs
Normal file
@@ -0,0 +1,24 @@
|
||||
use faerie::{Artifact, Decl};
|
||||
|
||||
/// Declares data segment symbol
|
||||
pub fn declare_table(obj: &mut Artifact, index: usize) -> Result<(), String> {
|
||||
let name = format!("_table_{}", index);
|
||||
obj.declare(
|
||||
name,
|
||||
Decl::Data {
|
||||
writable: false,
|
||||
global: false,
|
||||
},
|
||||
)
|
||||
.map_err(|err| format!("{}", err))?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Emit segment data and initialization location
|
||||
pub fn emit_table(obj: &mut Artifact, index: usize) -> Result<(), String> {
|
||||
let name = format!("_table_{}", index);
|
||||
// FIXME: We need to initialize table using function symbols
|
||||
obj.define(name, Vec::new())
|
||||
.map_err(|err| format!("{}", err))?;
|
||||
Ok(())
|
||||
}
|
||||
Reference in New Issue
Block a user