[llvm] [llvm-objcopy] Add llvm-objcopy option --set-visibility-sym (PR #80872)

James Henderson via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 8 00:38:58 PST 2024


================
@@ -962,6 +977,34 @@ objcopy::parseObjcopyOptions(ArrayRef<const char *> RawArgsArr,
 
     Config.SymbolsToAdd.push_back(*SymInfo);
   }
+  for (auto *Arg : InputArgs.filtered(OBJCOPY_set_visibility_sym)) {
+    if (!StringRef(Arg->getValue()).contains('='))
+      return createStringError(errc::invalid_argument,
+                               "bad format for --set-visibility-sym");
+    auto SymAndVis = StringRef(Arg->getValue()).split('=');
----------------
jh7370 wrote:

Let's use C++17 structured bindings here, i.e. `auto [Sym, Visibility] = ...`


https://github.com/llvm/llvm-project/pull/80872


More information about the llvm-commits mailing list