[clang] [clang-scan-deps] Expand response files before the argument adjuster (PR #89950)

Alexandre Ganea via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 29 13:04:18 PDT 2024


================
@@ -0,0 +1,36 @@
+// Check that the scanner can adjust arguments by reading .rsp files in advance.
+
+// RUN: rm -rf %t
+// RUN: split-file %s %t
+// RUN: sed -e "s|DIR|%/t|g" %t/cdb.json.template > %t/cdb.json
----------------
aganea wrote:

As suggested. We're taking a different codepath when using the immediate mode (using `InplaceCompilationDatabase`) and that expands the response files in `OptTable::parseArgs()` so I wasn't really covering all the changes in the patch. I've added tests for both cases. The immediate mode allowed me to uncover a bug in `ParseArgs()`: `Saver` and `Alloc` were local to the function but we were using their contents to populate `CommandLine`. I fixed that too.

https://github.com/llvm/llvm-project/pull/89950


More information about the cfe-commits mailing list