[PATCH] D26914: [ELF] Print file name and section offset in .eh_frame parser
Rui Ueyama via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 21 08:16:10 PST 2016
ruiu added inline comments.
================
Comment at: ELF/EhFrame.cpp:143
-template <class ELFT> uint8_t getFdeEncoding(ArrayRef<uint8_t> D) {
+template <class ELFT> uint8_t elf::getFdeEncoding(EhSectionPiece *P) {
+ ArrayRef<uint8_t> D = P->data();
----------------
evgeny777 wrote:
> ruiu wrote:
> > I'd add this function to ReadHelper to eliminate `H.` from this function. And then probably you want to rename ReadHelper EhReader or something like that.
> >
> > You can also eliminate `ArrayRef<uint_8> &` from read* functions if you make the ArrayRef a member of the class.
> This function is called from outside (OutputSections.cpp), so the caller should construct EhReader then. Is this good?
You can keep the existing function interface, right?
template <class ELFT> uint8_t elf::getFdeEncoding(EhSectionPiece *Piece) {
auto *Sec = cast<InputSectionBase<ELFT> *>(Piece->ID);
return EhReader(Sec, Piece->data()).getFdeEncoding();
}
Repository:
rL LLVM
https://reviews.llvm.org/D26914
More information about the llvm-commits
mailing list