[PATCH] D92149: [mac/lld] Add support for response files

Nico Weber via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 30 05:24:19 PST 2020


This revision was automatically updated to reflect the committed changes.
Closed by commit rGd20abb1ec3b6: [mac/lld] Add support for response files (authored by thakis).
Herald added a project: LLVM.

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D92149/new/

https://reviews.llvm.org/D92149

Files:
  lld/MachO/DriverUtils.cpp
  lld/test/MachO/responsefile.test


Index: lld/test/MachO/responsefile.test
===================================================================
--- /dev/null
+++ lld/test/MachO/responsefile.test
@@ -0,0 +1,4 @@
+# RUN: echo --help > %t.rsp
+
+# RUN: %lld @%t.rsp | FileCheck %s
+CHECK: OVERVIEW: LLVM Linker
Index: lld/MachO/DriverUtils.cpp
===================================================================
--- lld/MachO/DriverUtils.cpp
+++ lld/MachO/DriverUtils.cpp
@@ -14,6 +14,7 @@
 #include "llvm/Option/Arg.h"
 #include "llvm/Option/ArgList.h"
 #include "llvm/Option/Option.h"
+#include "llvm/Support/CommandLine.h"
 #include "llvm/Support/Path.h"
 #include "llvm/TextAPI/MachO/TextAPIReader.h"
 
@@ -68,6 +69,9 @@
   unsigned missingCount;
   SmallVector<const char *, 256> vec(argv.data(), argv.data() + argv.size());
 
+  // Expand response files (arguments in the form of @<filename>)
+  // and then parse the argument again.
+  cl::ExpandResponseFiles(saver, cl::TokenizeGNUCommandLine, vec);
   opt::InputArgList args = ParseArgs(vec, missingIndex, missingCount);
 
   if (missingCount)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D92149.308334.patch
Type: text/x-patch
Size: 1064 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201130/63a90b1b/attachment-0001.bin>


More information about the llvm-commits mailing list