[PATCH] D14674: [RuntimeDyld] Add accessors to `SectionEntry`; NFC
Sanjoy Das via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 20 15:29:59 PST 2015
sanjoy added a comment.
In http://reviews.llvm.org/D14674#294341, @andrew.w.kaylor wrote:
> It seems like "Section.getAddress() + Offset" shows up pretty frequently. Do you think it's worth making a function to do that too?
>
> Otherwise, this all looks pretty straightforward. All of my comments are about cleaning up things that exist in the current code.
Thanks for the review!
About `getAddress` -- what do you think of an interface like
template<typename T = uint8_t>
T* getAddress(size_t Offset = 0) {
return static_cast<T *>(Address + Offset);
}
? That'll let us get rid of of the casts, and also add some bounds checking to `getAddress` in http://reviews.llvm.org/D14675.
http://reviews.llvm.org/D14674
More information about the llvm-commits
mailing list