This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: FDO usability: pid handling


On Thu, Apr 21, 2011 at 1:36 PM, Jan Hubicka <hubicka@ucw.cz> wrote:
>> @@ -730,6 +726,8 @@ void cgraph_clone_inlined_nodes (struct
>> ?void compute_inline_parameters (struct cgraph_node *);
>> ?cgraph_inline_failed_t cgraph_edge_inlinable_p (struct cgraph_edge *);
>>
>> +void cgraph_init_node_map (void);
>> +void cgraph_del_node_map (void);
>
> Given that you don't even export API for using it, I would go for init_node_map/del_node_map
> in profile.h. ?It is nothing generic that needs to be included into half of compiler.
>>

Ok.

>> -static struct cgraph_node** pid_map = NULL;
>> +typedef struct
>> +{
>> + ?struct cgraph_node *n;
>> +} cgraph_node_ptr_t;
>>
>> -/* Initialize map of pids (pid -> cgraph node) */
>> +DEF_VEC_O (cgraph_node_ptr_t);
>> +DEF_VEC_ALLOC_O (cgraph_node_ptr_t, heap);
> You don't need wrapping struct. ?In cgraph.h you already have:
> DEF_VEC_P(varpool_node_ptr);
> DEF_VEC_ALLOC_P(varpool_node_ptr,heap);
> DEF_VEC_ALLOC_P(varpool_node_ptr,gc);
> so you can use vector of cgraph_node_ptr
>

But ptr vector does allow me to put VEC_index as the LHS of the
assignment -- or have I missed something?

Thanks,

David


> With those changes the patch is OK.
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]