diff --git a/passes/cmds/show.cc b/passes/cmds/show.cc index 525c81d5b..0dc5c452c 100644 --- a/passes/cmds/show.cc +++ b/passes/cmds/show.cc @@ -201,6 +201,12 @@ struct ShowWorker if (id[0] == '\\') id = id.substr(1); + // TODO: optionally include autoname + print correspondence in case of ambiguity + size_t max_label_len = abbreviateIds ? 256 : 16384; + if (id.size() > max_label_len) { + id = id.substr(0,max_label_len-3) + "..."; + } + std::string str; for (char ch : id) { if (ch == '\\') { @@ -208,7 +214,7 @@ struct ShowWorker str += "╲"; continue; } - if (ch == '"') + if (ch == '"' || ch == '<' || ch == '>') str += "\\"; str += ch; }