[PATCH] D22749: [ELF] - Linkerscript: Implemented SORT command

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 28 12:30:36 PDT 2016


ruiu added inline comments.

================
Comment at: ELF/LinkerScript.cpp:120-123
@@ +119,6 @@
+template <class ELFT>
+static void addSections(OutputSectionFactory<ELFT> &Factory,
+                        std::vector<OutputSectionBase<ELFT> *> &Out,
+                        std::vector<InputSectionBase<ELFT> *> &In,
+                        StringRef Name, bool Sort) {
+  if (Sort)
----------------
This little helper seems to take too much arguments. I'd be nice if you can reduce it (though I have no clear idea how.)

================
Comment at: ELF/LinkerScript.cpp:728-730
@@ -697,1 +727,5 @@
+    expect(")");
+  }
+  else
+    readInputSectionRules(InCmd, false);
 }
----------------
Format.

================
Comment at: ELF/LinkerScript.cpp:767
@@ -732,4 +766,3 @@
   while (!Error && !skip("}")) {
-    StringRef Tok = next();
-    if (Tok == "*") {
+    if ((!peek().empty() && peek()[0] == '*') || peek() == "KEEP") {
       auto *InCmd = new InputSectionDescription();
----------------
peek().startswith("*")


https://reviews.llvm.org/D22749





More information about the llvm-commits mailing list