Add a new kind of GlobalVar for symbolic addresses.

These addresses will allow referencing C/C++/Rust-style global variables
by name directly.
This commit is contained in:
Dan Gohman
2017-10-27 13:27:10 -07:00
parent c2665385b1
commit 6fc45b070a
5 changed files with 48 additions and 7 deletions

View File

@@ -21,6 +21,7 @@ pub fn expand_global_addr(inst: ir::Inst, func: &mut ir::Function, _cfg: &mut Co
match func.global_vars[gv] {
ir::GlobalVarData::VmCtx { offset } => vmctx_addr(inst, func, offset.into()),
ir::GlobalVarData::Deref { base, offset } => deref_addr(inst, func, base, offset.into()),
ir::GlobalVarData::Sym { .. } => (),
}
}