mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-02-17 01:11:45 +00:00
[qfcc] Handle compound and memset dot nodes
compound is currently not very informative, but it's better than "bad expression type"
This commit is contained in:
parent
08b7064a3f
commit
bbfd498b74
1 changed files with 26 additions and 1 deletions
|
@ -506,6 +506,29 @@ print_value (dstring_t *dstr, expr_t *e, int level, int id, expr_t *next)
|
|||
e->line);
|
||||
}
|
||||
|
||||
static void
|
||||
print_compound (dstring_t *dstr, expr_t *e, int level, int id, expr_t *next)
|
||||
{
|
||||
int indent = level * 2 + 2;
|
||||
dasprintf (dstr, "%*se_%p [label=\"compound init\"];\n", indent, "", e);
|
||||
}
|
||||
|
||||
static void
|
||||
print_memset (dstring_t *dstr, expr_t *e, int level, int id, expr_t *next)
|
||||
{
|
||||
int indent = level * 2 + 2;
|
||||
expr_t *dst = e->e.memset.dst;
|
||||
expr_t *val = e->e.memset.val;
|
||||
expr_t *count = e->e.memset.count;
|
||||
_print_expr (dstr, dst, level, id, next);
|
||||
_print_expr (dstr, val, level, id, next);
|
||||
_print_expr (dstr, count, level, id, next);
|
||||
dasprintf (dstr, "%*se_%p -> \"e_%p\";\n", indent, "", e, dst);
|
||||
dasprintf (dstr, "%*se_%p -> \"e_%p\";\n", indent, "", e, val);
|
||||
dasprintf (dstr, "%*se_%p -> \"e_%p\";\n", indent, "", e, count);
|
||||
dasprintf (dstr, "%*se_%p [label=\"memset\"];\n", indent, "", e);
|
||||
}
|
||||
|
||||
static void
|
||||
_print_expr (dstring_t *dstr, expr_t *e, int level, int id, expr_t *next)
|
||||
{
|
||||
|
@ -523,6 +546,8 @@ _print_expr (dstring_t *dstr, expr_t *e, int level, int id, expr_t *next)
|
|||
print_vector,
|
||||
print_nil,
|
||||
print_value,
|
||||
print_compound,
|
||||
print_memset,
|
||||
};
|
||||
int indent = level * 2 + 2;
|
||||
|
||||
|
@ -534,7 +559,7 @@ _print_expr (dstring_t *dstr, expr_t *e, int level, int id, expr_t *next)
|
|||
return;
|
||||
e->printid = id;
|
||||
|
||||
if ((int) e->type < 0 || e->type > ex_value) {
|
||||
if ((int) e->type < 0 || e->type > ex_memset) {
|
||||
dasprintf (dstr, "%*se_%p [label=\"(bad expr type)\\n%d\"];\n",
|
||||
indent, "", e, e->line);
|
||||
return;
|
||||
|
|
Loading…
Reference in a new issue