[PATCH] D42960: [ELF] Add .eh_frame pieces to map file

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 6 10:18:57 PST 2018


ruiu added inline comments.


================
Comment at: ELF/InputSection.h:347
 
-std::string toString(const elf::InputSectionBase *);
+std::string toString(const elf::InputSectionBase *, uint64_t SecOffset = 0);
 } // namespace lld
----------------
I don't think this is a good idea. lld::toString(T) is an overloaded function dispatched by its parameter type. But you are now defining a different function which you only use in MapFile.cpp. I'd move this back to the original file.


================
Comment at: ELF/MapFile.cpp:141
     for (InputSection *IS : getInputSections(OSec)) {
+      if (IS == InX::EhFrame) {
+        InputSectionBase *ISec = nullptr;
----------------
This is still too long. When you add a large amount of code to an existing function, please try to make it simple -- by splitting it up, refactor, etc.


https://reviews.llvm.org/D42960





More information about the llvm-commits mailing list