Skip to content

Commit

Permalink
declare immutable globals during in declare (#108)
Browse files Browse the repository at this point in the history
Signed-off-by: xermicus <cyrill@parity.io>
  • Loading branch information
xermicus authored Oct 31, 2024
1 parent 43d2ef3 commit 37ab2b6
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions crates/llvm-context/src/polkavm/context/function/runtime/entry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,6 @@ impl Entry {
where
D: Dependency + Clone,
{
context.declare_global(
revive_runtime_api::immutable_data::GLOBAL_IMMUTABLE_DATA_POINTER,
context.word_type().array_type(0),
AddressSpace::Stack,
);

context.declare_global(
revive_runtime_api::immutable_data::GLOBAL_IMMUTABLE_DATA_SIZE,
context.xlen_type(),
AddressSpace::Stack,
);

let calldata_type = context.array_type(context.byte_type(), Self::MAX_CALLDATA_SIZE);
context.set_global(
crate::polkavm::GLOBAL_CALLDATA_POINTER,
Expand Down Expand Up @@ -195,6 +183,18 @@ where
Some(inkwell::module::Linkage::External),
)?;

context.declare_global(
revive_runtime_api::immutable_data::GLOBAL_IMMUTABLE_DATA_POINTER,
context.word_type().array_type(0),
AddressSpace::Stack,
);

context.declare_global(
revive_runtime_api::immutable_data::GLOBAL_IMMUTABLE_DATA_SIZE,
context.xlen_type(),
AddressSpace::Stack,
);

Ok(())
}

Expand Down

0 comments on commit 37ab2b6

Please sign in to comment.