summaryrefslogtreecommitdiff
path: root/src/ast/import-utils.h
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2017-10-17 14:46:27 -0700
committerGitHub <noreply@github.com>2017-10-17 14:46:27 -0700
commitdfe92af3e85a7d0e558ffbfaa387ac9f9cf0e8ec (patch)
tree96e84b8f66496a5c96e465d51cabab4bd071ff81 /src/ast/import-utils.h
parent73c04954fa52addb709d7de3f2364ec3082c408b (diff)
downloadbinaryen-dfe92af3e85a7d0e558ffbfaa387ac9f9cf0e8ec.tar.gz
binaryen-dfe92af3e85a7d0e558ffbfaa387ac9f9cf0e8ec.tar.bz2
binaryen-dfe92af3e85a7d0e558ffbfaa387ac9f9cf0e8ec.zip
clean up ImportUtils: make getImport return the import (more consistent with other similar APIs) and fix some ctor-evalling handling of imports, which was incorrect - we need to create fake globals when importing globals, not later, which is too late for initialized globals from imports (#1226)
Diffstat (limited to 'src/ast/import-utils.h')
-rw-r--r--src/ast/import-utils.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/ast/import-utils.h b/src/ast/import-utils.h
index d12c23182..ff7ca3b83 100644
--- a/src/ast/import-utils.h
+++ b/src/ast/import-utils.h
@@ -25,13 +25,13 @@ namespace wasm {
namespace ImportUtils {
// find an import by the module.base that is being imported.
// return the internal name
- inline Name getImport(Module& wasm, Name module, Name base) {
+ inline Import* getImport(Module& wasm, Name module, Name base) {
for (auto& import : wasm.imports) {
if (import->module == module && import->base == base) {
- return import->name;
+ return import.get();
}
}
- return Name();
+ return nullptr;
}
};