[PATCH] D28045: [ELF] - Return file offset as address only for allocatable sections when building .gdb_index

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 22 13:10:19 PST 2016


I think it's about the same if it returns 0 or Optional<uint64_t> - the
lack of an offset and offset 0 are basically the same thing, so far as I
can tell. So it's not even like 0 is a special value, really.

George - reckon we could/should do this up at the caller instead, though?
SectionRef does have queries for compressed, text, data, bss, virtual,
bitcode - can we deduce allocated section from any of those, or worth
adding it there?

I'm not too fussed/don't know well enough, but just throwing around some
ideas. (Adrian? Duncan? Eric? *shrug*)

Eh - how about we go with what you've got for now. Can revisit it later if
we want to.

On Thu, Dec 22, 2016 at 8:07 AM Adrian Prantl via Phabricator <
reviews at reviews.llvm.org> wrote:

> aprantl added inline comments.
>
>
> ================
> Comment at: ELF/GdbIndex.cpp:190
> +    return static_cast<const ELFSectionRef &>(Sec).getOffset();
> +  return 0;
>  }
> ----------------
> Would returning an Optional<uint64_t> be better here?
>
>
> https://reviews.llvm.org/D28045
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161222/de59e759/attachment.html>


More information about the llvm-commits mailing list