mirror of
https://github.com/intel/llvm.git
synced 2026-01-16 05:32:28 +08:00
[mac/lld] Add support for response files
ld64 learned about them in Xcode 12, so we should too. Differential Revision: https://reviews.llvm.org/D92149
This commit is contained in:
@@ -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 @@ opt::InputArgList MachOOptTable::parse(ArrayRef<const char *> argv) {
|
||||
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)
|
||||
|
||||
4
lld/test/MachO/responsefile.test
Normal file
4
lld/test/MachO/responsefile.test
Normal file
@@ -0,0 +1,4 @@
|
||||
# RUN: echo --help > %t.rsp
|
||||
|
||||
# RUN: %lld @%t.rsp | FileCheck %s
|
||||
CHECK: OVERVIEW: LLVM Linker
|
||||
Reference in New Issue
Block a user