This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] Apply conditional down cast to cgraph.h et.al.
On 10/30/12, Diego Novillo <dnovillo@google.com> wrote:
> On Tue, Oct 30, 2012 at 4:53 PM, Lawrence Crowl <crowl@googlers.com> wrote:
>> On 10/30/12, Diego Novillo <dnovillo@google.com> wrote:
>>>
>>> So, to use these three functions, the user must define this single
>>> 'is_a_helper' routine? Nothing else?
>>
>> You need to distinguish which kind user. Someone just wanting
>> to convert does not need to know about the is_a_helper stuff.
>> Someone wanting to extend the set of type relationships needs to
>> provide one or two template specializations. I've modified the
>> in-header documentation to better reflect the distinction.
>
> Great.
>
>> I originally had
>>
>> if (cgraph_node *ce = dyn_cast <cgraph_node> (e))
>> if (!DECL_BUILT_IN (e->symbol.decl))
>> lto_cgraph_replace_node (ce, cgraph (prevailing));
>>
>> but folks objected to increasing the nesting, and asked that I
>> change to the pre-declare form.
>
> Ah, yeah. I remember that. OK, so we can now use both forms, right?
Yes.
I will commit the patch as soon as the merge and test is complete.
--
Lawrence Crowl