Say "Global Variable" when referring to the WebAssembly concept.

This helps avoid confusion between wasm global variables and cretonne
global values.
This commit is contained in:
Dan Gohman
2018-06-26 14:03:22 -07:00
parent 8f3c49bc6c
commit 7a55a107ae
8 changed files with 26 additions and 24 deletions

View File

@@ -4,7 +4,7 @@ use cretonne_codegen::cursor::FuncCursor;
use cretonne_codegen::ir::types::*;
use cretonne_codegen::ir::{self, InstBuilder};
use cretonne_codegen::settings;
use environ::{FuncEnvironment, GlobalValue, ModuleEnvironment, WasmResult};
use environ::{FuncEnvironment, GlobalVariable, ModuleEnvironment, WasmResult};
use func_translator::FuncTranslator;
use std::string::String;
use std::vec::Vec;
@@ -157,11 +157,11 @@ impl<'dummy_environment> FuncEnvironment for DummyFuncEnvironment<'dummy_environ
&self.mod_info.flags
}
fn make_global(&mut self, func: &mut ir::Function, index: GlobalIndex) -> GlobalValue {
fn make_global(&mut self, func: &mut ir::Function, index: GlobalIndex) -> GlobalVariable {
// Just create a dummy `vmctx` global.
let offset = ((index * 8) as i32 + 8).into();
let gv = func.create_global_value(ir::GlobalValueData::VMContext { offset });
GlobalValue::Memory {
GlobalVariable::Memory {
gv,
ty: self.mod_info.globals[index].entity.ty,
}