Skip to content

Commit

Permalink
Add a new backend function el_copytotmp()
Browse files Browse the repository at this point in the history
  • Loading branch information
9rnsr committed Oct 13, 2015
1 parent 7882039 commit 18b84b1
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/backend/el.c
Original file line number Diff line number Diff line change
Expand Up @@ -623,6 +623,22 @@ elem * el_same(elem **pe)
return el_copytree(e);
}

/*************************
* Thin wrapper of exp2_copytotemp. Different from el_same,
* always makes a temporary.
*/
elem *el_copytotmp(elem **pe)
{
//printf("copytotemp()\n");
elem *e = *pe;
if (e)
{
*pe = exp2_copytotemp(e);
e = (*pe)->E2;
}
return el_copytree(e);
}

/**************************
* Replace symbol s1 with s2 in tree.
*/
Expand Down
1 change: 1 addition & 0 deletions src/backend/el.h
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ int el_signx32(elem_p);
targ_ldouble el_toldouble(elem_p);
void el_toconst(elem_p);
elem_p el_same(elem_p *);
elem_p el_copytotmp(elem_p *);
int el_match(elem_p ,elem_p);
int el_match2(elem_p ,elem_p);
int el_match3(elem_p ,elem_p);
Expand Down

0 comments on commit 18b84b1

Please sign in to comment.