diff options
author | Alon Zakai <azakai@google.com> | 2021-01-27 19:40:08 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-27 11:40:08 -0800 |
commit | 5331e9d18b9359aa0e9d6e0df455883f62e46ea0 (patch) | |
tree | 7114cb1190a1a2c6c886b267092d613d74ad50b9 /src/passes/Print.cpp | |
parent | 2bdc4841b680ee44e132bbb07f5167eaa7226f99 (diff) | |
download | binaryen-5331e9d18b9359aa0e9d6e0df455883f62e46ea0.tar.gz binaryen-5331e9d18b9359aa0e9d6e0df455883f62e46ea0.tar.bz2 binaryen-5331e9d18b9359aa0e9d6e0df455883f62e46ea0.zip |
Simplfy getExpressionName (#3522)
This used to return a simple name like "if" for an If, but it is redundant with
our proper printing logic. This PR turns it into a trivial helper that just prints
out the name of the class, so it now prints "If" with a capital. That is useful
for some logging, like in Metrics I think it is clearer than it was earlier (since
we are actually counting the classes, and our old emitting of text-format-like
names are just confusing, as we emitted "binary" there which is not valid).
Also replace some usages of that method with proper printing.
Diffstat (limited to 'src/passes/Print.cpp')
-rw-r--r-- | src/passes/Print.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/passes/Print.cpp b/src/passes/Print.cpp index a6efd5f1f..23590ebd5 100644 --- a/src/passes/Print.cpp +++ b/src/passes/Print.cpp @@ -3200,15 +3200,12 @@ static std::ostream& printExpression(Expression* expression, static std::ostream& printStackInst(StackInst* inst, std::ostream& o, Function* func) { switch (inst->op) { - case StackInst::Basic: { - PrintExpressionContents(func, o).visit(inst->origin); - break; - } + case StackInst::Basic: case StackInst::BlockBegin: case StackInst::IfBegin: case StackInst::LoopBegin: case StackInst::TryBegin: { - o << getExpressionName(inst->origin); + PrintExpressionContents(func, o).visit(inst->origin); break; } case StackInst::BlockEnd: |