mie: move op and type definition from dialect/ to ir/ and type/ respectively
This commit is contained in:
25
mie/ir/op-definition.c
Normal file
25
mie/ir/op-definition.c
Normal file
@@ -0,0 +1,25 @@
|
||||
#include <blue/ds/string.h>
|
||||
#include <mie/dialect/dialect.h>
|
||||
#include <mie/ir/op-definition.h>
|
||||
|
||||
struct mie_op_definition *mie_op_definition_create(
|
||||
struct mie_dialect *parent, const char *name)
|
||||
{
|
||||
struct mie_op_definition *out = malloc(sizeof *out);
|
||||
if (!out) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
out->op_name = b_strdup(name);
|
||||
if (!out->op_name) {
|
||||
free(out);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
out->op_parent = parent;
|
||||
|
||||
b_rope name_rope = B_ROPE_CSTR(name);
|
||||
mie_id_map_put(&parent->d_ops, &out->op_id, &name_rope);
|
||||
|
||||
return out;
|
||||
}
|
||||
Reference in New Issue
Block a user