mirror of
https://github.com/danog/ir.git
synced 2024-11-30 04:39:43 +01:00
Fixed code style
This commit is contained in:
parent
71061d0ee4
commit
d1fcaa3e63
5
ir.c
5
ir.c
@ -73,10 +73,11 @@ void ir_print_const(const ir_ctx *ctx, const ir_insn *insn, FILE *f, bool quoted
|
|||||||
fprintf(f, "%s", ir_get_str(ctx, insn->val.i32));
|
fprintf(f, "%s", ir_get_str(ctx, insn->val.i32));
|
||||||
return;
|
return;
|
||||||
} else if (insn->op == IR_STR) {
|
} else if (insn->op == IR_STR) {
|
||||||
if (quoted)
|
if (quoted) {
|
||||||
fprintf(f, "\"%s\"", ir_get_str(ctx, insn->val.i32));
|
fprintf(f, "\"%s\"", ir_get_str(ctx, insn->val.i32));
|
||||||
else
|
} else {
|
||||||
fprintf(f, "%s", ir_get_str(ctx, insn->val.i32));
|
fprintf(f, "%s", ir_get_str(ctx, insn->val.i32));
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
IR_ASSERT(IR_IS_CONST_OP(insn->op) || insn->op == IR_FUNC_ADDR);
|
IR_ASSERT(IR_IS_CONST_OP(insn->op) || insn->op == IR_FUNC_ADDR);
|
||||||
|
@ -65,11 +65,7 @@ void ir_dump_dot(const ir_ctx *ctx, FILE *f)
|
|||||||
fprintf(f, "\trankdir=TB;\n");
|
fprintf(f, "\trankdir=TB;\n");
|
||||||
for (i = 1 - ctx->consts_count, insn = ctx->ir_base + i; i < IR_UNUSED; i++, insn++) {
|
for (i = 1 - ctx->consts_count, insn = ctx->ir_base + i; i < IR_UNUSED; i++, insn++) {
|
||||||
fprintf(f, "\tc%d [label=\"C%d: CONST %s(", -i, -i, ir_type_name[insn->type]);
|
fprintf(f, "\tc%d [label=\"C%d: CONST %s(", -i, -i, ir_type_name[insn->type]);
|
||||||
/* FIXME(tony):
|
/* FIXME(tony): We still cannot handle strings with escaped double quote inside */
|
||||||
We still cannot handle strings with double quote inside, such as
|
|
||||||
"Hamlet said, \"To be, or not to be\"".
|
|
||||||
'dot' command reports syntax error.
|
|
||||||
*/
|
|
||||||
ir_print_const(ctx, insn, f, false);
|
ir_print_const(ctx, insn, f, false);
|
||||||
fprintf(f, ")\",style=filled,fillcolor=yellow];\n");
|
fprintf(f, ")\",style=filled,fillcolor=yellow];\n");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user