Re: [PATCH] read-md.c: Move various state to within class rtx_reader (v3)

2016-10-17 Thread Richard Sandiford
David Malcolm writes: >> I assume you didn't turn the functions above into member functions >> because they aren't primitives. OTOH it might seem inconsistent >> to have things like traverse_enum_types as member functions but >> traverse_md_constants not. > > In the following I've converted trave

Re: [PATCH] read-md.c: Move various state to within class rtx_reader

2016-10-17 Thread Richard Sandiford
David Malcolm writes: > @@ -2388,8 +2389,10 @@ gen_mnemonic_setattr (htab_t mnemonic_htab, rtx insn) > static int > mnemonic_htab_callback (void **slot, void *info ATTRIBUTE_UNUSED) > { > - obstack_grow (&string_obstack, (char*)*slot, strlen ((char*)*slot)); > - obstack_1grow (&string_obstack

Re: [PATCH] read-md.c: Move various state to within class rtx_reader

2016-10-17 Thread Bernd Schmidt
On 10/14/2016 08:16 PM, David Malcolm wrote: In this version of the patch, I've moved the global variables to be fields of class rtx_reader, moving their setup to the constructor. The patch adds matching cleanups to the destructor, along with a cleanup of m_base_dir. Doing so requires updating