Reorganize the global value kinds. (#490)

* Reorganize the global value kinds.

This:
 - renames "deref" global values to "load" and gives it a offset that works
   like the "load" instructions' does
 - adds an explicit "iadd_imm" global value kind, which replaces the
   builtin iadd in "vmctx" and "deref" global values.
 - also renames "globalsym" to "symbol"
This commit is contained in:
Dan Gohman
2018-09-04 21:09:04 -07:00
committed by GitHub
parent 59b83912ba
commit ca9da7702e
30 changed files with 467 additions and 320 deletions

View File

@@ -1,15 +1,15 @@
test verifier
function %deref_cycle() {
gv1 = deref(gv2)-32: i32 ; error: deref cycle: [gv1, gv2]
gv2 = deref(gv1): i32
function %cycle() {
gv0 = load.i32 notrap aligned gv1 ; error: global value cycle: [gv0, gv1]
gv1 = load.i32 notrap aligned gv0-32
ebb1:
return
}
function %self_cycle() {
gv0 = deref(gv0)-32: i32 ; error: deref cycle: [gv0]
gv0 = load.i32 notrap aligned gv0 ; error: global value cycle: [gv0]
ebb1:
return