summaryrefslogtreecommitdiff
path: root/src/wasm
diff options
context:
space:
mode:
authorSam Clegg <sbc@chromium.org>2020-12-18 05:11:14 -0800
committerGitHub <noreply@github.com>2020-12-18 05:11:14 -0800
commitac808519a6980474721b88b3d0fd9461cb07abb1 (patch)
tree9e12333cff63bf5a4ca7fdb5737ccbb428023e31 /src/wasm
parentae16f5cb995e3756ccb2093749bc5595fd86a2df (diff)
downloadbinaryen-ac808519a6980474721b88b3d0fd9461cb07abb1.tar.gz
binaryen-ac808519a6980474721b88b3d0fd9461cb07abb1.tar.bz2
binaryen-ac808519a6980474721b88b3d0fd9461cb07abb1.zip
finalize: there can only ever be a single initializer function. NFC. (#3452)
Diffstat (limited to 'src/wasm')
-rw-r--r--src/wasm/wasm-emscripten.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/wasm/wasm-emscripten.cpp b/src/wasm/wasm-emscripten.cpp
index fe9aeffeb..69e0618b1 100644
--- a/src/wasm/wasm-emscripten.cpp
+++ b/src/wasm/wasm-emscripten.cpp
@@ -434,8 +434,8 @@ void printSignatures(std::ostream& o, const std::set<Signature>& c) {
o << "]";
}
-std::string EmscriptenGlueGenerator::generateEmscriptenMetadata(
- std::vector<Name> const& initializerFunctions) {
+std::string
+EmscriptenGlueGenerator::generateEmscriptenMetadata(Name initializer) {
bool commaFirst;
auto nextElement = [&commaFirst]() {
if (commaFirst) {
@@ -482,13 +482,9 @@ std::string EmscriptenGlueGenerator::generateEmscriptenMetadata(
meta << " \"tableSize\": " << wasm.table.initial.addr << ",\n";
- if (!initializerFunctions.empty()) {
+ if (initializer.is()) {
meta << " \"initializers\": [";
- commaFirst = true;
- for (const auto& func : initializerFunctions) {
- meta << nextElement();
- meta << "\"" << func.c_str() << "\"";
- }
+ meta << "\n \"" << initializer.c_str() << "\"";
meta << "\n ],\n";
}