summaryrefslogtreecommitdiff
path: root/src/tools/wasm-emscripten-finalize.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/wasm-emscripten-finalize.cpp')
-rw-r--r--src/tools/wasm-emscripten-finalize.cpp34
1 files changed, 3 insertions, 31 deletions
diff --git a/src/tools/wasm-emscripten-finalize.cpp b/src/tools/wasm-emscripten-finalize.cpp
index b4e27ca5c..99d03cec0 100644
--- a/src/tools/wasm-emscripten-finalize.cpp
+++ b/src/tools/wasm-emscripten-finalize.cpp
@@ -47,7 +47,6 @@ int main(int argc, const char* argv[]) {
std::string outputSourceMapUrl;
std::string dataSegmentFile;
bool emitBinary = true;
- bool emitMetadata = true;
bool debugInfo = false;
bool DWARF = false;
bool sideModule = false;
@@ -95,13 +94,6 @@ int main(int argc, const char* argv[]) {
WasmEmscriptenFinalizeOption,
Options::Arguments::Zero,
[&emitBinary](Options*, const std::string&) { emitBinary = false; })
- .add(
- "--no-emit-metadata",
- "-n",
- "Skip the writing to emscripten metadata JSON to stdout.",
- WasmEmscriptenFinalizeOption,
- Options::Arguments::Zero,
- [&emitMetadata](Options*, const std::string&) { emitMetadata = false; })
.add("--global-base",
"",
"The address at which static globals were placed",
@@ -228,9 +220,8 @@ int main(int argc, const char* argv[]) {
options.applyFeatures(wasm);
ModuleReader reader;
// If we are not writing output then we definitely don't need to read debug
- // info, as it does not affect the metadata we will emit. (However, if we
- // emit output then definitely load the names section so that we roundtrip
- // names properly.)
+ // info. However, if we emit output then definitely load the names section so
+ // that we roundtrip names properly.
reader.setDebugInfo(writeOutput);
reader.setDWARF(DWARF && writeOutput);
if (!writeOutput) {
@@ -296,7 +287,6 @@ int main(int argc, const char* argv[]) {
: ABI::LegalizationLevel::Minimal));
}
- // Strip target features section (its information is in the metadata)
passRunner.add("strip-target-features");
// If DWARF is unused, strip it out. This avoids us keeping it alive
@@ -307,15 +297,7 @@ int main(int argc, const char* argv[]) {
passRunner.run();
- BYN_TRACE("generated metadata\n");
- // Substantial changes to the wasm are done, enough to create the metadata.
- std::string metadata;
- if (emitMetadata) {
- metadata = generator.generateEmscriptenMetadata();
- }
-
- // Finally, separate out data segments if relevant (they may have been needed
- // for metadata).
+ // Finally, separate out data segments if relevant
if (!dataSegmentFile.empty()) {
Output memInitFile(dataSegmentFile, Flags::Binary);
if (globalBase == INVALID_BASE) {
@@ -338,16 +320,6 @@ int main(int argc, const char* argv[]) {
writer.setSourceMapUrl(outputSourceMapUrl);
}
writer.write(wasm, output);
- if (emitMetadata && !emitBinary) {
- output << "(;\n";
- output << "--BEGIN METADATA --\n" << metadata << "-- END METADATA --\n";
- output << ";)\n";
- }
- }
- // If we emit text then we emitted the metadata together with that text
- // earlier. Otherwise emit it to stdout.
- if (emitMetadata && emitBinary) {
- std::cout << metadata;
}
return 0;
}