3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-07-24 05:08:56 +00:00

cmdref: Export internal_flag to json

Commands flagged as internal will display a warning, just like experimental commands.
Drop `passes/tests` group in favour of `internal` group, which is automatically assigned for any command without an assigned group which is flagged as internal.
This commit is contained in:
Krystine Sherwin 2025-03-21 10:26:12 +13:00
parent b9485ce094
commit a898ade473
No known key found for this signature in database
5 changed files with 19 additions and 11 deletions

View file

@ -844,7 +844,6 @@ struct HelpPass : public Pass {
auto name = it.first;
auto pass = it.second;
auto title = pass->short_help;
auto experimental_flag = pass->experimental_flag;
auto cmd_help = PrettyHelp();
auto has_pretty_help = pass->formatted_help();
@ -984,7 +983,9 @@ struct HelpPass : public Pass {
if (!cmd_help.has_group()) {
string source_file = pass->location.file_name();
bool has_source = source_file.compare("unknown") != 0;
if (source_file.find("backends/") == 0 || (!has_source && name.find("read_") == 0))
if (pass->internal_flag)
cmd_help.group = "internal";
else if (source_file.find("backends/") == 0 || (!has_source && name.find("read_") == 0))
cmd_help.group = "backends";
else if (source_file.find("frontends/") == 0 || (!has_source && name.find("write_") == 0))
cmd_help.group = "frontends";
@ -1008,8 +1009,6 @@ struct HelpPass : public Pass {
cmd_help.group = "passes/opt";
else if (name.find("proc") == 0)
cmd_help.group = "passes/proc";
else if (name.find("test") == 0)
cmd_help.group = "passes/tests";
}
if (groups.count(cmd_help.group) == 0) {
@ -1028,7 +1027,8 @@ struct HelpPass : public Pass {
json.entry("source_file", pass->location.file_name());
json.entry("source_line", pass->location.line());
json.entry("source_func", pass->location.function_name());
json.entry("experimental_flag", experimental_flag);
json.entry("experimental_flag", pass->experimental_flag);
json.entry("internal_flag", pass->internal_flag);
json.end_object();
}
json.end_object();