meta: replace bluelib references with fx

This commit is contained in:
2026-03-16 13:59:14 +00:00
parent 73b4b77816
commit ef858dd061
106 changed files with 1402 additions and 1389 deletions

View File

@@ -1,7 +1,7 @@
#include "../cmd.h"
#include <blue/cmd.h>
#include <blue/term.h>
#include <fx/cmd.h>
#include <fx/term.h>
#include <mie/attribute/attribute-definition.h>
#include <mie/ctx.h>
#include <mie/dialect/arith.h>
@@ -27,7 +27,7 @@ enum {
};
static int builder_test(
const b_command *cmd, const b_arglist *args, const b_array *_)
const fx_command *cmd, const fx_arglist *args, const fx_array *_)
{
struct mie_ctx *ctx = mie_ctx_create();
mie_builtin_dialect_create(ctx);
@@ -94,19 +94,20 @@ static int builder_test(
struct mie_pass_manager *func_pm = mie_pass_manager_nest(pm);
mie_pass_manager_filter_op(module_pm, "func", "func");
b_arglist_iterator it;
b_arglist_foreach(&it, args)
fx_arglist_iterator it;
fx_arglist_foreach(&it, args)
{
if (it.opt_id < OPT_PASS_OFFSET) {
continue;
}
const b_command_option *opt = b_command_get_option(cmd, it.opt_id);
const fx_command_option *opt
= fx_command_get_option(cmd, it.opt_id);
if (!opt) {
continue;
}
const char *pass_name = b_command_option_get_long_name(opt);
const char *pass_name = fx_command_option_get_long_name(opt);
struct mie_pass *pass = NULL;
enum mie_status status
= mie_ctx_get_pass(ctx, pass_name, NULL, &pass);
@@ -121,62 +122,62 @@ static int builder_test(
mie_pass_manager_run(pm, module);
enum mie_print_flags flags = 0;
if (b_arglist_get_count(args, OPT_GENERIC, B_COMMAND_INVALID_ID) > 0) {
if (fx_arglist_get_count(args, OPT_GENERIC, FX_COMMAND_INVALID_ID) > 0) {
flags |= MIE_PRINT_F_GENERIC;
}
if (b_arglist_get_count(args, OPT_NO_ABBREV, B_COMMAND_INVALID_ID) == 0) {
if (fx_arglist_get_count(args, OPT_NO_ABBREV, FX_COMMAND_INVALID_ID) == 0) {
flags |= MIE_PRINT_F_ABBREVIATED;
}
struct mie_printer printer;
mie_printer_init(&printer, ctx, b_stdout, flags);
mie_printer_init(&printer, ctx, fx_stdout, flags);
mie_printer_print_op(&printer, module);
printf("\n");
return 0;
}
B_COMMAND(CMD_INTERNAL_BUILDER_TEST, CMD_INTERNAL)
FX_COMMAND(CMD_INTERNAL_BUILDER_TEST, CMD_INTERNAL)
{
B_COMMAND_NAME("builder-test");
B_COMMAND_DESC("mie_builder test");
B_COMMAND_FUNCTION(builder_test);
FX_COMMAND_NAME("builder-test");
FX_COMMAND_DESC("mie_builder test");
FX_COMMAND_FUNCTION(builder_test);
B_COMMAND_OPTION(OPT_GENERIC)
FX_COMMAND_OPTION(OPT_GENERIC)
{
B_OPTION_LONG_NAME("generic");
B_OPTION_SHORT_NAME('g');
B_OPTION_DESC("print operations in generic format.");
FX_OPTION_LONG_NAME("generic");
FX_OPTION_SHORT_NAME('g');
FX_OPTION_DESC("print operations in generic format.");
}
B_COMMAND_OPTION(OPT_NO_ABBREV)
FX_COMMAND_OPTION(OPT_NO_ABBREV)
{
B_OPTION_LONG_NAME("no-abbrev");
B_OPTION_SHORT_NAME('n');
B_OPTION_DESC(
FX_OPTION_LONG_NAME("no-abbrev");
FX_OPTION_SHORT_NAME('n');
FX_OPTION_DESC(
"don't use abbreviations for builtin types and ops.");
}
B_COMMAND_HELP_OPTION();
FX_COMMAND_HELP_OPTION();
struct mie_ctx *ctx = mie_ctx_create();
mie_builtin_passes_register(ctx);
size_t i = 0;
b_btree_node *node = b_btree_first(&ctx->ctx_passes.map_entries);
fx_bst_node *node = fx_bst_first(&ctx->ctx_passes.map_entries);
while (node) {
mie_id *id = b_unbox(mie_id, node, e_node);
mie_id *id = fx_unbox(mie_id, node, e_node);
struct mie_pass_definition *pass
= b_unbox(struct mie_pass_definition, id, p_id);
= fx_unbox(struct mie_pass_definition, id, p_id);
B_COMMAND_OPTION_GEN(OPT_PASS_OFFSET + i)
FX_COMMAND_OPTION_GEN(OPT_PASS_OFFSET + i)
{
B_OPTION_LONG_NAME(pass->p_name);
B_OPTION_DESC(pass->p_description);
FX_OPTION_LONG_NAME(pass->p_name);
FX_OPTION_DESC(pass->p_description);
}
node = b_btree_next(node);
node = fx_bst_next(node);
i++;
}
}