C identifier lookup speedups, 2/2

Zack Weinberg zack@codesourcery.com
Mon Apr 14 20:02:00 GMT 2003


Mark Mitchell <mark@codesourcery.com> writes:

...
> + /* Return the DECL giving the global binding (if any) for NAME (an
> +    IDENTIFIER_NODE).  */
> + 
> + static tree
> + lookup_global_name (tree name)
> + {
> +   tree decl;
> + 
> +   for (decl = global_binding_level->names; decl; decl = TREE_CHAIN (decl))
> +     if (DECL_NAME (decl) == name)
> +       return decl;
> + 
> +   return NULL_TREE;
> + }

Can't you use identifier_global_value for this?

zw



More information about the Gcc-patches mailing list