Hack in gcc/c-decl.c?

Mike Stump mrs@apple.com
Thu Dec 29 18:39:00 GMT 2005


On Dec 29, 2005, at 12:38 AM, Domagoj D wrote:
> Sorry, I didn't see that each identifier *is* a lang_identifier,  
> that's
> a weird way to keep bindings. It's not that easy for someone new to  
> GCC
> to get around the code. What was the design decision behind that hack
> (instead of something like:
>
> struct tree_identifier {
>   struct tree_common common;
>   struct c_binding *binds[3];
>   struct ht_identifier id;
> })?

That can't work, not all tree_identifiers have a c_binding, for  
example, java doesn't.

Also, not all identifiers in all languages have an ht_identifier,  
again, for example, java doesn't.

After you check all the language front ends, (grep "lang_ident", it  
only takes a few seconds), you discover that the only thing they have  
in common is common.

> I see that make_node_stat allocates a large enough piece of
> memory, but which function actually writes to
> I_SYMBOL_X(node)->Y_binding ?

Grep should find it, why not use that?

grep("symbol_binding"), then grep what you find, then just look at  
those 20 places.

If you have a patch that makes gcc more understandable, more  
conforming to what most people would expect, faster and easier to  
maintain and(/or?) smaller please submit it.  :-)



More information about the Gcc mailing list