Update faerie to 0.9.1

This commit is contained in:
Yury Delendik
2019-03-26 10:05:25 -05:00
committed by Dan Gohman
parent db0abe8431
commit 94ca967d0a
11 changed files with 16 additions and 35 deletions

View File

@@ -8,14 +8,8 @@ pub fn declare_data_segment(
index: usize,
) -> Result<(), String> {
let name = format!("_memory_{}", index);
obj.declare(
name,
Decl::Data {
writable: false,
global: false,
},
)
.map_err(|err| format!("{}", err))?;
obj.declare(name, Decl::data())
.map_err(|err| format!("{}", err))?;
Ok(())
}

View File

@@ -13,7 +13,7 @@ pub fn declare_functions(
for (i, _function_relocs) in relocations.iter().rev() {
let func_index = module.func_index(i);
let string_name = format!("_wasm_function_{}", func_index.index());
obj.declare(string_name, Decl::Function { global: true })
obj.declare(string_name, Decl::function().global())
.map_err(|err| format!("{}", err))?;
}
Ok(())

View File

@@ -12,15 +12,8 @@ fn emit_vmcontext_init(
target_config: &TargetFrontendConfig,
) -> Result<(), String> {
let (data, table_relocs) = layout_vmcontext(module, target_config);
obj.declare_with(
"_vmcontext_init",
Decl::Data {
writable: false,
global: true,
},
data.to_vec(),
)
.map_err(|err| format!("{}", err))?;
obj.declare_with("_vmcontext_init", Decl::data().global(), data.to_vec())
.map_err(|err| format!("{}", err))?;
for reloc in table_relocs.iter() {
let target_name = format!("_table_{}", reloc.index);
obj.link(Link {

View File

@@ -3,14 +3,8 @@ 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))?;
obj.declare(name, Decl::data())
.map_err(|err| format!("{}", err))?;
Ok(())
}