Replace command line arguments starting with '@' with their file contents.
Diff Detail
Event Timeline
ELF/DriverUtils.cpp | ||
---|---|---|
58–60 | Can you add the option @ to the help ? |
That's not a command line option but a meta-feature of that, so there's no
way to define an error message. Old LLD and Clang don't also print out a
help message for @, so it's probably not needed.
+ Creates a new command line by replacing options starting with '@'
+ character. '@<filename>' is replaced by the file's contents.
+std::vector<const char *>
+ArgParser::replaceResponseFiles(ArrayRef<const char *> Argv) {
+ SmallVector<const char *, 256> Tokens(Argv.data(), Argv.data() + Argv.size());
+ StringSaver S(Alloc);
+ llvm:🆑:ExpandResponseFiles(S, llvm:🆑:TokenizeGNUCommandLine, Tokens);
+ return std::vector<const char *>(Tokens.begin(), Tokens.end());
+}
Can you pass in a SmallVectorImpl& instead? Not much point in
collecting results in the stack just to copy them to the heap.
LGTM with that.
Cheers,
Rafael
Can you add the option @ to the help ?