On 10/30/2012 05:49 PM, Sriraman Tallam wrote:
AFAIU, this should not be a problem. For duplicate declarations, duplicate_decls should merge them and they should never be seen here. Did I miss something?
With extern "C" functions you can have multiple declarations of the same function in different namespaces that are not duplicates, but still match. And I can't think what that test is supposed to be catching, anyway.
No, I thought about this but I did not want to handle this case in this iteration. The dispatcher is created only once and if more functions are declared later, they will not be dispatched atleast in this iteration.
I still think that instead of collecting the set of functions in overload resolution, they should be collected at declaration time and added to a vector in the cgraph information for use when generating the body of the dispatcher.
You talked about doing the dispatcher building later, but I did it here since I am doing it only once.
I still don't think this is the right place for it.
dispatcher_node does not have a body until it is generated in cgraphunit.c, so cgraph does not mark this field before this is processed in cgraph_analyze_function.
That seems like something to address in your cgraph changes. Jason