mie: update bluelib api usage

This commit is contained in:
2025-11-06 10:38:50 +00:00
parent 06f384e089
commit 6d172e1dc0
19 changed files with 226 additions and 173 deletions

View File

@@ -2,6 +2,7 @@
#define MIE_CTX_H_
#include <blue/core/btree.h>
#include <blue/ds/hashmap.h>
#include <mie/type.h>
struct mie_ctx {
@@ -9,8 +10,8 @@ struct mie_ctx {
struct mie_value *ctx_null;
struct mie_type *ctx_types[__MIE_TYPE_COUNT];
b_btree ctx_int_cache;
struct b_hashmap *ctx_sel_cache;
struct b_hashmap *ctx_string_cache;
b_hashmap *ctx_sel_cache;
b_hashmap *ctx_string_cache;
};
extern struct mie_ctx *mie_ctx_create(void);

View File

@@ -1,6 +1,7 @@
#ifndef MIE_CONST_H_
#define MIE_CONST_H_
#include <blue/ds/list.h>
#include <mie/ir/value.h>
#include <mie/type.h>
@@ -13,8 +14,6 @@
#define MIE_SELECTOR(p) ((struct mie_selector *)(p))
#define MIE_ARRAY(p) ((struct mie_array *)(p))
struct b_list;
struct mie_const {
struct mie_value c_base;
struct mie_type *c_type;
@@ -47,7 +46,7 @@ struct mie_selector {
struct mie_array {
struct mie_const a_base;
struct b_list *a_values;
b_list *a_values;
};
extern void mie_const_init(struct mie_const *c, struct mie_type *type);

View File

@@ -2,8 +2,8 @@
#define MIE_CONVERT_H_
#include <blue/core/stringstream.h>
#include <blue/object/bitbuffer.h>
#include <blue/object/string.h>
#include <blue/ds/bitbuffer.h>
#include <blue/ds/string.h>
#include <mie/misc.h>
#include <stdio.h>

View File

@@ -4,11 +4,11 @@
#define MIE_MODULE(p) ((struct mie_module *)(p))
#include <blue/core/queue.h>
#include <blue/ds/hashmap.h>
#include <mie/ir/value.h>
#include <mie/name.h>
struct mie_func;
struct b_hashmap;
struct mie_module {
struct mie_value m_base;
@@ -17,8 +17,8 @@ struct mie_module {
b_queue m_types;
b_queue m_func;
struct b_hashmap *m_data;
struct b_hashmap *m_data_strings;
b_hashmap *m_data;
b_hashmap *m_data_strings;
};
extern struct mie_module *mie_module_create(void);

View File

@@ -31,20 +31,9 @@ struct mie_select_graph {
};
struct mie_select_use_iterator {
b_queue_iterator it_base;
b_queue_entry *it_ptr;
};
#define mie_select_use_foreach(it, q) b_queue_foreach (&(it)->it_base, q)
static inline struct mie_select_use *mie_select_use_iterator_unbox(
struct mie_select_use_iterator *it)
{
return b_unbox(struct mie_select_use, it->it_base.entry, u_entry);
}
MIE_API void mie_select_use_iterator_next(struct mie_select_use_iterator *it);
MIE_API bool mie_select_use_iterator_is_valid(
const struct mie_select_use_iterator *it);
MIE_API struct mie_select_graph *mie_select_graph_create(struct mie_ctx *ctx);
MIE_API void mie_select_graph_destroy(struct mie_select_graph *graph);

View File

@@ -61,13 +61,13 @@ struct mie_select_node {
};
struct mie_select_node_iterator {
b_queue_iterator it_base;
b_queue_entry *it_ptr;
};
static inline struct mie_select_node *mie_select_node_iterator_unbox(
struct mie_select_node_iterator *it)
{
return b_unbox(struct mie_select_node, it->it_base.entry, n_entry);
return b_unbox(struct mie_select_node, it->it_ptr, n_entry);
}
MIE_API void mie_select_node_iterator_next(struct mie_select_node_iterator *it);