[lld] r243496 - [ELF2] Devirtualize SymbolBody.

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


Oh, and the error needs a testcase.

On 5 August 2015 at 09:25, 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) ).
>
> Cheers,
> Rafael


More information about the llvm-commits mailing list