summaryrefslogtreecommitdiff
path: root/src/passes/Print.cpp
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2021-05-11 16:16:53 -0700
committerGitHub <noreply@github.com>2021-05-11 16:16:53 -0700
commit4cfbb5d90bd253c066d92affa685dbab5d824699 (patch)
treef600492e4587099feb232021fd067cc128ae874a /src/passes/Print.cpp
parented92a8d5e493c839687c2f2d56cdc5123e6e3a47 (diff)
downloadbinaryen-4cfbb5d90bd253c066d92affa685dbab5d824699.tar.gz
binaryen-4cfbb5d90bd253c066d92affa685dbab5d824699.tar.bz2
binaryen-4cfbb5d90bd253c066d92affa685dbab5d824699.zip
Printing: Add a comment when we cannot emit something (#3878)
If we can't emit something, and instead emit a replacement for it (as is the case for a StructSet with an unreachable RTT, so we have no known heap type for it), add a comment that mentions it is a replacement. This might avoid confusion while debugging.
Diffstat (limited to 'src/passes/Print.cpp')
-rw-r--r--src/passes/Print.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/passes/Print.cpp b/src/passes/Print.cpp
index ef78bf582..41e800352 100644
--- a/src/passes/Print.cpp
+++ b/src/passes/Print.cpp
@@ -2351,6 +2351,9 @@ struct PrintSExpression : public UnifiedExpressionVisitor<PrintSExpression> {
//
// Emit a block with drops of the children.
o << "(block";
+ if (!minify) {
+ o << " ;; (replaces something unreachable we can't emit)";
+ }
incIndent();
for (auto* child : ChildIterator(curr)) {
Drop drop;