MCPcopy Create free account
hub / github.com/WebAssembly/wabt / CheckImportExport

Method CheckImportExport

src/decompiler.cc:672–688  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

670 }
671
672 bool CheckImportExport(std::string& s,
673 ExternalKind kind,
674 Index index,
675 std::string_view name) {
676 // Figure out if this thing is imported, exported, or neither.
677 auto is_import = mc.module.IsImport(kind, Var(index, Location()));
678 // TODO: is this the best way to check for export?
679 // FIXME: this doesn't work for functions that get renamed in some way,
680 // as the export has the original name..
681 auto xport = mc.module.GetExport(name);
682 auto is_export = xport && xport->kind == kind;
683 if (is_export)
684 s += "export ";
685 if (is_import)
686 s += "import ";
687 return is_import;
688 }
689
690 std::string InitExp(const ExprList& el) {
691 assert(!el.empty());

Callers

nothing calls this directly

Calls 4

LocationClass · 0.85
GetExportMethod · 0.80
VarClass · 0.50
IsImportMethod · 0.45

Tested by

no test coverage detected