]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
tic4x disassembly static variables
authorAlan Modra <amodra@gmail.com>
Wed, 15 Jan 2020 05:37:16 +0000 (16:07 +1030)
committerAlan Modra <amodra@gmail.com>
Wed, 15 Jan 2020 13:31:13 +0000 (00:01 +1030)
commitaad09917e04b33da463f1703aab8d057cfe3f54e
treedcf1d4382c6f91f58bb66771a768baa7489763ce
parent131cb553d6d10412b20cf49bb0e3a5e736a90a36
tic4x disassembly static variables

tic4x uses a number of static variables for tables that are generated
depending on the current machine (tic4x vs. tic3x).  However, it is
possible to change the machine from one invocation of print_insn_tic4x
to the next.  This patch throws away the old state if that happens,
and uses a relatively small known size array of register names rather
than a malloc'd table.

* tic4x-dis.c (tic4x_version): Make unsigned long.
(optab, optab_special, registernames): New file scope vars.
(tic4x_print_register): Set up registernames rather than
malloc'd registertable.
(tic4x_disassemble): Delete optable and optable_special.  Use
optab and optab_special instead.  Throw away old optab,
optab_special and registernames when info->mach changes.
opcodes/ChangeLog
opcodes/tic4x-dis.c