From 7b0b47a641857ea9ca2a8573dbb4598ad9cb5d75 Mon Sep 17 00:00:00 2001 From: Anthony Pesch Date: Thu, 3 Aug 2017 15:38:51 -0400 Subject: [PATCH] remove VALUE_STRING --- src/jit/ir/ir.c | 22 ---------------------- src/jit/ir/ir.h | 3 --- src/jit/ir/ir_read.c | 3 --- src/jit/ir/ir_write.c | 6 ------ 4 files changed, 34 deletions(-) diff --git a/src/jit/ir/ir.c b/src/jit/ir/ir.c index bcdf282a..6688f46e 100644 --- a/src/jit/ir/ir.c +++ b/src/jit/ir/ir.c @@ -270,28 +270,6 @@ struct ir_value *ir_alloc_f64(struct ir *ir, double c) { return v; } -struct ir_value *ir_alloc_str(struct ir *ir, const char *format, ...) { - struct ir_value *v = ir_calloc(ir, sizeof(struct ir_value)); - - v->type = VALUE_STRING; - v->reg = NO_REGISTER; - - /* format the string */ - va_list args; - - va_start(args, format); - int name_len = vsnprintf(0, 0, format, args); - int name_size = name_len + 1; - v->str = ir_calloc(ir, name_size); - va_end(args); - - va_start(args, format); - vsnprintf(v->str, name_size, format, args); - va_end(args); - - return v; -} - struct ir_value *ir_alloc_ptr(struct ir *ir, void *c) { return ir_alloc_i64(ir, (uint64_t)c); } diff --git a/src/jit/ir/ir.h b/src/jit/ir/ir.h index 3361e1c9..fac6b4ed 100644 --- a/src/jit/ir/ir.h +++ b/src/jit/ir/ir.h @@ -28,7 +28,6 @@ enum ir_type { VALUE_F32, VALUE_F64, VALUE_V128, - VALUE_STRING, VALUE_BLOCK, VALUE_NUM, }; @@ -80,7 +79,6 @@ struct ir_value { int64_t i64; float f32; double f64; - char *str; struct ir_block *blk; }; @@ -235,7 +233,6 @@ struct ir_value *ir_alloc_i32(struct ir *ir, int32_t c); struct ir_value *ir_alloc_i64(struct ir *ir, int64_t c); struct ir_value *ir_alloc_f32(struct ir *ir, float c); struct ir_value *ir_alloc_f64(struct ir *ir, double c); -struct ir_value *ir_alloc_str(struct ir *ir, const char *format, ...); struct ir_value *ir_alloc_ptr(struct ir *ir, void *c); struct ir_value *ir_alloc_block_ref(struct ir *ir, struct ir_block *block); struct ir_local *ir_alloc_local(struct ir *ir, enum ir_type type); diff --git a/src/jit/ir/ir_read.c b/src/jit/ir/ir_read.c index 22cab288..c9f16c86 100644 --- a/src/jit/ir/ir_read.c +++ b/src/jit/ir/ir_read.c @@ -355,9 +355,6 @@ static int ir_parse_arg(struct ir_parser *p, struct ir_instr *instr, int arg) { uint64_t v = (uint64_t)p->val.i; value = ir_alloc_f64(p->ir, *(double *)&v); } break; - case VALUE_STRING: { - value = ir_alloc_str(p->ir, p->val.s); - } break; default: LOG_FATAL("unexpected value type"); break; diff --git a/src/jit/ir/ir_write.c b/src/jit/ir/ir_write.c index e2f46e87..3839a317 100644 --- a/src/jit/ir/ir_write.c +++ b/src/jit/ir/ir_write.c @@ -55,9 +55,6 @@ static void ir_write_type(struct ir_writer *w, enum ir_type type, case VALUE_V128: fprintf(output, "v128"); break; - case VALUE_STRING: - fprintf(output, "str"); - break; case VALUE_BLOCK: fprintf(output, "blk"); break; @@ -106,9 +103,6 @@ static void ir_write_value(struct ir_writer *w, const struct ir_value *value, double v = value->f64; fprintf(output, "0x%" PRIx64, *(uint64_t *)&v); } break; - case VALUE_STRING: { - fprintf(output, "'%s'", value->str); - } break; case VALUE_BLOCK: fprintf(output, "%%%d", ir_get_block_label(w, value->blk)); break;