[PATCH] D65372: [llvm-objcopy] Add support for response files in llvm-strip and llvm-objcopy
Mike Pozulp via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sat Jul 27 18:14:40 PDT 2019
mmpozulp marked an inline comment as done.
mmpozulp added inline comments.
================
Comment at: llvm/tools/llvm-objcopy/llvm-objcopy.cpp:316-326
+ // Expand response files.
+ SmallVector<const char *, 20> newArgv(argv, argv + argc);
+ BumpPtrAllocator A;
+ StringSaver Saver(A);
+ cl::ExpandResponseFiles(Saver,
+ Triple(sys::getProcessTriple()).isOSWindows()
+ ? cl::TokenizeWindowsCommandLine
----------------
I copied these lines from lib/Support/CommandLine.cpp where they appear as
```
bool CommandLineParser::ParseCommandLineOptions(int argc,
const char *const *argv,
StringRef Overview,
raw_ostream *Errs,
bool LongOptionsUseDoubleDash) {
assert(hasOptions() && "No options specified!");
// Expand response files.
SmallVector<const char *, 20> newArgv(argv, argv + argc);
BumpPtrAllocator A;
StringSaver Saver(A);
ExpandResponseFiles(Saver,
Triple(sys::getProcessTriple()).isOSWindows() ?
cl::TokenizeWindowsCommandLine : cl::TokenizeGNUCommandLine,
newArgv);
argv = &newArgv[0];
argc = static_cast<int>(newArgv.size());
...
```
Should these lines be a separate function in the CommandLine library, or is it better to be repetitive here?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D65372/new/
https://reviews.llvm.org/D65372
More information about the llvm-commits
mailing list