[lld] r243496 - [ELF2] Devirtualize SymbolBody.

Rui Ueyama ruiu at google.com
Wed Aug 5 09:47:19 PDT 2015


On Wed, Aug 5, 2015 at 6:25 AM, Rafael EspĂ­ndola <rafael.espindola at gmail.com
> wrote:

> This can be static:
>
> > +template <class ELFT>
> > +StringRef
> > +getSymbolName(const llvm::object::ELFFile<ELFT> *F,
> > +  const typename llvm::object::ELFFile<ELFT>::Elf_Sym *S) {
> > +  ErrorOr<StringRef> StrTab =
> F->getStringTableForSymtab(*F->getDotSymtabSec());
> > +  if (!StrTab || S->st_name >= StrTab->size())
> > +    llvm::report_fatal_error("Invalid string table.");
>
> Please don't use report_fatal_error. Instead call one of the error
> functions (like template <typename T> void error(const ErrorOr<T> &V,
> Twine Prefix) ).
>

We return the false value where in ELF we use error(). What's your
rationale on that design? (I'm just wondering if I should use error() in
COFF too.)


> Cheers,
> Rafael
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150805/f351ebd6/attachment.html>


More information about the llvm-commits mailing list