[PATCH] D19977: [ELF] - Move section factory out from writer to make it reusable.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Thu May 5 18:34:37 PDT 2016


ruiu added a comment.

This is probably towards the right direction, but let's hold on until http://reviews.llvm.org/D19976 is settled.


================
Comment at: ELF/OutputSections.h:617-621
@@ -615,1 +616,7 @@
 
+// This class knows how to create an output section for a given
+// input section. Output section type is determined by various
+// factors, including input section's sh_flags, sh_type and
+// linker scripts.
+template <bool Is64Bits> struct SectionKey {
+  typedef typename std::conditional<Is64Bits, uint64_t, uint32_t>::type uintX_t;
----------------
This class (actually a struct) doesn't know how to create output sections. You have moved the comment to a wrong place.

================
Comment at: ELF/OutputSections.h:622
@@ +621,3 @@
+template <bool Is64Bits> struct SectionKey {
+  typedef typename std::conditional<Is64Bits, uint64_t, uint32_t>::type uintX_t;
+  StringRef Name;
----------------
I'd type it to ELFT rather than Is64Bits.


http://reviews.llvm.org/D19977





More information about the llvm-commits mailing list