This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
another minor Xtensa cleanup
- From: Bob Wilson <bwilson at tensilica dot com>
- To: binutils at sources dot redhat dot com
- Date: Fri, 02 Feb 2007 16:12:26 -0800
- Subject: another minor Xtensa cleanup
There is an initialization function for Xtensa "tinsn" structures in GAS, but in
some places, memset was being used to clear them instead. If we're going to
have such a function, we might as well use it. Tested with an xtensa-elf build
and committed.
gas/
* config/tc-xtensa.c (xg_build_to_insn): Use tinsn_init.
(xg_expand_assembly_insn, istack_push_space, istack_pop): Likewise.
Index: config/tc-xtensa.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-xtensa.c,v
retrieving revision 1.76
diff -u -p -r1.76 tc-xtensa.c
--- config/tc-xtensa.c 2 Feb 2007 23:59:29 -0000 1.76
+++ config/tc-xtensa.c 3 Feb 2007 00:06:18 -0000
@@ -3309,7 +3309,7 @@ xg_build_to_insn (TInsn *targ, TInsn *in
BuildOp *op;
symbolS *sym;
- memset (targ, 0, sizeof (TInsn));
+ tinsn_init (targ);
targ->linenum = insn->linenum;
switch (bi->typ)
{
@@ -3858,7 +3858,7 @@ xg_expand_assembly_insn (IStack *istack,
TInsn new_insn;
bfd_boolean do_expand;
- memset (&new_insn, 0, sizeof (TInsn));
+ tinsn_init (&new_insn);
/* Narrow it if we can. xg_simplify_insn now does all the
appropriate checking (e.g., for the density option). */
@@ -11009,7 +11009,7 @@ istack_push_space (IStack *stack)
TInsn *insn;
assert (!istack_full (stack));
insn = &stack->insn[rec];
- memset (insn, 0, sizeof (TInsn));
+ tinsn_init (insn);
stack->ninsn++;
return insn;
}
@@ -11024,7 +11024,7 @@ istack_pop (IStack *stack)
int rec = stack->ninsn - 1;
assert (!istack_empty (stack));
stack->ninsn--;
- memset (&stack->insn[rec], 0, sizeof (TInsn));
+ tinsn_init (&stack->insn[rec]);
}