Add an offset to cranelift-wasm's GlobalVariable.

This commit is contained in:
Dan Gohman
2018-12-06 17:54:10 -05:00
parent 605f34257b
commit 7b51195f49
5 changed files with 14 additions and 11 deletions

View File

@@ -1,6 +1,7 @@
//! All the runtime support necessary for the wasm to cranelift translation is formalized by the
//! traits `FunctionEnvironment` and `ModuleEnvironment`.
use cranelift_codegen::cursor::FuncCursor;
use cranelift_codegen::ir::immediates::Offset32;
use cranelift_codegen::ir::{self, InstBuilder};
use cranelift_codegen::isa::TargetFrontendConfig;
use std::convert::From;
@@ -20,6 +21,8 @@ pub enum GlobalVariable {
Memory {
/// The address of the global variable storage.
gv: ir::GlobalValue,
/// An offset to add to the address.
offset: Offset32,
/// The global variable's type.
ty: ir::Type,
},