[PATCH] D23768: [ELF] Linkerscript: eliminate LayoutInputSection

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 31 08:04:33 PDT 2016


ruiu accepted this revision.
ruiu added a comment.

LGTM with this change.


================
Comment at: ELF/LinkerScript.cpp:214-217
@@ -257,1 +213,6 @@
+    for (InputSectionBase<ELFT> *S : V)
+      if (S->OutSec == nullptr) {
+        Ret.push_back(S);
+        S->OutSec = reinterpret_cast<OutputSectionBase<ELFT> *>(-1ULL);
+      }
   }
----------------
Setting -1 to the pointer to record whether an input section is added or not is an unintended use of the pointer and pretty confusing. Please use a DenseSet to uniquefy.


https://reviews.llvm.org/D23768





More information about the llvm-commits mailing list