diff options
author | Alan Modra <amodra@gmail.com> | 2011-01-13 13:06:22 +0000 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2011-01-13 13:06:22 +0000 |
commit | 2e57b2afce83621b72b2ac8b54635ad199663dec (patch) | |
tree | a162756c66238efb1835bc8af47ad6fe0fa9177a /ld/ldexp.c | |
parent | 15b8ba76931a8fed121a0f634388e828b3cbc063 (diff) | |
download | gdb-2e57b2afce83621b72b2ac8b54635ad199663dec.zip gdb-2e57b2afce83621b72b2ac8b54635ad199663dec.tar.gz gdb-2e57b2afce83621b72b2ac8b54635ad199663dec.tar.bz2 |
PR ld/12356
* ldexp.h (exp_assop): Delete.
(exp_assign, exp_defsym): Declare.
* ldexp.c (exp_assop): Make static, handle all assignment variations.
(exp_assign, exp_defsym): New functions.
(exp_provide): Use exp_assop.
* ldgram.y (defsym_expr): Use exp_defsym.
* ldctor.c, * ldgram.y, * ldlang.c, * mri.c, * emultempl/beos.em,
* emultempl/pe.em, * emultempl/pep.em, * emultempl/spuelf.em,
* emultempl/xtensaelf.em: Update exp_assop -> exp_assign.
Diffstat (limited to 'ld/ldexp.c')
-rw-r--r-- | ld/ldexp.c | 45 |
1 files changed, 26 insertions, 19 deletions
@@ -974,37 +974,44 @@ exp_nameop (int code, const char *name) } -etree_type * -exp_assop (int code, const char *dst, etree_type *src) -{ - etree_type *new_e; - - new_e = (etree_type *) stat_alloc (sizeof (new_e->assign)); - new_e->type.node_code = code; - new_e->type.lineno = src->type.lineno; - new_e->type.node_class = etree_assign; - new_e->assign.src = src; - new_e->assign.dst = dst; - return new_e; -} - -/* Handle PROVIDE. */ - -etree_type * -exp_provide (const char *dst, etree_type *src, bfd_boolean hidden) +static etree_type * +exp_assop (const char *dst, + etree_type *src, + enum node_tree_enum class, + bfd_boolean hidden) { etree_type *n; n = (etree_type *) stat_alloc (sizeof (n->assign)); n->assign.type.node_code = '='; n->assign.type.lineno = src->type.lineno; - n->assign.type.node_class = etree_provide; + n->assign.type.node_class = class; n->assign.src = src; n->assign.dst = dst; n->assign.hidden = hidden; return n; } +etree_type * +exp_assign (const char *dst, etree_type *src) +{ + return exp_assop (dst, src, etree_assign, FALSE); +} + +etree_type * +exp_defsym (const char *dst, etree_type *src) +{ + return exp_assop (dst, src, etree_assign, TRUE); +} + +/* Handle PROVIDE. */ + +etree_type * +exp_provide (const char *dst, etree_type *src, bfd_boolean hidden) +{ + return exp_assop (dst, src, etree_provide, hidden); +} + /* Handle ASSERT. */ etree_type * |