Re: [RFA 21/42] Move the context stack to buildsym_compunit

Simon Marchi
2018-07-10T01:45:53Z

On 2018-07-08 01:49 PM, Simon Marchi wrote:
> On 2018-05-23 12:58 AM, Tom Tromey wrote:
>> This moves the context stack globals to be members of
>> buildsym_compunit, changing the type to a std::vector in the process.
>>
>> Note that the context stack works in a somewhat odd way, where callers
>> can pop the stack and expect the returned pointer to remain valid
>> until the next pop. In the new code we handle this by having a
>> "popped context" object that remains valid in this way.
>
> Would it work to make pop_context return the context_stack object by value
> instead?
>
>> @@ -270,6 +261,19 @@ extern void set_local_using_directives (struct using_direct *new_local);
>>
>> extern struct using_direct **get_global_using_directives ();
>>
>> +/* Non-zero if the context stack is empty. */
>> +
>> +extern bool outermost_context_p ();
>
> "True" instead of "Non-zero".
>
> Simon

Damn, failed to reply all again.

Simon