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: [pph] Add symbol table - Fix remaining asm differences (issue4732043)


On Fri, Jul 15, 2011 at 16:02, Gabriel Charette <gchare@google.com> wrote:

>> + Â/* Read and process the symbol table. Â*/
>> + Âpph_in_symtab (stream);
>> Â}
>>
>
> Why read the symbol table last?

Because the symbol identifiers need to be placed in the global
bindings, which are not read until later.  This was my initial intent,
but this circular dependency made things unpleasant.  If the symbol
table is placed first, we don't update the bindings properly and
lookups fail.

There are some improvements that can be done, however: we are not
testing for duplicate symbols in the table (I noticed that sometimes
rest_of_decl_compilation is called more than once for the same decl,
for instance).


>> +/* Add DECL to the list of symbols that need to be registered with the
>> + Â middle end when reading current_pph_stream. Â*/
>> +
>> +void
>> +pph_add_decl_to_register (tree decl)
>> +{
>> + Âif (decl)
>> + Â ÂVEC_safe_push (tree, heap, decls_to_register, decl);
>> +}
>
> should we inline this?

It's accessing file-local data (decls_to_register).  Besides, this is
trivial to inline with LTO/LIPO.


Diego.


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