[lld] r243496 - [ELF2] Devirtualize SymbolBody.

Rafael EspĂ­ndola rafael.espindola at gmail.com
Wed Aug 5 06:25:47 PDT 2015


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) ).

Cheers,
Rafael


More information about the llvm-commits mailing list