From fe88b47749115009da0447e340cbdc86edf30984 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Wed, 19 Sep 2018 15:50:30 -0700 Subject: Unify imported and non-imported things (#1678) Fixes #1649 This moves us to a single object for functions, which can be imported or nor, and likewise for globals (as a result, GetGlobals do not need to check if the global is imported or not, etc.). All imported things now inherit from Importable, which has the module and base of the import, and if they are set then it is an import. For convenient iteration, there are a few helpers like ModuleUtils::iterDefinedGlobals(wasm, [&](Global* global) { .. use global .. }); as often iteration only cares about imported or defined (non-imported) things. --- test/example/c-api-relooper-unreachable-if.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/example/c-api-relooper-unreachable-if.cpp') diff --git a/test/example/c-api-relooper-unreachable-if.cpp b/test/example/c-api-relooper-unreachable-if.cpp index 2fafa88d1..dbd50d116 100644 --- a/test/example/c-api-relooper-unreachable-if.cpp +++ b/test/example/c-api-relooper-unreachable-if.cpp @@ -147,7 +147,7 @@ int main() { expressions[47] = BinaryenGetLocal(the_module, 2, 1); { BinaryenExpressionRef operands[] = { expressions[47] }; - expressions[48] = BinaryenCallImport(the_module, "print_i32", operands, 1, 0); + expressions[48] = BinaryenCall(the_module, "print_i32", operands, 1, 0); } { BinaryenExpressionRef children[] = { expressions[44], expressions[46], expressions[48] }; -- cgit v1.2.3