Skip to content

[clang] preserve arguments after filtered response-file options - #2339

Merged
dulmarod merged 1 commit into
meta:mainfrom
VladimirMakaev:pr/rsp-filter-1127
Nov 30, 2026
Merged

dulmarod merged 1 commit into
meta:mainfrom
VladimirMakaev:pr/rsp-filter-1127

Conversation

@VladimirMakaev

Copy link
Copy Markdown
Contributor

When a removed option still needs its value, filtering consumed the next response-file token as that
value and discarded all the file's remaining arguments. Expand the file first, then remove only the
actual value. Preserve pending values across file boundaries.

Track active response files to prevent recursion while allowing later occurrences to be filtered.
Ignore blank lines without discarding quoted empty arguments. Unchanged response files retain their
original command-line tokens.

# options.rsp: -mllvm
# values.rsp: -inline-threshold=7, -DKEEP=1, -std=c++17 (one argument per line)
clang++ @options.rsp @values.rsp -c example.cpp
# previously lost the define and language flags from values.rsp

Limitations: response files retain the existing format of one argument per line with simple quote
stripping.

Test plan

Twelve argument tests plus existing Clang unit tests; compiler-validated end-to-end capture matrix
including direct, forwarded, nested, repeated and blank-line response files; unchanged-command argv
comparison; full regression suite and fourteen-project report, trace, summary and cost comparison.

When a removed option still needs its value, filtering consumed the next response-file token as that
value and discarded all the file's remaining arguments. Expand the file first, then remove only the
actual value. Preserve pending values across file boundaries.

Track active response files to prevent recursion while allowing later occurrences to be filtered.
Ignore blank lines without discarding quoted empty arguments. Unchanged response files retain their
original command-line tokens.

```sh
# options.rsp: -mllvm
# values.rsp: -inline-threshold=7, -DKEEP=1, -std=c++17 (one argument per line)
clang++ @options.rsp @values.rsp -c example.cpp
# previously lost the define and language flags from values.rsp
```

Limitations: response files retain the existing format of one argument per line with simple quote
stripping.

## Test plan

Twelve argument tests plus existing Clang unit tests; compiler-validated end-to-end capture matrix
including direct, forwarded, nested, repeated and blank-line response files; unchanged-command argv
comparison; full regression suite and fourteen-project report, trace, summary and cost comparison.
@meta-cla meta-cla Bot added the CLA Signed label Nov 27, 2026
@dulmarod
dulmarod merged commit ee47d5c into meta:main Nov 30, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants