[PATCH] D13148: ELF2: Support reponse files.

Rafael EspĂ­ndola via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 25 06:39:26 PDT 2015


> +// 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::cl::ExpandResponseFiles(S, llvm::cl::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


More information about the llvm-commits mailing list