diff options
Diffstat (limited to 'src/passes')
-rw-r--r-- | src/passes/Metrics.cpp | 7 | ||||
-rw-r--r-- | src/passes/Print.cpp | 7 |
2 files changed, 9 insertions, 5 deletions
diff --git a/src/passes/Metrics.cpp b/src/passes/Metrics.cpp index 56d04802a..3dda70d9b 100644 --- a/src/passes/Metrics.cpp +++ b/src/passes/Metrics.cpp @@ -171,6 +171,13 @@ struct Metrics counts["[total]"] = total; // sort sort(keys.begin(), keys.end(), [](const char* a, const char* b) -> bool { + // Sort the [..] ones first. + if (a[0] == '[' && b[0] != '[') { + return true; + } + if (a[0] != '[' && b[0] == '[') { + return false; + } return strcmp(b, a) > 0; }); o << title << "\n"; 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: |