summaryrefslogtreecommitdiff
path: root/src/passes/Print.cpp
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2020-03-30 11:14:29 -0700
committerGitHub <noreply@github.com>2020-03-30 11:14:29 -0700
commitd8179402b3bb991f336b19bcca8ccbc60c842166 (patch)
treec70757545451aaebc75d74bede99fe5c1576d90b /src/passes/Print.cpp
parent2b758fbdc46fc8fe5241bcf1ba5bbd81e6d556ed (diff)
downloadbinaryen-d8179402b3bb991f336b19bcca8ccbc60c842166.tar.gz
binaryen-d8179402b3bb991f336b19bcca8ccbc60c842166.tar.bz2
binaryen-d8179402b3bb991f336b19bcca8ccbc60c842166.zip
Represent dylink section in IR, so we can update it. (#2715)
Update it from wasm-emscripten-finalize when we append to the table.
Diffstat (limited to 'src/passes/Print.cpp')
-rw-r--r--src/passes/Print.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/passes/Print.cpp b/src/passes/Print.cpp
index daa7e7ac6..d6dbb3300 100644
--- a/src/passes/Print.cpp
+++ b/src/passes/Print.cpp
@@ -2340,6 +2340,20 @@ struct PrintSExpression : public OverriddenVisitor<PrintSExpression> {
o << "\")" << maybeNewLine;
}
}
+ void printDylinkSection(const std::unique_ptr<DylinkSection>& dylinkSection) {
+ doIndent(o, indent) << ";; dylink section\n";
+ doIndent(o, indent) << ";; memorysize: " << dylinkSection->memorySize
+ << '\n';
+ doIndent(o, indent) << ";; memoryalignment: "
+ << dylinkSection->memoryAlignment << '\n';
+ doIndent(o, indent) << ";; tablesize: " << dylinkSection->tableSize
+ << '\n';
+ doIndent(o, indent) << ";; tablealignment: "
+ << dylinkSection->tableAlignment << '\n';
+ for (auto& neededDynlib : dylinkSection->neededDynlibs) {
+ doIndent(o, indent) << ";; needed dynlib: " << neededDynlib << '\n';
+ }
+ }
void visitModule(Module* curr) {
currModule = curr;
o << '(';
@@ -2388,6 +2402,9 @@ struct PrintSExpression : public OverriddenVisitor<PrintSExpression> {
}
ModuleUtils::iterDefinedFunctions(
*curr, [&](Function* func) { visitFunction(func); });
+ if (curr->dylinkSection) {
+ printDylinkSection(curr->dylinkSection);
+ }
for (auto& section : curr->userSections) {
doIndent(o, indent);
o << ";; custom section \"" << section.name << "\", size "