[PATCH] D18959: [lld] Implement --dynamic-list

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 12 13:31:50 PDT 2016


ruiu added inline comments.

================
Comment at: ELF/Config.h:51-53
@@ -50,4 +50,5 @@
   std::string RPath;
   std::vector<llvm::StringRef> SearchPaths;
   std::vector<llvm::StringRef> Undefined;
+  std::vector<llvm::StringRef> DynamicList;
   bool AllowMultipleDefinition;
----------------
Sort.

================
Comment at: ELF/Driver.h:25
@@ -23,1 +24,3 @@
 
+using llvm::Optional;
+
----------------
Please don't use using in the header.

================
Comment at: ELF/Driver.h:35
@@ -31,2 +34,3 @@
   std::vector<MemoryBufferRef> getArchiveMembers(MemoryBufferRef MB);
+  Optional<MemoryBufferRef> readFile(StringRef Path);
   void readConfigs(llvm::opt::InputArgList &Args);
----------------
So you need to write llvm::Optional<...>

================
Comment at: ELF/DynamicList.h:23-28
@@ +22,8 @@
+
+class DynamicList {
+  friend class DynamicListParser;
+
+public:
+  static void read(MemoryBufferRef MB);
+};
+
----------------
Now you can remove this class and replace it with readDynamicList function.

================
Comment at: ELF/Writer.cpp:12
@@ -11,2 +11,3 @@
 #include "Config.h"
+#include "DynamicList.h"
 #include "LinkerScript.h"
----------------
Remove.

================
Comment at: ELF/Writer.cpp:1116
@@ +1115,3 @@
+  // dynamic list is processed.
+  for (StringRef S : Config->DynamicList) {
+    if (SymbolBody *B = Symtab.find(S))
----------------
Remove {}


http://reviews.llvm.org/D18959





More information about the llvm-commits mailing list