[PATCH] D37626: [ELF] Scan .eh_frame sections precisely in order to eliminate unused LSDAs and personality routines.

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 25 10:51:23 PDT 2017


ruiu added a comment.

I still want to explore the idea of https://reviews.llvm.org/D38391 instead of this because that approach seems more "correct" to me, and this patch seems fairly complex. We may end up with this patch insetad of https://reviews.llvm.org/D38391, but it should be worth a try to reduce complexity.



================
Comment at: ELF/MarkLive.cpp:269-271
+  // The flag is set if an executable section is added to the queue.
+  // We scan .eh_frame sections only if the flag is set.
+  bool ExecInQueue = false;
----------------
ikudrin wrote:
> ruiu wrote:
> > Isn't this a premature optimization? I wouldn't add this unless it is proved to be actually effective.
> I don't think so. It really helps to avoid the second scan of EH frames in most cases.
But how much time you can save? I feel like we shouldn't optimize it at the moment.


================
Comment at: ELF/MarkLive.cpp:50-52
+public:
+  void add(EhSectionPiece *Cie);
+  EhSectionPiece *get(const EhSectionPiece &Fde, uint32_t ID) const;
----------------
We usually write public members first.


================
Comment at: ELF/MarkLive.cpp:115
+
+EhSectionPiece *EhFrameSectionCies::get(const EhSectionPiece &Fde,
+                                        uint32_t ID) const {
----------------
This needs a function comment. If I understand it correctly, this function takes an FDE and returns an CIE that the given FDE belongs to. Is this correct?


https://reviews.llvm.org/D37626





More information about the llvm-commits mailing list