Exemple #1
0
static void rt_eval_equal ( IL_node *tmp )
{
    Var  *value_a, *value_b;
    value_a=IL_rt_Evaluate ( tmp->exp->A );
    value_b=IL_rt_Evaluate ( tmp->exp->B );
    last_tmp_value=var_equal ( *value_a,*value_b );
    set_tmp(tmp->tmp_index,&last_tmp_value,TMP_ARITH);
}
Exemple #2
0
/*    
 * tlistentry-member--
 *    
 * RETURNS:  the leftmost member of sequence "targetlist" that satisfies
 *           the predicate "var_equal"
 * MODIFIES: nothing
 * REQUIRES: test = function which can operate on a lispval union
 *           var = valid var-node
 *	     targetlist = valid sequence
 */
TargetEntry *
tlistentry_member(Var *var, List *targetlist)
{
    if (var) {
	List *temp = NIL;

	foreach (temp,targetlist) {
	    if (var_equal(var,
			  get_expr(lfirst(temp))))
		return((TargetEntry*)lfirst(temp));
	}
    }
    return (NULL);
}
Exemple #3
0
/*    
 * tlist-member--
 *    Determines whether a var node is already contained within a
 *    target list.
 *    
 * 'var' is the var node
 * 'tlist' is the target list
 * 'dots' is t if we must match dotfields to determine uniqueness
 *    
 * Returns the resdom entry of the matching var node.
 *    
 */
Resdom *
tlist_member(Var *var, List *tlist)
{
    List *i = NIL;
    TargetEntry *temp_tle = (TargetEntry *)NULL;
    TargetEntry *tl_elt = (TargetEntry *)NULL;

    if (var) {
	foreach (i,tlist) {
	    temp_tle = (TargetEntry *)lfirst(i);
	    if (var_equal(var, get_expr(temp_tle))) {
		tl_elt = temp_tle;
		break;
	    }
	}

	if (tl_elt != NULL)
	    return(tl_elt->resdom);
	else 
	    return((Resdom*)NULL);
    }