[PATCH] D33184: [DWARF] - Make collectAddressRanges() return section index in addition to Low/High PC

Rafael Avila de Espindola via llvm-commits llvm-commits at lists.llvm.org
Thu May 18 09:51:09 PDT 2017


>  template <class ELFT>
> +uint64_t ELFObjectFile<ELFT>::getSectionIndex(DataRefImpl Sec) const {
> +  auto SectionsOrErr = EF.sections();
> +  if (!SectionsOrErr) {
> +    assert(false && "Unable to find section.");
> +    return 0;
> +  }

That is an odd way to write an assert. You can just replace the entire
if with

assert(!SectionsOrErr && "Should be able to get the section table");

Other than that this is fine by me, but also needs an OK from someone
more familiar with debug info.

Cheers,
Rafael


More information about the llvm-commits mailing list