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

@@ -2,7 +2,7 @@ test verifier
; Using a vmctx global value without declaring it first leads to an error.
function %vmglobal_err(i64) -> i64 {
gv4 = vmctx+0 ; error: undeclared vmctx reference
gv4 = vmctx ; error: undeclared vmctx reference
ebb0(v0: i64):
v1 = global_value.i64 gv4
return v1
@@ -10,7 +10,7 @@ ebb0(v0: i64):
; If it is declared, all is fine.
function %vmglobal_ok(i64 vmctx) -> i64 {
gv4 = vmctx+0
gv4 = vmctx
ebb0(v0: i64):
v1 = global_value.i64 gv4
return v1