summaryrefslogtreecommitdiff
path: root/src/wasm-builder.h
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2016-08-18 18:03:05 -0700
committerAlon Zakai <alonzakai@gmail.com>2016-09-07 09:55:02 -0700
commit9660c200eff60c10266a85aae0637b495c4cba39 (patch)
tree386e74bb16cca4c7d20939ab4786806a32e3b1b5 /src/wasm-builder.h
parenta10ca64dc04bdba4fbf4a468604c0c88f62a4a8d (diff)
downloadbinaryen-9660c200eff60c10266a85aae0637b495c4cba39.tar.gz
binaryen-9660c200eff60c10266a85aae0637b495c4cba39.tar.bz2
binaryen-9660c200eff60c10266a85aae0637b495c4cba39.zip
get_global and set_global use a Name instead of an Index, to be more consistent with refering to other global objects; e.g. this avoids ordering issues with imported vs non-imported globals
Diffstat (limited to 'src/wasm-builder.h')
-rw-r--r--src/wasm-builder.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/wasm-builder.h b/src/wasm-builder.h
index d5e94a25b..2841585e6 100644
--- a/src/wasm-builder.h
+++ b/src/wasm-builder.h
@@ -152,15 +152,15 @@ public:
ret->type = value->type;
return ret;
}
- GetGlobal* makeGetGlobal(Index index, WasmType type) {
+ GetGlobal* makeGetGlobal(Name name, WasmType type) {
auto* ret = allocator.alloc<GetGlobal>();
- ret->index = index;
+ ret->name = name;
ret->type = type;
return ret;
}
- SetGlobal* makeSetGlobal(Index index, Expression* value) {
+ SetGlobal* makeSetGlobal(Name name, Expression* value) {
auto* ret = allocator.alloc<SetGlobal>();
- ret->index = index;
+ ret->name = name;
ret->value = value;
return ret;
}