C identifier lookup speedups, 2/2

Mark Mitchell mark@codesourcery.com
Mon Apr 14 20:08:00 GMT 2003


On Mon, 2003-04-14 at 13:02, Zack Weinberg wrote:
> 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?

Probably; didn't know we had that in C.

I'll make a new patch.

Thanks,

-- 
Mark Mitchell
CodeSourcery, LLC
mark@codesourcery.com



More information about the Gcc-patches mailing list