Re: [RFA 23/42] Move pending addrmap globals to buildsym_compunit

Simon Marchi
2018-07-10T01:56:52Z

On 2018-05-23 12:58 AM, Tom Tromey wrote:
> @@ -660,15 +656,14 @@ record_block_range (struct block *block,
> need to record this block in the addrmap. */
> if (start != BLOCK_START (block)
> || end_inclusive + 1 != BLOCK_END (block))
> - pending_addrmap_interesting = 1;
> + buildsym_compunit->m_pending_addrmap_interesting = true;
>
> - if (! pending_addrmap)
> - {
> - obstack_init (&pending_addrmap_obstack);
> - pending_addrmap = addrmap_create_mutable (&pending_addrmap_obstack);
> - }
> + if (! buildsym_compunit->m_pending_addrmap)

Can you please change this to == nullptr?

> + buildsym_compunit->m_pending_addrmap
> + = addrmap_create_mutable (&buildsym_compunit->m_pending_addrmap_obstack);
>
> - addrmap_set_empty (pending_addrmap, start, end_inclusive, block);
> + addrmap_set_empty (buildsym_compunit->m_pending_addrmap,
> + start, end_inclusive, block);
> }
>
> static struct blockvector *
> @@ -706,9 +701,11 @@ make_blockvector (void)
>
> /* If we needed an address map for this symtab, record it in the
> blockvector. */
> - if (pending_addrmap && pending_addrmap_interesting)
> + if (buildsym_compunit->m_pending_addrmap
> + && buildsym_compunit->m_pending_addrmap_interesting)

And here != nullptr.

Otherwise, LGTM.

Simon