mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-05-31 08:41:11 +00:00
Allow node() to work for all operand types.
This is a bit of an expermiment to get better dags (more node reuse).
This commit is contained in:
parent
1472fec7f2
commit
f83cf1748f
1 changed files with 16 additions and 5 deletions
|
@ -207,6 +207,7 @@ static dagnode_t *
|
||||||
node (operand_t *op)
|
node (operand_t *op)
|
||||||
{
|
{
|
||||||
symbol_t *sym;
|
symbol_t *sym;
|
||||||
|
dagnode_t *node = 0;
|
||||||
|
|
||||||
if (!op)
|
if (!op)
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -214,15 +215,21 @@ node (operand_t *op)
|
||||||
op = op->o.alias;
|
op = op->o.alias;
|
||||||
if (op->op_type == op_symbol) {
|
if (op->op_type == op_symbol) {
|
||||||
sym = op->o.symbol;
|
sym = op->o.symbol;
|
||||||
if (sym->sy_type == sy_const)
|
//if (sym->sy_type == sy_const)
|
||||||
return 0;
|
// return 0;
|
||||||
if (sym->daglabel)
|
if (sym->daglabel)
|
||||||
return sym->daglabel->dagnode;
|
node = sym->daglabel->dagnode;
|
||||||
} else if (op->op_type == op_temp) {
|
} else if (op->op_type == op_temp) {
|
||||||
if (op->o.tempop.daglabel)
|
if (op->o.tempop.daglabel)
|
||||||
return op->o.tempop.daglabel->dagnode;
|
node = op->o.tempop.daglabel->dagnode;
|
||||||
|
} else if (op->op_type == op_value || op->op_type == op_pointer) {
|
||||||
|
if (op->o.value->daglabel)
|
||||||
|
node = op->o.value->daglabel->dagnode;
|
||||||
|
} else if (op->op_type == op_label) {
|
||||||
|
if (op->o.label->daglabel)
|
||||||
|
node = op->o.label->daglabel->dagnode;
|
||||||
}
|
}
|
||||||
return 0;
|
return node;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
@ -248,6 +255,10 @@ op_is_identifer (operand_t *op)
|
||||||
{
|
{
|
||||||
while (op->op_type == op_alias)
|
while (op->op_type == op_alias)
|
||||||
op = op->o.alias;
|
op = op->o.alias;
|
||||||
|
if (op->op_type == op_label)
|
||||||
|
return 0;
|
||||||
|
if (op->op_type == op_value)
|
||||||
|
return 0;
|
||||||
if (op->op_type == op_pointer)
|
if (op->op_type == op_pointer)
|
||||||
return 1;
|
return 1;
|
||||||
if (op->op_type == op_temp)
|
if (op->op_type == op_temp)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue