Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/passes/Print.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3884,13 +3884,13 @@ static std::ostream& printStackIR(StackIR* ir, PrintSExpression& printer) {
}
switch (inst->op) {
case StackInst::Basic: {
doIndent();
// Pop is a pseudo instruction and should not be printed in the stack IR
// format to make it valid wat form.
if (inst->origin->is<Pop>()) {
break;
continue;
}

doIndent();
PrintExpressionContents(printer).visit(inst->origin);
break;
}
Expand Down
18 changes: 11 additions & 7 deletions src/support/command-line.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,18 @@ void printWrap(std::ostream& os, int leftPad, const std::string& content) {
space = SCREEN_WIDTH - leftPad;
}
os << nextWord;
space -= nextWord.size() + 1;
if (space > 0) {
os << ' ';
}
space -= nextWord.size();
nextWord.clear();
if (content[i] == '\n') {
os << '\n';
space = SCREEN_WIDTH - leftPad;
if (i < len) {
if (content[i] == ' ') {
if (space > 0) {
os << ' ';
space -= 1;
}
} else if (content[i] == '\n') {
os << '\n';
space = SCREEN_WIDTH - leftPad;
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/tools/wasm-opt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ For more on how to optimize effectively, see

https://github.com/WebAssembly/binaryen/wiki/Optimizer-Cookbook
https://github.com/WebAssembly/binaryen/wiki/GC-Optimization-Guidebook
)");
)");

options
.add("--output",
Expand Down
2 changes: 1 addition & 1 deletion src/tools/wasm-reduce/wasm-reduce.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1396,7 +1396,7 @@ Comparison to creduce:
More documentation can be found at

https://github.com/WebAssembly/binaryen/wiki/Fuzzing#reducing
)");
)");
options
.add("--command",
"-cmd",
Expand Down
1 change: 0 additions & 1 deletion test/lit/passes/stack-ir-eh-legacy.wast
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
;; CHECK-NEXT: i32.const 0
;; CHECK-NEXT: throw $e0
;; CHECK-NEXT: catch $e0
;; CHECK-NEXT:
;; CHECK-NEXT: drop
;; CHECK-NEXT: catch_all
;; CHECK-NEXT: rethrow $l0
Expand Down
Loading