[PATCH] D24917: Resolve response file names relative to including file

Serge Pavlov via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 5 23:35:56 PDT 2016


sepavloff added inline comments.


> rnk wrote in CommandLine.cpp:947
> Can we do the relativization logic here rather than doing two complete scans of the response file tokens? Presumably they will be large.

Although it may not be obvious initially, there is no full rescan here. Two functions `ExpandResponseFiles` and `ExpandResponseFiles` make recursive response file expansion without actual recursion.  `ExpandResponseFiles` operates on command line already split into arguments by OS command processor. It scans only first symbols of arguments looking for '@'. For each response file it calls `ExpandResponseFile`, which replaces `@file` by its split content. It may cause shift arguments that follow `@file` down but all these arguments are unexpanded. Then `ExpandResponseFiles` continues the scan from the first argument obtained from the file expansion. So, `ExpandResponseFiles` is called only once for a response file and `ExpandResponseFiles` does not scan each argument more than once.

https://reviews.llvm.org/D24917





More information about the llvm-commits mailing list