Build Metadata using the current Context.

Fixes #927. Reverts #928.
This commit is contained in:
Nick Lewycky 2019-11-04 15:27:38 -08:00
parent efbb53a91e
commit 1d8f2b767d
3 changed files with 10 additions and 11 deletions

10
Cargo.lock generated
View File

@ -434,7 +434,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "generational-arena"
version = "0.2.3"
version = "0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
@ -522,7 +522,7 @@ dependencies = [
[[package]]
name = "inkwell"
version = "0.1.0"
source = "git+https://github.com/wasmerio/inkwell?branch=llvm8-0#10d180807ce6e621ae13d74001bf5677b0e1f179"
source = "git+https://github.com/wasmerio/inkwell?branch=llvm8-0#bd0d09a8041dc2217f698cd3631b6d4d4c0e696b"
dependencies = [
"either 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)",
"enum-methods 0.0.8 (registry+https://github.com/rust-lang/crates.io-index)",
@ -536,7 +536,7 @@ dependencies = [
[[package]]
name = "inkwell_internal_macros"
version = "0.1.0"
source = "git+https://github.com/wasmerio/inkwell?branch=llvm8-0#10d180807ce6e621ae13d74001bf5677b0e1f179"
source = "git+https://github.com/wasmerio/inkwell?branch=llvm8-0#bd0d09a8041dc2217f698cd3631b6d4d4c0e696b"
dependencies = [
"cargo_toml 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)",
"proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1590,7 +1590,7 @@ version = "0.9.0"
dependencies = [
"bincode 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
"generational-arena 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"generational-arena 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
"getrandom 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1717,7 +1717,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
"checksum field-offset 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "64e9bc339e426139e02601fa69d101e96a92aee71b58bc01697ec2a63a5c9e68"
"checksum fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba"
"checksum gcc 0.3.55 (registry+https://github.com/rust-lang/crates.io-index)" = "8f5f3913fa0bfe7ee1fd8248b6b9f42a5af4b9d65ec2dd2c3c26132b950ecfc2"
"checksum generational-arena 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "921c3803adaeb9f9639de5149d9f0f9f4b79f00c423915b701db2e02ed80b9ce"
"checksum generational-arena 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "fd04ad33021a0409d3f1afbfb89d9f02c10caee73c28f5ac197474dd53e7cf7c"
"checksum generic-array 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c68f0274ae0e023facc3c97b2e00f076be70e254bc851d972503b328db79b2ec"
"checksum getrandom 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)" = "e7db7ca94ed4cd01190ceee0d8a8052f08a247aa1b469a7f68c6a3b71afcf407"
"checksum ghost 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2a36606a68532b5640dc86bb1f33c64b45c4682aad4c50f3937b317ea387f3d6"

View File

@ -60,8 +60,7 @@ middleware-cranelift:
cargo test --manifest-path lib/middleware-common-tests/Cargo.toml --release --features clif
middleware-llvm:
# TODO: remove workaround for https://github.com/wasmerio/wasmer/issues/927
cargo test --manifest-path lib/middleware-common-tests/Cargo.toml --release --features llvm -- --test-threads=1
cargo test --manifest-path lib/middleware-common-tests/Cargo.toml --release --features llvm
middleware: middleware-singlepass middleware-cranelift middleware-llvm

View File

@ -8,7 +8,7 @@ use inkwell::{
},
values::{
BasicValue, BasicValueEnum, FloatValue, FunctionValue, InstructionValue, IntValue,
MetadataValue, PointerValue, VectorValue,
PointerValue, VectorValue,
},
AddressSpace,
};
@ -1218,7 +1218,7 @@ pub fn tbaa_label(
.get_global_metadata("wasmer_tbaa_root")
.pop()
.unwrap_or_else(|| {
module.add_global_metadata("wasmer_tbaa_root", &MetadataValue::create_node(&[]));
module.add_global_metadata("wasmer_tbaa_root", &context.metadata_node(&[]));
module.get_global_metadata("wasmer_tbaa_root")[0]
});
@ -1236,7 +1236,7 @@ pub fn tbaa_label(
.unwrap_or_else(|| {
module.add_global_metadata(
label.as_str(),
&MetadataValue::create_node(&[type_label.into(), tbaa_root.into()]),
&context.metadata_node(&[type_label.into(), tbaa_root.into()]),
);
module.get_global_metadata(label.as_str())[0]
});
@ -1254,7 +1254,7 @@ pub fn tbaa_label(
.unwrap_or_else(|| {
module.add_global_metadata(
label.as_str(),
&MetadataValue::create_node(&[
&context.metadata_node(&[
type_tbaa.into(),
type_tbaa.into(),
intrinsics.i64_zero.into(),