Skip to content

Commit

Permalink
c
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander.nutz committed May 8, 2024
1 parent 33c1b2d commit 7539d99
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 29 deletions.
11 changes: 0 additions & 11 deletions ir/builder.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,6 @@ void vx_IrOp_init(vx_IrOp *op,
const vx_IrOpType type,
vx_IrBlock *parent)
{
op->types = NULL;
op->types_len = 0;

op->outs = NULL;
op->outs_len = 0;

Expand All @@ -133,13 +130,6 @@ void vx_IrOp_init(vx_IrOp *op,
op->states_len = 0;
}

void vx_IrOp_add_type(vx_IrOp *op,
vx_IrType *type)
{
op->types = realloc(op->types, sizeof(vx_IrType) * (op->types_len + 1));
op->types[op->types_len ++] = type;
}

void vx_IrOp_add_out(vx_IrOp *op,
vx_IrVar var,
vx_IrType *type)
Expand All @@ -165,7 +155,6 @@ void vx_IrOp_add_param_s(vx_IrOp *op,
void vx_IrOp_destroy(vx_IrOp *op)
{
vx_IrOp_remove_params(op);
free(op->types);
free(op->outs);
free(op->states);
}
Expand Down
13 changes: 0 additions & 13 deletions ir/dump.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,19 +159,6 @@ void vx_IrOp_dump(const vx_IrOp *op, FILE *out, size_t indent) {

fprintf(out, "%s ", vx_IrOpType_names[op->id]);

if (op->types_len > 0) {
fputc('<', out);

for (size_t i = 0; i < op->types_len; i ++) {
if (i > 0)
fputc(',', out);
// TODO
//fputs(op->types[i], out);
}

fputc('>', out);
}

for (size_t j = 0; j < op->params_len; j ++) {
if (j > 0)
fputc(' ', out);
Expand Down
4 changes: 0 additions & 4 deletions ir/ir.h
Original file line number Diff line number Diff line change
Expand Up @@ -279,9 +279,6 @@ typedef struct {
} vx_IrTypedVar;

struct vx_IrOp_s {
vx_IrType **types;
size_t types_len;

vx_IrTypedVar *outs;
size_t outs_len;

Expand Down Expand Up @@ -344,7 +341,6 @@ void vx_IrView_deep_traverse(vx_IrView top, void (*callback)(vx_IrOp *op, void *
vx_IrValue *vx_IrOp_param(const vx_IrOp *op, vx_IrName name);

void vx_IrOp_init(vx_IrOp *op, vx_IrOpType type, vx_IrBlock *parent);
void vx_IrOp_add_type(vx_IrOp *op, vx_IrType *type);
void vx_IrOp_add_out(vx_IrOp *op, vx_IrVar v, vx_IrType *t);
void vx_IrOp_add_param_s(vx_IrOp *op, vx_IrName name, vx_IrValue val);
void vx_IrOp_add_param(vx_IrOp *op, vx_IrNamedValue p);
Expand Down
2 changes: 1 addition & 1 deletion ir/transform/normalize.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ void vx_CIrBlock_normalize(vx_IrBlock *block)
vx_IrBlock *b_end = vx_IrOp_param(op, VX_IR_NAME_LOOP_ENDEX)->block;
vx_IrBlock *b_do = vx_IrOp_param(op, VX_IR_NAME_LOOP_DO)->block;
// we free manually because we don't want to free blocks if should_free
free(op->types); // TODO: ^ is stupid
// TODO: ^ is stupid
free(op->outs);
free(op->states);
vx_IrOp_remove_params(op);
Expand Down

0 comments on commit 7539d99

Please sign in to comment.