mirror of
https://github.com/danog/ir.git
synced 2024-11-26 12:24:56 +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));
|
||||
return;
|
||||
} else if (insn->op == IR_STR) {
|
||||
if (quoted)
|
||||
if (quoted) {
|
||||
fprintf(f, "\"%s\"", ir_get_str(ctx, insn->val.i32));
|
||||
else
|
||||
} else {
|
||||
fprintf(f, "%s", ir_get_str(ctx, insn->val.i32));
|
||||
}
|
||||
return;
|
||||
}
|
||||
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");
|
||||
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]);
|
||||
/* FIXME(tony):
|
||||
We still cannot handle strings with double quote inside, such as
|
||||
"Hamlet said, \"To be, or not to be\"".
|
||||
'dot' command reports syntax error.
|
||||
*/
|
||||
/* FIXME(tony): We still cannot handle strings with escaped double quote inside */
|
||||
ir_print_const(ctx, insn, f, false);
|
||||
fprintf(f, ")\",style=filled,fillcolor=yellow];\n");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user