[llvm] r183213 - [llvm-symbolizer] Avoid calling slow getSymbolSize for Mach-O files. Assume that symbols with zero size are in fact large enough.
Alexey Samsonov
samsonov at google.com
Fri Jun 7 08:26:57 PDT 2013
On Tue, Jun 4, 2013 at 9:20 PM, Eric Christopher <echristo at gmail.com> wrote:
> > - if (error(si->getSize(SymbolSize)) || SymbolSize ==
> UnknownAddressOrSize)
> > + // Getting symbol size is linear for Mach-O files, so avoid it.
> > + if (isa<MachOObjectFile>(Obj))
> > + SymbolSize = 0;
> > + else if (error(si->getSize(SymbolSize)) ||
> > + SymbolSize == UnknownAddressOrSize)
>
> Expanding the comment here with the assumption that you're making
> below would be good. Otherwise the code doesn't make a whole lot of
> sense.
>
Yeah =/. I've tried to rewrite it in a more clear way in r183526, thanks!
>
> > + // Assume that symbols with zero size are large enough.
> > + if (it->first.Addr < it->first.AddrEnd &&
> > + it->first.AddrEnd <= Address)
> > return false;
> > Name = it->second.str();
> > Addr = it->first.Addr;
>
> -eric
>
--
Alexey Samsonov, MSK
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130607/d0719eab/attachment.html>
More information about the llvm-commits
mailing list