[PATCH] D13392: [ELF2] - Implemented --exclude-libs flag

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 2 12:16:29 PDT 2015


ruiu added a comment.

I'm still reviewing this change, but I guess my question I have now is how important this feature is. Do you need this now, or is this high priority? New ELF LLD is still very early, and all code is likely to be refactored or modified, so I wouldn't want to add that much amount of code unless a feature is implemented pretty easily or important.


================
Comment at: ELF/Config.h:28
@@ -26,2 +27,3 @@
   std::string RPath;
+  llvm::SmallVector<llvm::StringRef, 5> ExcludeLibs;
   std::vector<llvm::StringRef> InputSearchPaths;
----------------
Just use std::vector.

================
Comment at: ELF/Driver.cpp:124-126
@@ +123,5 @@
+  if (auto *Arg = Args.getLastArg(OPT_exclude_libs)) {
+    StringRef ExcludeLibs = Arg->getValue();
+    SmallVector<StringRef, 5> Libs;
+    ExcludeLibs.split(Config->ExcludeLibs, ",", -1, false);
+  }
----------------
  SmallVector<StringRef, 5> V;
  Arg->getValue().split(V, ",", -1, false);
  Config->ExcludeLibs.append(Config->ExcludeLibs.end(), V.begin(), V.end());

================
Comment at: ELF/InputFiles.h:169
@@ -166,1 +168,3 @@
+
+  bool HideSymbols;
 };
----------------
bool HideSymbols = true;

================
Comment at: ELF/InputFiles.h:184-185
@@ -178,1 +183,4 @@
 
+  void setSymbolsHidden(bool Val) { SymbolsHidden = Val; }
+  bool areSymbolsHidden() { return SymbolsHidden; }
+
----------------
Do not define accessors if both are visible. They don't provide additional value. Just make the field public.

================
Comment at: ELF/InputFiles.h:191
@@ -182,2 +190,3 @@
 private:
+  bool SymbolsHidden;
   std::unique_ptr<Archive> File;
----------------
SymbolsHidden = false;


http://reviews.llvm.org/D13392





More information about the llvm-commits mailing list