diff options
Diffstat (limited to 'src/ir/export-utils.h')
-rw-r--r-- | src/ir/export-utils.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/ir/export-utils.h b/src/ir/export-utils.h index f50c0afa5..ce6db7663 100644 --- a/src/ir/export-utils.h +++ b/src/ir/export-utils.h @@ -24,6 +24,16 @@ namespace wasm::ExportUtils { std::vector<Function*> getExportedFunctions(Module& wasm); std::vector<Global*> getExportedGlobals(Module& wasm); +inline bool isExported(const Module& module, const Function& func) { + for (auto& exportFunc : module.exports) { + if (exportFunc->kind == ExternalKind::Function && + exportFunc->value == func.name) { + return true; + } + } + return false; +}; + } // namespace wasm::ExportUtils #endif // wasm_ir_export_h |